Monday, November 29, 2010

pdo mysql installatin

Below are the instructions to install pdo extension for mysql

First, install PEAR
sudo apt-get install php-pear

If you get anything about warning, ‘phpize’, this means you need php-dev. To install this simpy put this in the terminal (sudo apt-get install php-dev)
sudo pecl install pdo

Next, install pdo_mysql drivers.
sudo pecl install pdo_mysql
If you encounter the error below,
checking for MySQL support for PDO... yes, shared
checking for mysql_config... not found
configure: error: Cannot find MySQL header files under
ERROR: `/tmp/tmpRiQ5ax/PDO_MYSQL-1.0.2/configure' failed
Then put this in the terminal:
sudo apt-get install libmysqlclient15-dev
and then sudo pecl install pdo_mysql

You can update the db below as follows:
sudo updatedb
Open the php.ini file:
gksudo gedit /etc/php5/apache2/php.ini
Inside it put these lines at the bottom:
extension=pdo.so
extension=pdo_mysql.so

No comments: