標籤:
今天在做一個商城的串連的時候,需要MpDO驗證。需要安裝pdo_mysql模組,剛開始按照php擴充模組的安裝按照這個安裝ZIP,curl都成功了但是安裝pdo_mysql卻不行,在./configure --with-php-config=/usr/local/php/bin/php-config是出現錯誤。如下
checking for re2c... no configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers. checking for gawk... gawk checking for MySQL support for PDO... yes, shared checking for the location of libz... no checking for mysql_config... not found configure: error: Unable to find your mysql installation 找不到mysql
最後終於找到瞭解決辦法:
這樣來編譯:./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr/local/mysql 就可以了,之後按照這php擴充模組安裝個來做即可
php編譯安裝轉自:http://www.apelearn.com/bbs/forum.php?mod=viewthread&tid=11526&highlight=php%C0%A9%D5%B9%C4%A3%BF%E9
擴充模組編譯安裝
/usr/local/php/bin/php -m
進入php源碼包目錄 /usr/local/src/php-5.4.36
cd ext/
以curl為例
/usr/local/php/bin/php -m |grep -i curl
cd /curl/
ls
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make
make install
ls /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/curl.so
/usr/local/php/bin/php -i |grep extension_dir
vim /usr/local/php/etc/php.ini
extension=php_shmop.dll(該行下面添加如下資訊)
extension=curl.so
儲存退出
:nohl取消高亮(vim介面)
grep ‘extension=‘ /usr/local/php/etc/php.ini (查看安裝動態模組)
關於php外掛程式pdo_mysql的安裝