Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Fatal error: Uncaught Error: Class 'PHPSecLib\Crypt_AES' not found on Heroku
  • Hello folks,

    I got following errors when I deploy to Heroku.

    Fatal error: Uncaught Error: Class 'PHPSecLib\Crypt_AES' not found in /app/web/rakuten/core/classes/crypt.php:39 Stack trace: #0 [internal function]: Fuel\Core\Crypt::_init() #1 /app/web/rakuten/core/classes/autoloader.php(375): call_user_func('Crypt::_init') #2 /app/web/rakuten/core/classes/autoloader.php(249): Fuel\Core\Autoloader::init_class('Crypt') #3 [internal function]: Fuel\Core\Autoloader::load('Crypt') #4 /app/web/rakuten/core/classes/session/driver.php(496): spl_autoload_call('Crypt') #5 /app/web/rakuten/core/classes/session/cookie.php(143): Fuel\Core\Session_Driver->_set_cookie('a:3:{i:0;a:6:{s...') #6 [internal function]: Fuel\Core\Session_Cookie->write('', Array) #7 /app/web/rakuten/core/classes/event/instance.php(161): call_user_func(Array, '', Array) #8 /app/web/rakuten/core/bootstrap.php(62): Fuel\Core\Event_Instance->trigger('fuel-shutdown', '', 'none', true) #9 [internal function]: {closure}() #10 {main} thrown in /app/web/rakuten/core/classes/crypt.php on line 39

    I have installed fuelPHP on my local machine and do not have these errors, which means running fine on my local machine.

    The fuelPHP version is 1.7.3 and I guess it is the latest one.

    Dose anyone encounter these errors before?

    I was looking for similar errors on Google.

    However I could not fine it out.

    So, please help me out if anyone know the solution to it.

    Best regards,
  • The latest Fuel version is 1.8.0.

    1.8.x uses the standard PHPSecLib, which is installed using Composer.

    1.7.x uses a customized version of PHPSecLib, which is in /fuel/core/vendor/phpseclib. I can't comment on why it can't find it, I am not familiar with Heroku. I don't see any immediate reason, Fuel has been using PHPSecLib this way for years.
  • Thank you very much for your comment.

    Well...Yes, it is weird for me too.

    It seems to me that there is no problem with it.

    I was trying to find the reason why this is happening for a day, but, I cant find it out.

    Well...possibly, I better migrate to 1.8 since it is stable version, right?

    I will consider about it.
  • Probably best to wait a few days, there's a hotfix in the making that fixes a few urgent issues.
  • Hello Harro,

    Thank you very much for your quick response.

    I really appreciate your help.

    Well..I will wait for few days for update and try to deploy.

  • Hotfix has been released. If you're on 1.8, a "composer update" should install it automatically.

    Note that there is also an update of the public/index.php file. Depending on how you have constructed your local environment, it might not be updated by composer.
  • Hello Harro,

    Thank you very much for informing me.

    I will try it out.

  • Hello sir,

    New new one has not been release yet.

    Possibly, another day to wait.

    Until it is released, I will stack on 1.7,3.

    By the way, it seems to me the issue of phpseclib is that Heroku dose not allow me to load it.

    Anyone can help me?

    Now I got following.

    Fatal error: Class 'Fuel\Core\Crypt_AES' not found in /app/web/rakuten/core/classes/crypt.php on line 39

    Thank you.
  • It is released. It installs automatically when you are already on 1.8.

    What I don't understand: It says "Fuel\Core\Crypt_AES" not found. The class isn't in that namespace at all, it is in the "PHPSecLib" namespace.

    The 1.7.3 version of the Crypt class defines it at the top:

    use \PHPSecLib\Crypt_AES;

    So it looks like you have other problems. Are you sure your framework files are correct?

    Your original error message did use the correct namespace. But for some reason that still had the error. What PHP version is Heroku using?
  • Hello Harro,

    Thank you for reply.

    I know that it is defined on the top of class and so it should be loaded before the occurrence of error.

    PHP version is 5.5.13.

    Is this okay?

  • PHP version is fine.

    You are sure all files are there, you haven't by any change installed the PHPSecLib composer package (not supported before 1.8), all permissions are ok?
  • Hello there,

    There is no missing files.

    I zip entire file and commit to Heroku.

    Well... I will try 1.8 when I finish developing current app.

    Thank you for your help.

  • HarroHarro
    Accepted Answer
    Then I really don't know. I have no experience with Heroku.
  • Okay, thank you very much for you help.

    If I could solve the issue then I let you know about it.
  • I see the V1.9 version has dropped the phpseclib package in composer - is that correct, or should it be included?


    So even with phpseclib required in composer.json, it refused to install anything under /fuel/vendor/phpseclib/ (Only an empty directory with no files) Only after deleting the folder "phpseclib" from the "vendor directory and running composer update again did it actually do and install something. So I'm not sure where the fault is here.
  • Not sure either. I install new clones of the repo regularly, and never seen this issue.
  • Finding this issue on a Joomla site that requires a Piwik package, have to delete the Piwik folder before running composer update to get it to do anything. So I'm officially blaming composer.

Howdy, Stranger!

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

In this Discussion