標籤:conf get bcmath bst date iconv open file efault
通過編譯的方式安裝php7
1. 安裝PHP7
## 下載wget http://us2.php.net/distributions/php-7.0.2.tar.gz## 安裝tar zxvf php-7.0.2.tar.gzcd php-7.0.2/./configure --help ## 查看安裝的配置./configure --prefix=/usr/local/webserver/php --with-curl --with-freetype-dir --with-gd --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml-dir --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql --with-pdo-sqlite --with-pear --with-png-dir --with-xmlrpc --with-xsl --with-zlib --enable-fpm --enable-bcmath --enable-libxml --enable-inline-optimization --enable-gd-native-ttf --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-xml --enable-zip --with-config-file-path=/etcmake && make installcp php.ini-development /etc/php.inicd /usr/local/webserver/php/etc && cp php-fpm.conf.default php-fpm.conf/sbin/chkconfig php-fpm on # 設定開機啟動
2. 配置php.ini
extension_dir = "/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20151012/"date.timezone = prcenable_dl = Oncgi.force_redirect = 0cgi.fix_pathinfo=1fastcgi.impersonate = 1cgi.rfc2616_headers = 1allow_url_fopen = On
3. 測試安裝,檢測安裝是否正確4. 本次安裝的收穫
- --with-config-file-path 參數指定的php.ini的位置,預設php.ini在php/lib目錄下。如果要改變位置需要指定改參數
- php.ini在php啟動時讀取,這樣修改php.ini只要重啟php即可,不需要重啟nginx。設定檔
Centos7下安裝php7