------------------------报错------------------------
Fatal error: Class ‘PDO‘ not found in /usr/share/nginx/html/Core/Library/Think/Db.class.php on line 39
:(
Class ‘PDO‘ not found
错误位置
FILE: /usr/share/nginx/html/Core/Library/Think/Db.class.php LINE: 39
-----------------------------------------------------
1、进行源码包ext/pdo目录
# cd php-5.6.14/ext/pdo
2、执行/usr/local/php/bin/phpize
3、配置、编译、安装扩展PDO
# ./configure --with-php-config=/usr/local/php/bin/php-config --enable-pdo=shared && make && make install
……………
Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
Installing header files: /usr/local/php/include/php/
Installing PDO headers: /usr/local/php/include/php/ext/pdo/
4、配置、编译、安装pdo_mysql
# cd ../pdo_mysql/
# /usr/local/php/bin/phpize
# ./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr/local/mysql2
……………
Build complete.
Don‘t forget to run ‘make test‘.
Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
5、在php配置文件中加入
vi /usr/local/php/lib/php.ini
…………
extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/pdo_mysql.so
extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/pdo.so
6、启动php-fpm服务
# /usr/local/php/sbin/php-fpm