Portal Home > Knowledgebase > Articles Database > PDO MySQL extension


PDO MySQL extension




Posted by dthbah2006, 01-18-2013, 08:07 AM
Hello, I am having a crazy issue regarding PDO MySQL extension that is needed on my VPS. Centos 6.3 with PHP Version 5.3.13 Ran EasyApache Update via SSH and everything is updated. I see that it is checked in the profile and should be installed. I ran this code to see if the PDO is working: I get this response: if (!defined('PDO::ATTR_DRIVER_NAME')) { echo 'PDO unavailable'; } When I check the PHPINFO all I see regarding PDO is in the CONFIGURE COMMAND '--disable-pdo' Any ideas on what could be the issue?

Posted by BestServerSupport, 01-18-2013, 09:49 AM
First be sure the following are enabled in your php.ini file: extension=pdo.so extension=pdo_sqlite.so extension=sqlite.so extension=pdo_mysql.so

Posted by LampNetworks, 01-18-2013, 09:55 AM
Run the following to check if installed: [~]# php -m |grep -i pdo

Posted by dthbah2006, 01-18-2013, 10:16 AM
Thanks for the reply and assistance. I added the above code to the /user/local/lib/php.ini file and restarted Apache. I did not resolve the issue. I even tried it with and without ; in front of each line as in the php.ini Still not working. Nothing happens when this is checked at the ssh root level. I know a little about server management and this one has me completely lost. I have tried everything I could resource from Google and other forums and nothing works.

Posted by zoid, 01-18-2013, 10:22 AM
If you get this output then PHP is not even running/executed. Check first whether you can run code at all.

Posted by dthbah2006, 01-18-2013, 10:26 AM
PHP Code? There are scripts that use php on the server that are working fine. Is that what you mean?

Posted by zoid, 01-18-2013, 10:30 AM
Then why does PHP code show up in the page?

Posted by dthbah2006, 01-18-2013, 10:35 AM
I have no idea.

Posted by zoid, 01-18-2013, 10:44 AM
Can you post more of your code and a link to your site?

Posted by dthbah2006, 01-18-2013, 10:50 AM
What code would you like to see? This is the error that I get when testing to see if PDO is installed:

Posted by zoid, 01-18-2013, 10:53 AM
As I said, if you see the code there is no surprise it does not execute it ..... but apparently it simply cannot find the library

Posted by m4rc3, 01-18-2013, 11:35 AM
I would re-run easy apache and rename that php.ini file so cpanel can rebuilt it from scratch in a proper way.

Posted by dthbah2006, 01-18-2013, 12:03 PM
Is their any repercussions from doing this if I keep a copy of the php.ini off the server? Can I replace/edit the php.ini file via ConfigServer Explorer if something goes awry?

Posted by LampNetworks, 01-18-2013, 02:23 PM
Yes, locate file and use rename option or at cmd: mv /pathto/php.ini /pathto/php.ini.bkup Then re-run easyapache. If successful you should see: [~]# php -m |grep -i pdo PDO pdo_mysql pdo_sqlite Last edited by LampNetworks; 01-18-2013 at 02:27 PM. Reason: added PDO check



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Need some help here. (Views: 643)
Max Clients (Views: 639)

Language: