Compile Mysql Extension for PHP

1. PHP
Source : /home/kim/php-5.3.3
Path : /usr/local/php


2. Compile Mysql Extension

$ cd /home/kim/php-5.3.3/ext/mysql/
$ /usr/local/php/bin/phpize
$ ./configure --with-php-config=/usr/local/php/bin/php-config
$ make
$ sudo make install


3. Config

$ cp /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/mysql.so /path/to/extension/
$ sudo vi /usr/local/php/lib/php.ini

extension=mysql.so


4. Restart Apache

$ sudo /usr/local/apache/bin/apachectl -k restart
Posted in PHP, Ubuntu | Tagged , , | Leave a comment