Host specific issues zend guard - Gallery Codex
Personal tools

Host specific issues zend guard

From Gallery Codex

Gallery3 produces a blank page or internal server error with versions of php such as 5.3 Checking the code it was packing up at the kohana initialise stage

after a lot of searching eventually i found

  1. Problem is to do with Zend Guard being installed in the php 5.3 by default.
  2. One cannot disable zend guard on a shared server using php.ini or .htaccess [my results anyway]
  3. There is a Taiwanese website at http://blog.teatime.com.tw/1/post/403 which gives a solution recoding kohana so the fault does not arise. It seems the kohana version in gallery3 is too old to run with the new zend guard in php 5.3
  4. The page above alters kohana.php and adds in around line 705 so the code looks like
		if ($filename = Kohana::find_file($type, $file))
		{
			// Load the class
			require $filename;
		}
		else
		{
			// The class could not be found
			//jph added code=========================
                      // twu2 begin
                      // avoid segmentation fault in Zend Guard
                      // because when ZendGuardLoader enable, it will try to load the same class again if it's not exist, then... it will try a random name, then segmentation fault
                      // so we keep the name first, then if it try again                       
// create a dummy class for it                       //
                       // only check this if ZendGuardLoader exist
                      if (extension_loaded('Zend Guard Loader')) {
                               static $last_name = '';

                               // reject it first
                               if ($last_name !== $class) {
                                       $last_name = $class;
                                       return FALSE;
                              }
                              // create dummy one if try again
                               Kohana_Log::add('debug', 'create dummy class: '.$class);
                               eval("class $class { }");
                       }
                      // twu2 end			//=======================
			return FALSE;
		}

please modify your kohana.php it seems to clear the fault.