標籤:
php 安裝參數./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm --with-mysql=/usr/local/mysql --with-mysql-sock=/tmp/mysql.sock --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring --enable-exif --enable-zend-multibyte --disable-ipv6 --with-pear --with-curl --enable-bcmath --enable-sockets --with-gettext
-----------------------------------------------------------------------------
php databases support off fail 經查詢是缺少mysqli
安裝mysqli
需要在php源碼中編譯出模組然後載入
先介紹點知識:
phpize是什嗎?php官方說明:http://php.net/manual/en/install.pecl.phpize.phpphpize是用來擴充php擴充模組的,通過phpize可以建立php的外掛模組。
比如你想在原來編譯好的php中加入json或者mysqli等擴充模組,可以使用phpize實現。
當php編譯完成後,php的bin目錄下會有phpize程式。進入php源碼ext下的相關擴充目錄,在編譯要添加的模組之前,執行phpize就可以產生configure檔案。
如果你是rpm包安裝php的話,就安裝php-devel這個包,就會有phpize命令了。
[[email protected] mysqli]# /usr/local/php/bin/phpize
Configuring for:
PHP Api Version: 20100412
Zend Module Api No: 20100525
Zend Extension Api No: 220100525
You have new mail in /var/spool/mail/root
[[email protected] mysqli]# ./configure --prefix=/usr/local/mysqli \
> --with-php-config=/usr/local/php/bin/php-config \
> --with-mysqli=/usr/local/mysql/bin/mysql_config
[[email protected] mysqli]# make
[[email protected] mysqli]# make install
Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/
Installing header files: /usr/local/php/include/php/
vim /usr/local/php/etc/php.ini 在最低行添加 extension=mysqli.so 儲存重啟php即可.
-------------------------------------------------------------------------------------------------------------------
安裝完後發現其實目錄/usr/lib/php/modules下有mysqli.so 下次可以嘗試直接更改php.ini 不重新安裝是否可行.
[[email protected] lib]# cd /usr/lib/php/modules
[[email protected] modules]# ls
bcmath.so curl.so fileinfo.so json.so mysqli.so mysql.so pdo_mysql.so pdo.so pdo_sqlite.so phar.so sqlite3.so zip.so
參考 http://www.cnblogs.com/rusking/p/4471503.html
php databases support off fail zabbix