Jump to content

Moving from PHP5.6 to PHP7 with Prestashop 1.6.1.18


seanr22a

Recommended Posts

I want to upgrade from PHP 5.6 to PHP7 on my server but doing so I get 500 Internal Server Error in both front and back office. Turning on debug I see this:

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /volume1/web/prestashop/classes/db/MySQL.php:51 
Stack trace: #0 /volume1/web/prestashop/classes/db/Db.php(319): MySQLCore->connect() 
#1 /volume1/web/prestashop/classes/db/Db.php(239): DbCore->__construct('127.0.0.1:3307', 'root', 'xxxxxxxxxxxxxxx', 'prestashop') 
#2 /volume1/web/prestashop/config/alias.php(66): DbCore::getInstance() 
#3 /volume1/web/prestashop/classes/shop/Shop.php(329): pSQL('www.mysite.com') 
#4 /volume1/web/prestashop/config/config.inc.php(114): ShopCore::initialize() 
#5 /volume1/web/prestashop/adminxxxxxxxx/index.php(36): require('/volume1/web/pr...') 
#6 {main} thrown in /volume1/web/prestashop/classes/db/MySQL.php on line 51


 I went back to PHP5.6 again and everything running fine. Any ideas ?

 

Link to comment
Share on other sites

the mysql driver is no longer supported in PHP 7.

you will need to ensure that either the pdo_mysql or mysqli extensions are installed and enabled for your PHP 7 installation.  you should work directly with your hosting provider if you are unable to do this yourself.

  • Like 1
Link to comment
Share on other sites

On 4/27/2018 at 1:33 PM, bellini13 said:

the mysql driver is no longer supported in PHP 7.

you will need to ensure that either the pdo_mysql or mysqli extensions are installed and enabled for your PHP 7 installation.  you should work directly with your hosting provider if you are unable to do this yourself.

 

I finaly got the time to try your suggestion. I enabled the same extensions in PHP7 as in PHP5.6 and now it's working! Many thanks for pointing me in the right direction. 

Link to comment
Share on other sites

  • 8 months later...
  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...