The idea of installing pdo on inux hosts is the same for both apache and nginx environments. <Br>, I don't know how to solve it. & Lt; br & gt; & lt; br inux host installation pdo, regardless of the apache environment or nginx environment, the idea is the same.
I found a few clear tutorials on the Internet, but I didn't explain them. many webmasters followed the instructions and encountered errors in the middle. I don't know how to solve them.
The wdlinux package is used as an example.
1. find a temporary directory, such as/home.
Cd/home
2. use wget to download the pdo package officially provided by php
Wget http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgz
3. extract
Tar zxvf PDO_MYSQL-1.0.2.tgz
4. go to the extracted directory.
Cd PDO_MYSQL-1.0.2
5. use phpize to add dynamic extensions for PHP
/Www/wdlinux/php/bin/phpize
Note: you must install phpize in the bin directory of the php installation directory based on the php installation location on your server. If this statement is executed and no phpize is displayed, install phpize (Baidu)
6. Compile
./Configure -- with-php-config =/www/wdlinux/php/bin/php-config -- with-pdo-mysql =/www/wdlinux/mysql
In this step, you must modify the php path.
7. make
- Make
8. make install
- Make install
9. There is also the last step. sometimes, the system will automatically help you during compilation, and sometimes you do not need to operate it yourself.
Edit the/www/wdlinux/etc/php. ini file,
Add at last
- [Pdo_mysql]
- Extension = "pdo_mysql.so"
- Extension =/www/wdlinux/apache_php-5.2.17/lib/php/extensions/no-debug-non-zts-20060613/pdo_mysql.so
10. restart apache or nginx
- Service httpd restart
- Service nginxd restart
Finally, test: phpinfo. php to see if pdo_mysql is available. if pdo is available
This tutorial is taken from the wdlinux Forum http://www.wdlinux.cn/bbs ~