Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Syntax error reporting issue
  • Hello community, My fuelphp instead of showing me my syntax error it shows the following:
    Fatal error: Call to a member function setKey() on a non-object in /fuel/core/classes/crypt.php on line 127 

    Do you have any idea?
  • Which version of FuelPHP? Installed like that or upgraded from a previous version? You get this error if the Crypt_AES class (part of PHPSecLib) can not be loaded. Did you modify anything in the core? Did you alter your app bootstrap to interfere with the autoloader?
  • Hello Harro and thanks for the reply I use 1.2(not 1.2.1) upgraded from 1.1 Of course I didn't modify the core. The only change I made to the app bootstrap was to add a Class I wanted to override (pagination)
  • Don't think Crypt has changed over the last few versions. Is PHPSecLib present in core/vendor? And readable by the webserver? Can you startup oil console, and type
    $x = new \PHPSecLib\Crypt_AES();
    any errors?
  • I get this:
    Warning - file(//fuel/packages/oil/classes/console.php(91) : eval()'d code): failed to open stream: No such file or directory in COREPATH/classes/debug.php on line 240
    Warning - array_unshift() expects parameter 1 to be array, boolean given in COREPATH/classes/debug.php on line 241
    Warning - array_slice() expects parameter 1 to be array, boolean given in COREPATH/classes/debug.php on line 256
    Warning - Invalid argument supplied for foreach() in COREPATH/classes/debug.php on line 263
    Error - Class 'PHPSecLib\Crypt_AES' not found in PKGPATH/oil/classes/console.php(91) : eval()'d code on line 1
  • Have you updated the rest of the bootstrap, and your index.php? Both have been changed in 1.2 (compared to 1.1). And I made a mistake in my previous message. In 1.2, PHPSecLib can not be autoloaded, so you have to load it manually using
    import('phpseclib/Crypt/AES', 'vendor');
    Can you type this into the console, and then try to instantiate the class? I'm still clueless...
  • Bootstrap and index.php are indentical except the Event::shutdown on the last line in index.php. The Class instantiated correctly when I used the import in oil console. Which is the right file to include the import statement?
    Shouldn't that work out of the box? ps. the formatting buttons dont work in Firefox Ubuntu, thats why I dont use them :)
  • I copied the import() line from the Crypt class. If that works in oil, then the class loads correctly. Are you sure your core is fully in sync? I'm clueless to why this happens. Can you install a new 1.2.1 in a new virtual host, and see if you can reproduce the error? And we know buttons don't work. They don't work in any browser. A new forum is on the way...
  • Harro, thanks a mill for your help. I am now certain that my core is not in full sync. I already installed an new 1.2.1 and it works great. That should be the problem to my 1.2.0 installation too. Eager to see the new forum!

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion