CentOS7安装php5.4

安装php5.4
[root@server src]#wget https://museum.php.net/php5/php-5.4.16.tar.gz
[root@server src]#tar -zxvf php-5.4.16.tar.gz
[root@server src]#yum install -y  libxml2-devel gcc gcc-c++ curl curl-devel libpng libpng-devel freetype freetype-devel libxslt libxslt-devel  zlib zlib-devel pcre pcre-devel  libjpeg libjpeg-devel   libxml2  glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel  e2fsprogs e2fsprogs-devel krb5 krb5-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers *               #安装依赖包                 
[root@server src]#cd php-5.4.16
[root@server php-5.4.16]#./configure --prefix=/usr/local/php/54 --with-config-file-path=/usr/local/php/54 --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
[root@server php-5.4.16]#make && make install
[root@server php-5.4.16]#cp php.ini-production  /usr/local/php/54/php.ini
[root@server php-5.4.16]#cp ./sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
[root@server php-5.4.16]#chmod +x /etc/init.d/php-fpm
[root@server php-5.4.16]#cd /usr/local/php/54/etc
[root@server etc]#cp php-fpm.conf.default php-fpm.conf
[root@server etc]#vi php-fpm.conf       ##去掉pid = run/php-fpm.pid前面的分号;
[root@server etc]#/usr/local/php/54/sbin/php-fpm      ##手动开启php服务
[root@server src]#echo "/usr/local/php/54/sbin/php-fpm" >> /etc/rc.local      #设置php开机自启
[root@server src]#chmod 777 /etc/rc.d/rc.local
 

  • 7
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值