OAFC_Rob Posted September 9, 2012 Share Posted September 9, 2012 Hi, I'm having some issues with my Mysql driver, Zendframeworks is telling me that the driver isn't installed and also on another project tail is stating that it cannot use mysql_connect, which I'm presumming is the same issue. I am running PHP 5.3 and I know that they have altered the way MySQL works in this version but I thought I had it setup correctly in my PHP.ini I have read that you're suppose to have the following line uncommented in the php.ini extension=php_pdo_mysql.dll extension=php_pdo_mysql.so Is this still the case in php 5.3? As when I search for these lines vi and nano both cannot find them, so should I add them? Also another thing I read was the following; However, running php (5.3) as an apache (2.2) module on my machine (windows 7), it still wouldn't work. I figured out the extension_dir value in php.ini needs to be set using an absolute path (relative just wouldn't work)! However, when I uncommented and changed extension_dir from ./ to / and restarted, it caused the zend to fall over and die. Any ideas of what I am missing in my PHP.ini pretty sure thats where the issue lies. Quote Link to comment Share on other sites More sharing options...
ignace Posted September 9, 2012 Share Posted September 9, 2012 You enabled the MySQL PDO extension. Which is something entirely different. You need to uncomment this line: ;extension=php_mysql.dll That said mysql_* is deprecated and you should use mysqli instead which is almost the same as mysql except your functions start with mysqli_* and the $dblink is required and the first parameter to a function. Quote Link to comment Share on other sites More sharing options...
OAFC_Rob Posted September 9, 2012 Author Share Posted September 9, 2012 This isn't in the php.ini file though extension=php_mysql.dll would I need to add it and where? Also Can you use msqli with a mysql database?? Quote Link to comment Share on other sites More sharing options...
ignace Posted September 9, 2012 Share Posted September 9, 2012 Yes you can use mysqli with a mysql database. The i stands for improved. It allows for preparing queries, and variable binding and the like. Check first if php_mysql.dll exists in your ext/ directory. If not and you have PHP 5.3+, download it from: http://dev.mysql.com/downloads/connector/php-mysqlnd/ Then add it to your php.ini. Quote Link to comment Share on other sites More sharing options...
OAFC_Rob Posted September 9, 2012 Author Share Posted September 9, 2012 Is there a shortcut one in yum? Quote Link to comment Share on other sites More sharing options...
ignace Posted September 9, 2012 Share Posted September 9, 2012 No idea. I don't use yum on Windows. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted September 9, 2012 Share Posted September 9, 2012 This isn't in the php.ini file though extension=php_mysql.dll would I need to add it and where? That's an indication that you installed php using the .msi installer or via one of the all in one packages and you must enable extensions either through the windows control panel add/remove or the all in one control panel. How did you obtain and install php? The .msi installer, the .zip package and manually install it, or one of the wamp all in one packages? Quote Link to comment Share on other sites More sharing options...
Christian F. Posted September 9, 2012 Share Posted September 9, 2012 That said mysql_* is deprecated and you should use mysqli instead which is almost the same as mysql except your functions start with mysqli_* and the $dblink is required and the first parameter to a function. While it's not quite deprecated yet (thought so too, until told otherwise), it is still recommended to use MySQLi or PDO instead. So my suggestion to you, OAFC_Rob, is to drop the mysql library and use MySQLi instead. Or PDO, if you prefer, since you already have it installed. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.