PHP Error “Class String could not be loaded”

32 views
Skip to first unread message

Zach Lym

unread,
Jan 12, 2016, 3:25:32 PM1/12/16
to Haxe
One of our servers started throwing the following stacktrace:

    uncaught exception: Class String could not be loaded
    in file: /path/to/haxe-php-lib/lib/php/Boot.class.php line 751<br />#0 [internal function]: spl_autoload('String')
    /path/to/haxe-php-lib/lib/php/Boot.class.php(751): property_exists('String', '__meta__')
    /path/to/haxe-php-lib/lib/php/Boot.class.php(857): _hx_type->__construct('String', 'String')
    /path/to/NativePHPUtil.php(334): require_once('/path/to/haxe-php-lib/include.php') //include.php is basically `require_once dirname(__FILE__).'/lib/php/Boot.class.php'; restore_exception_handler();`
    [internal function]: NativePHPUtil->addRecord('record-name', 'record-type', Object(stdClass))
    /path/to/NativePHPController.php(244): call_user_func_array(Array, Array)
    /path/index.php(89): NativePHPController->handle()
    {main}

Function from Boot.class.php line 751 [1]:
    
public function __construct($cn, $qn, $path = null) {
$this->__tname__ = $cn;
$this->__qname__ = $qn;
$this->__path__ = $path;
if(property_exists($cn, '__meta__'))
$this->__meta__ =  eval($cn.'::$__meta__');
}

This just started happening on my testing server (PHP 5.3 on Debian) a few days ago but everything runs fine on my production server and both servers are running the exact same code!  There were no obvious changes to prompt the issue and I've tried pulling down a fresh copy from Git, copying it over manually, fiddling with permissions, and turning off code removal for the PHP build.  

Simply commenting out the if statement appears to fix everything, but that's a crappy hack.  Any guesses as to what might be causing the problem?


Andreas Mokros

unread,
Jan 12, 2016, 7:03:02 PM1/12/16
to haxe...@googlegroups.com
Hi.

On Tue, 12 Jan 2016 12:25:32 -0800 (PST)
Zach Lym <indol...@gmail.com> wrote:
> uncaught exception: Class String could not be loaded
> in file: /path/to/haxe-php-lib/lib/php/Boot.class.php line 751<br />#0
> [internal function]: spl_autoload('String')

Looks like a problem with the autoloader. Do you have a cache folder with
haxe_autoload.php? If so, try to delete haxe_autoload.php.

--
Mockey
Reply all
Reply to author
Forward
0 new messages