On Ubuntu or Debian machines, if session.save_pathI found out that there is not set, then session files are saved in /var/lib/php5
by defaulta difference between how Zend and HHVM interprete the php key() function.
If you checkIn the hhvm logs in /var/log/hhvm/error.log
Drupal commerce_checkout module there is a function that returns the first key of an errorarray by using the php key() function (commerce_checkout.module, line 480).
\nFatal error: Failed to initialize storage module: user (path: /var/lib/php5) in /var/www/html/commerce-demo/includes/session.inc on line 287
/**
* Returns the page ID of the first checkout page sorted by weight.
*/
function commerce_checkout_first_checkout_page() {
return key(commerce_checkout_pages());
}
Drupal/PHP fails to create a session in the drupal_session_start()
function becauseOn the default location to storeZend rendering engine this returned the session files /var/lib/php5
does not exist ordesired result of the first array key. But in HHVM this returned nothing. I believe this is because the pointers of the array were not known within our setup with hhvmflushed by HHVM (maybe for performance reasons), and they were flushed in the Zend engine.
In my Drupal settings.php file I addeddon't think it was a good idea of the creaters of this module to use the bottomkey() function to get the first key of the array anyway
I now rewrote this function to this:
ini_set("session/**
* Returns the page ID of the first checkout page sorted by weight.save_path",
""*/
function commerce_checkout_first_checkout_page() {
return reset(array_keys(commerce_checkout_pages()));
}
This resetsGetting the path to ""
keys of the array first and then with reset(an empty string), by default this evaluates rewind the array's internal pointer to the temp folder offirst element and return the systemvalue of that first array element.
This helped me: http://stackoverflow.com/questions/4927850/location-for-session-files-in-apache-php
To findOf course the current session save path, you can use session_save_path()
key(Get and/or set the current session save path) function did the job on the standard Zend engine, but for HHVM this didn't.
Why drupal failedI will report this issue to create only the sessions related tomaintenance crew of the checkout page is not clear to medrupal commerce module, but nowand hopefully it works ;will be commited into the next release. I don't think there is anything wrong with the way HHVM interprets the key function (if I am right in thinking this is the root of the problem). I think the key() function just shouldn't be used like this in this situation.