php5.2.17 升級php-5.6.14

來源:互聯網
上載者:User
留個記錄,升級成功


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

重啟

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.