Monday, September 7, 2015

Enabling PDO for MySQL database access on GoDaddy shared hosting

If you find yourself with an error such as "Fatal Error: Class PDO not found", and you are using GoDaddy shared host (or any similar shared hosting), here is what you have to do.

First of all, in case of GoDaddy shared hosting, make sure you are using Linux host, as PDO is supported only for Linux shared hosting.

Assuming you are using Linux, you need to modify php.ini file in your root folder.

Add these 4 lines to it:
extension=pdo.so
extension=pdo_sqlite.so
extension=sqlite.so
extension=pdo_mysql.so

This will enable PDO database acccess for MySQL and SQLite databases.

After that , to make this change immediately effective, go to your cpanel -> PHP Processes and hit Kill All (PHP) processes. After this , you should have your PDO class for database access back online!


No comments:

Post a Comment

Ubuntu 12.04, 14.04, 16.04 - auto start an app or script before login

To run a command or application at startup, even before the user has logged in, you can use this file: /etc/rc.local The commands entered...