php5.6.14,php5.2.17 升级php-5.6.14

留个记录,升级成功

tar -zvxf php-5.6.14.tar.gz

cd /www/src/php-5.6.14

./configure --prefix=/www/lnmp/php --with-config-file-path=/www/lnmp/php/etc --with-mysql=/www/lnmp/mysql --with-mysqli=/www/lnmp/mysql/bin/mysql_config --with-iconv-dir=/www/lnmp --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --with-bz2 --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --enable-json --without-pear --disable-debug

make

make install

cp php.ini-production /www/lnmp/php/etc/php.ini

cp /www/lnmp/php/etc/php-fpm.conf.default /www/lnmp/php/etc/php-fpm.conf

vi /www/lnmp/php/etc/php-fpm.conf #编辑

user = www #设置php-fpm运行账号为www

group = www #设置php-fpm运行组为www

pid = run/php-fpm.pid #取消前面的分号

:wq! #保存退出

设置 php-fpm开机启动

cp /www/src/php-5.6.14/sapi/fpm/init.d.php-fpm /etc/rc.d/init.d/php-fpm #拷贝php-fpm到启动目录

chmod +x /etc/rc.d/init.d/php-fpm #添加执行权限

chkconfig php-fpm on #设置开机启动

vi /www/lnmp/php/etc/php.ini #编辑配置文件

找到:disable_functions =

修改为:disable_functions = passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,escapeshellcmd,dll,popen,disk_free_space,checkdnsrr,checkdnsrr,getservbyname,getservbyport,disk_total_space,posix_ctermid,posix_get_last_error,posix_getcwd, posix_getegid,posix_geteuid,posix_getgid, posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid, posix_getppid,posix_getpwnam,posix_getpwuid, posix_getrlimit, posix_getsid,posix_getuid,posix_isatty, posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid, posix_setpgid,posix_setsid,posix_setuid,posix_strerror,posix_times,posix_ttyname,posix_uname

#列出PHP可以禁用的函数,如果某些程序需要用到这个函数,可以删除,取消禁用。

找到:;date.timezone =

修改为:date.timezone = PRC #设置时区

找到:expose_php = On

修改为:expose_php = Off #禁止显示php版本的信息

找到:short_open_tag = Off

修改为:short_open_tag = ON #支持php短标签

找到opcache.enable=0

修改为opcache.enable=1 #php支持opcode缓存

找到:;opcache.enable_cli=1 #php支持opcode缓存

修改为:opcache.enable_cli=0

在最后一行添加:zend_extension=opcache.so #开启opcode缓存功能

:wq! #保存退出

配置开机启动

vi /etc/rc.local

在末尾去掉以下内容:

/www/lnmp/php/sbin/php-fpm start

修改计划任务

crontab -e

reboot

重启

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值