These days try to move the machine to Ubuntu to do development, the first task after the installation of the system 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 the Ubuntu apt, so installing this extension via pecl is very simple-if the submarine fiber can connect:
PECL Install PDO
Add a line:
Extension=pdo.so
To file:
/etc/php/apache2/php.ini
/etc/php/cli/php.ini
Next install Pdo_mysql encounter some problems, directly run Pecl install Pecl_mysql will appear some errors, search the discovery is pecl itself problem, below 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 the code snippet in configure to determine if the PDO extension has been installed and 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
http://www.bkjia.com/PHPjc/446976.html www.bkjia.com true http://www.bkjia.com/PHPjc/446976.html techarticle these days try to move the machine to Ubuntu to do development, the first task after the installation of the system is to install the Php+mysql development environment. I intend to install the PHP5 directly, Pdo_mysql, the following is installed ...