Home > Cpanel Server > How to compile pdo_mysql module with php ?

How to compile pdo_mysql module with php ?

March 18th, 2009 Leave a comment Go to comments

Hello,

PDO_MYSQL is a driver that implements the PHP Data Objects (PDO) interface to enable access from PHP to MySQL 3.x and 4.x databases.

PDO_MYSQL will take advantage of native prepared statement support present in MySQL 4.1 and higher. If you’re using an older version of the mysql client libraries, PDO will emulate them for you.

Steps to compile compile pdo_mysql module with php

1) Download the PDO package to server

          # wget http://pecl.php.net/get/PDO

2) Manually build and install the PDO extension:

	  # tar xzf PDO-0.2.tgz
	  # cd PDO-0.2
	  # phpize
	  # ./configure
          # make
          # make install
          # echo extension=pdo.so >> /usr/local/php5/lib/php.ini

3) rebuild PHP along with the drivers for PDO_mysql.

CUSTOM_PHP_FLAGS=”–with-pdo-mysql” /scripts/easyapache

4) check php module using php -m command

Enjoys

  1. Simon Wilkes
    September 27th, 2007 at 00:20 | #1

    Brilliant. Thanks for posting this Alex, it really helped.

    I only needed the CUSTOM_PHP_FLAGS line to add the PDO_MySQL module as cPanel with PHP 5.2+ seems to include the PDO package by default but only with the sqlite module.

    Cheers.

  2. Cany
    September 22nd, 2009 at 15:02 | #2

    How do install PDO_MYSQL in windows.
    I have the PDO extensions enabled in my php.ini and php on windows path but still its not working. On my phpinfo() the PDO has no value

  3. Reynold P J
    August 10th, 2010 at 16:27 | #3

    Thanks Alex,
    Great help :)

  1. No trackbacks yet.