MathiasReker Posted July 23, 2016 Share Posted July 23, 2016 (edited) Hello, MySQL version 10.1.6-MariaDB-cll-lve PrestaShop version 1.6.1.6 When I upgrade to PHP 7.0.8, my prestashop turn into white screen. In error log I got the following: PHP Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home/**********/public_html/classes/db/MySQL.php:51 Stack trace: #0 /home/**********/public_html/classes/db/Db.php(319): MySQLCore->connect() #1 /home/**********/public_html/classes/db/Db.php(239): DbCore->__construct('localhost', '**********', '**********', '**********') #2 /home/**********/public_html/config/alias.php(66): DbCore::getInstance() #3 /home/**********/public_html/classes/shop/Shop.php(329): pSQL('**********') #4 /home/**********/public_html/config/config.inc.php(114): ShopCore::initialize() #5 /home/**********/public_html/index.php(27): require('**********') #6 {main} thrown in /home/shinetec/public_html/classes/db/MySQL.php on line 51 Theme is compatibel with PHP7 and all my modules are too. It looks like prestashop is using a function, that are not supported in PHP7: https://secure.php.net/manual/en/function.mysql-connect.php Any fix for this?Best regardsMathias Edited July 23, 2016 by shinetech.dk (see edit history) Link to comment Share on other sites More sharing options...
selectshop.at Posted July 23, 2016 Share Posted July 23, 2016 The problem is on DB-version you are using, not php 7. Prestashop needs mySQL driver DbPDO for to work. You should take into consideration for now to move to another DB version which uses PDO. Link to comment Share on other sites More sharing options...
MathiasReker Posted July 23, 2016 Author Share Posted July 23, 2016 How do I solve this? Link to comment Share on other sites More sharing options...
selectshop.at Posted July 23, 2016 Share Posted July 23, 2016 I don't know if latest Maria DB is now using PDO drivers as well you can select on install or configure after, it was a long time ago that I played with it. Native driver for MariaDB was ODBC. You should search on net for MaiaDB and PDO driver, install it and use it instead. If it is already installed (ask server administrator), than it should be correct configured. Link to comment Share on other sites More sharing options...
MathiasReker Posted July 23, 2016 Author Share Posted July 23, 2016 Thank you alot! I will ask my hosting to fix this. Link to comment Share on other sites More sharing options...
selectshop.at Posted July 23, 2016 Share Posted July 23, 2016 The best is to move to mySQL database.... which BTW is not the same: https://www.google.at/#q=differences+mariadb+and+mysql Link to comment Share on other sites More sharing options...
selectshop.at Posted July 23, 2016 Share Posted July 23, 2016 Another important thing I forgot to mention: Prestashop runs better with InnoDB as SQL-engine, they more and more replace myISAM. From what I know MariaDB also does not support InnoDB. You should move to mySQL if you intend to work with Prestashop 1.7. in future as well. Link to comment Share on other sites More sharing options...
musicmaster Posted July 23, 2016 Share Posted July 23, 2016 I am very puzzled by this discussion. First of all MariaDb is now very popular and among others it is standard supplied with Xampp. So if Prestashop would not support that it would be a major blunder. It has also been known for a very long time that PHP 7 would not support mysql_connect() and related functions. But you don't need PDO instead. Using mysqli_connect and the other mysqli_ functions instead would be enough. And that wouldn't be a big thing. Third: MariaDb does support InnoDb. 1 Link to comment Share on other sites More sharing options...
selectshop.at Posted July 23, 2016 Share Posted July 23, 2016 I am very puzzled by this discussion. First of all MariaDb is now very popular and among others it is standard supplied with Xampp. So if Prestashop would not support that it would be a major blunder. It has also been known for a very long time that PHP 7 would not support mysql_connect() and related functions. But you don't need PDO instead. Using mysqli_connect and the other mysqli_ functions instead would be enough. And that wouldn't be a big thing. Third: MariaDb does support InnoDb. Specially the PS-Version 1.6.1.6 was designed/debuged for to run with php7. 1) MariaDB although is a standard for xampp, which btw is a version for developers and not a version for to live use, you need to install pdo driver (which is possible, but needs some special configuration). Personally I never will advise one of my customers to use xampp or lamp for to run on a live server. This software was designed for developers and not for live use! Propagated on their own site: What is XAMPP? XAMPP is the most popular PHP development environment 2) I told all the possibilities above: MariaDB with pdo driver (and further problems/incompatibility in future, if innoDB is forced). or mySQL which natively has the InnoDB and PDO dirver on board. 3) From beginning on I've personally choosen innoDB cause of better security and fallback possibility on db crashes (although innoDB is 3times bigger than myISAM). I think the choice from Prestashop to force innoDB is the better choice. 4) And at last: MariaDB does not support innoDB, which for my personal choice disqualify itself totally. Link to comment Share on other sites More sharing options...
MathiasReker Posted July 23, 2016 Author Share Posted July 23, 2016 Solved! I just had to install pdo_mysql Thank you selectshop.at! Link to comment Share on other sites More sharing options...
selectshop.at Posted July 23, 2016 Share Posted July 23, 2016 You're welcome. Link to comment Share on other sites More sharing options...
musicmaster Posted July 23, 2016 Share Posted July 23, 2016 4) And at last: MariaDB does not support innoDB, which for my personal choice disqualify itself totally. Really? I run it on my development computer. It says that its tables - even in fresh PS installations - are innoDb and when I export it and import it in Mysql on my production server it runs without problems. Link to comment Share on other sites More sharing options...
selectshop.at Posted July 23, 2016 Share Posted July 23, 2016 You read also my first topic ? I don't know if latest Maria DB is now using PDO drivers as well you can select on install or configure after, it was a long time ago that I played with it. Perhaps now supporting innoDB. But it WAS a nogo years ago for me. From what I can read now on documentation, seems that they improved. Xampp, Lampp and also Wampp are not for to use in production. These are reserved for developer envoirnment. That's what the own coder are recommending. You can use it, but it's not recommended. BTW I put this topic to as (solved) cause with the install of suggested PDO driver is now working. EDIT: Found this afterwards: Starting from MariaDB 5.5, all standard MariaDB distributions also includes InnoDB as a plugin. When I tried there was no innoDB available, not as plugin on board, not as plugin for to install afterwards. For me a nogo and therefore abandonned this project. Happy to see that they revised their opinion about to use XtraDB as standard (which is a innoDB fork, but not the same features). Link to comment Share on other sites More sharing options...
serek Posted August 7, 2016 Share Posted August 7, 2016 (edited) 4) And at last: MariaDB does not support innoDB, which for my personal choice disqualify itself totally. It's total bullshit, I have no idea why you spread that misinformation. By default, MariaDB uses the XtraDB storage engine, a performance enhanced fork of the InnoDB storage engine. For compatibility reasons, the system variables still retain their original innodb prefixes, and where the text in this knowledgebase refers to InnoDB, it can usually be understood as referring to the XtraDB fork. Note that it is possible to use InnoDB as a plugin in MariaDB instead of XtraDB XtraDB has more features than InnoDB, this is why it was written. It's a better, improved version of InnoDB which is very recommended. MariaDB is being used as a default MySQL database in many distributions, including Debian. https://mariadb.com/kb/en/mariadb/xtradb-and-innodb/ Edited August 7, 2016 by serek (see edit history) 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now