[2.7] CakePHP on PHP7 #8087

Closed
davidsteinsland opened this Issue Jan 22, 2016 · 3 comments

Comments

Projects
None yet
3 participants
Contributor

davidsteinsland commented Jan 22, 2016

  • Warning about srand wanting an integer, got string:

https://github.com/cakephp/cakephp/blob/2.7/lib/Cake/Utility/Security.php#L190

// Warning (2): srand() expects parameter 1 to be integer, string given
srand(Configure::read('Security.cipherSeed'));

This should be cast to int, no?

  • Sessions:
    I have a basic DatabaseSession configuration.
    Warning (4096): session_regenerate_id(): Failed to create(read) session ID: user (path: /var/lib/php/sessions)
CakeSession::renew() - APP/Vendor/cakephp/cakephp/lib/Cake/Model/Datasource/CakeSession.php, line 756
SessionComponent::renew() - APP/Vendor/cakephp/cakephp/lib/Cake/Controller/Component/SessionComponent.php, line 150
AuthComponent::login() - APP/Vendor/cakephp/cakephp/lib/Cake/Controller/Component/AuthComponent.php, line 612
  • Warning (2): session_write_close(): Session callback expects true/false return value in [Vendor/cakephp/cakephp/lib/Cake/Network/CakeResponse.php, line 1462]

Fixed by casting return values of DatabaseSession::write() to bool. The return value was model->save().


Is CakePHP 2.7 even tested on PHP 7 ... ?

Member

dereuromark commented Jan 22, 2016

@davidsteinsland As you can see from the travis files, only 2.8+ is PHP7 compatible.
Please upgrade to that if you need PHP7 compatibility.

Please also see http://book.cakephp.org/2.0/en/appendices/2-8-migration-guide.html#php7-compatibility

@dereuromark dereuromark added this to the 2.8.0 milestone Jan 22, 2016

Contributor

davidsteinsland commented Jan 22, 2016

No, I'm not upgrading to a non-stable RC version in our production environments.

Owner

markstory commented Jan 22, 2016

Is CakePHP 2.7 even tested on PHP 7 ... ?

No it is not. One of the goals for 2.8 is to resolve PHP7 compatibility issues. The 2.8 release is API stable, and we're hoping that people using 2.x and PHP7 try it out in non-production setups and help us flush out any remaining issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment