php5.5.38編譯安裝
解決php版本與程式不相容導致php打包引數失敗
1.編譯安裝php-5.5.38
1.1下載php原始碼包解決相關依賴
基於lnmp1.3一鍵安裝包的php版本PHP5.5.36的編譯引數來編譯安裝php-5.5.38
通過phpinfo.php可以檢視php的編譯安裝的引數
yum install php-mysql php-mbstring php-mcrypt php-pdo -y
wgethttp://cn2.php.net/distributions/php-5.5.38.tar.gz
tar xf php-5.5.38.tar.gz
1.2編譯安裝
cdphp-5.5.38
./configure `–prefix=/usr/local/php5.5` `–with-config-file-path=/usr/local/php5.5/etc“–enable-fpm` `–with-fpm-user=www` `–with-fpm-group=www“–with-mysql=mysqlnd` `–with-mysqli=mysqlnd` `–with-pdo-mysql=mysqlnd“–with-iconv-dir` `–with-freetype-dir=/usr/local/freetype` `–with-jpeg-dir“–with-png-dir` `–with-zlib` `–with-libxml-dir=/usr` `–enable-xml“–disable-rpath` `–enable-bcmath` `–enable-shmop` `–enable-sysvsem“–enable-inline-optimization` `–with-curl` `–enable-mbregex“–enable-mbstring` `–with-mcrypt` `–enable-ftp` `–with-gd“–enable-gd-native-ttf` `–with-openssl` `–with-mhash` `–enable-pcntl“–enable-sockets` `–with-xmlrpc` `–enable-zip` `–enable-soap“–with-gettext` `–disable-fileinfo` `–enable-opcache` `–enable-intl“–with-xsl` –without-pear –disable-phar
vim Makefile
107 EXTRA_LIBS 此行的末尾新增引數-liconv
107 EXTRA_LIBS = -lcrypt -lz -lexslt -lcrypt -lrt-lmcrypt -lltdl -lstdc++ -lpng -lz -ljpeg -lcurl -lz -lrt -lm -ldl -lnsl -lrt-lxml2 -lz -lm -lssl -lcrypto -lcurl -lxml2 -lz -lm -lssl -lcr
ypto-lfreetype -lz -lbz2 -licui18n -licuuc -licudata -lm -licuio -lxml2 -lz -lm-lxml2 -lz -lm -lcrypt -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz-lm -lxslt -lxml2 -lz -lm
-lssl-lcrypto -lcrypt -liconv
make
make install
/usr/local/php5.5/bin/php –v
1.3安裝go-pear.phar
wget http://pear.php.net/go-pear.phar
/usr/local/php5.5/bin/php go-pear.phar
1.4準備php-fpm啟動檔案和php-fpm.conf配置檔案
cd php-5.5.38
cp php.ini-production /usr/local/php5.5/etc/php.ini
cpsapi/fpm/init.d.php-fpm /etc/init.d/php5.5-fpm
vim /usr/local/php5.5/etc/php.ini
chmod +x/etc/init.d/php5.5-fpm
cd /usr/local/php5.5/etc/
cp /usr/local/php5.5/etc/php-fpm.conf.defaultphp-fpm.conf
vim /usr/local/php5.5/etc/php-fpm.conf
[root@localhost php-5.5.38]# grep date.timezone/usr/local/php5.5/etc/php.ini
; http://php.net/date.timezone
date.timezone = PRC
1.5結合參考一鍵安裝包的php-fpm.conf優化配置檔案
[root@localhost php-5.5.38]# cat/usr/local/php5.5/etc/php-fpm.conf
[global]
pid = /usr/local/php5.5/var/run/php-fpm.pid
error_log = /usr/local/php5.5/var/log/php-fpm.log
log_level =warning
[www]
listen = 127.0.0.1:9002
listen.backlog = -1
listen.allowed_clients = 127.0.0.1
listen.owner = www
listen.group = www
listen.mode = 0666
user = www
group = www
pm = dynamic
pm.max_children = 100
pm.start_servers = 50
pm.min_spare_servers = 30
pm.max_spare_servers = 80
request_terminate_timeout = 0
request_slowlog_timeout = 0
slowlog = var/log/slow.log
1.6修改nginx配置檔案指定php的fastcgi_pass埠9002選定執行的php版本
[root@localhost php-5.5.38]# cat/usr/local/nginx/conf/vhost/testadmin.conf
server
{
listen 80;
server_name testadmin.com;
indexindex.html index.php;
root /data/www/testadmin;
#limit_conn crawler 20;
#error_page 404
location ~ .*.(php|php5)?$
{
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass 127.0.0.1:9002;
fastcgi_index index.php;
includefastcgi.conf;
}
location ~.*.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~.*.(js|css)?$
{
expires 1h;
}
location/5998153NginxStatus
{
stub_status on;
access_log off;
}
#access_log /dev/null;
error_log /data/wwwlogs/error.log;
}
nginx -t
nginx: the configuration file/usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file/usr/local/nginx/conf/nginx.conf test is successful
[root@localhost php-5.5.38]# /etc/init.d/nginxreload
本文轉自 wjw555 51CTO部落格,原文連結:http://blog.51cto.com/wujianwei/1934078
相關文章
- 編譯安裝zabbix編譯
- apache編譯安裝Apache編譯
- 編譯安裝nmon編譯
- swoole 編譯安裝編譯
- 編譯安裝Nginx編譯Nginx
- 編譯安裝mysql編譯MySql
- nginx編譯安裝Nginx編譯
- Griffin編譯安裝編譯
- 安裝編譯ffmpeg編譯
- Shell編譯安裝nginx編譯Nginx
- centos PHP 編譯安裝CentOSPHP編譯
- httpd編譯安裝phphttpd編譯PHP
- PHP的編譯安裝PHP編譯
- Mysql 5.7.17 編譯安裝MySql編譯
- ffmpeg安裝之linux編譯安裝Linux編譯
- CentOS 下編譯安裝 NginxCentOS編譯Nginx
- CentOS 下編譯安裝 apacheCentOS編譯Apache
- Mac 編譯安裝 PHPRedis 模組Mac編譯PHPRedis
- PHP7 編譯安裝PHP編譯
- Linux編譯安裝NginxLinux編譯Nginx
- CentOS 6.4 編譯安裝 apacheCentOS編譯Apache
- ubuntu編譯安裝kernel教程。Ubuntu編譯
- windows下編譯安裝thriftWindows編譯
- 編譯安裝php7編譯PHP
- php7編譯安裝PHP編譯
- 原始碼編譯安裝Redis原始碼編譯Redis
- 編譯安裝LAMP環境編譯LAMP
- LNMP—Nginx的編譯安裝LNMPNginx編譯
- LAMP原始碼編譯安裝LAMP原始碼編譯
- PHP編譯安裝引數PHP編譯
- LNMP編譯安裝配置+discuzLNMP編譯
- ubuntu thrift 0.9.3編譯安裝Ubuntu編譯
- 編譯安裝php5.6.2編譯PHP
- ubuntu下 編譯安裝swftoolsUbuntu編譯
- Centos 下編譯安裝RedisCentOS編譯Redis
- MySQL5.5.24編譯安裝MySql編譯
- 編譯安裝CoreSeek-4.1編譯
- MySQL 5.6.19編譯安裝MySql編譯