首页 / PHP / php5.5.38编译安装
php5.5.38编译安装
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了php5.5.38编译安装,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含3734字,纯文字阅读大概需要6分钟。
内容图文
![php5.5.38编译安装](/upload/InfoBanner/zyjiaocheng/1070/93794604e4534b659dae0defda14f7fa.jpg)
解决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
本文出自 “10931853” 博客,请务必保留此出处http://wujianwei.blog.51cto.com/10931853/1934078
原文:http://wujianwei.blog.51cto.com/10931853/1934078
内容总结
以上是互联网集市为您收集整理的php5.5.38编译安装全部内容,希望文章能够帮你解决php5.5.38编译安装所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。