These days to try to move the machine to Ubuntu to do development, the system installed after the first task is to install the Php+mysql development environment. I intend to install php5 directly, Pdo_mysql, the following is the record of the installation process
First I installed the apache2,php5,pear and MYSQL5 directly with Apt-get, in order to facilitate the subsequent installation, plus make and libmysqlclient
sudo apt-get install Apache2-mpm-prefork
sudo apt-get install php5
sudo apt-get install Php5-dev
sudo apt-get install Php5-pear
sudo apt-get install mysql-server-5.0
sudo apt-get install make
sudo apt-get install Libmysqlclient15-dev
PDO does not seem to be able to find the installation source in Ubuntu's apt, so installing the extension via PECL is very simple-if the undersea fiber is connected:
PECL Install PDO
Add one line:
Extension=pdo.so
To file:
/etc/php/apache2/php.ini
/etc/php/cli/php.ini
Next install Pdo_mysql encounter some problems, run directly pecl install Pecl_mysql will appear some errors, search for the discovery is the problem of the PECL itself, the following is a relatively simple solution:
wget http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgz
Tar xzvf pdo_mysql-1.0.2.tgz
CD pdo_mysql-1.0.2
Comment out configure to determine if the code fragment for the PDO extension has been installed, continue running:
Phpize
./configure
Make
Make install
Then add the following line again to the two php.ini mentioned earlier
Extension=pdo_mysql.so
After restarting Apache, PHP5 + pdo_mysql is installed on Ubuntu, DocumentRoot is/var/www
Postscript
A simpler solution is to run:
php_pdo_shared=1 pecl Install Pdo_mysql