centos6.5 安裝php-5.6.31

來源:互聯網
上載者:User

標籤:安裝   pcntl   mkf   value   min   地址   pop   libmcrypt   log   

 

1 從PHP官網下載所需要的PHP版本

  :  http://php.net/get/php-5.6.31.tar.gz/from/a/mirror  把下載好的檔案上傳到伺服器

2 安裝PHP所需要的擴充

yum -y install libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel curl curl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libmcrypt libmcrypt-devel
gd gd-devel

 

 3 安裝PHP

    tar -zxvf php-5.6.31.tar.gz 

     cd php-5.6.31

./configure --prefix=/usr/local/php5.6 --disable-debug --enable-shared --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-libxml-dir --with-openssl --with-bz2 --with-mcrypt --enable-gd-native-ttf --with-curl --with-zlib-dir -with-gettext --with-jpeg-dir --with-png-dir --with-bz2 --with-freetype-dir --with-iconv --with-config-file-path=/usr/local/php5.6/etc --enable-mbstring --with-gd --disable-debug --enable-short-tags --disable-posix --enable
-exif --enable-ftp --enable-sockets

 

    make

    make install 

   cp php.ini-production /usr/local/php5.6/etc/php.ini

 

4 配置PHP

 編輯php.in檔案 修改內容如下

 

short_open_tag = On

disable_functions = "dl,exec,passthru,pcntl_exec,popen,posix_kill,posix_mkfifo,posix_setuid,proc_close,proc_open,
proc_terminate,shell_exec,system,leak,posix_setpgid,posix_setsid,proc_get_status,proc_nice,show_source"

cgi.fix_pathinfo=0

date.timezone = Asia/Shanghai

 

編輯php-fpm.conf

cp php-fpm.conf.default  php-fpm.conf

 

編輯 php-fpm.conf 設定如下

pid = /usr/local/php7/var/run/php-fpm.pid

error_log = log/php-fpm.log

log_level = notice

process_control_timeout = 30

events.mechanism = epoll

listen = 127.0.0.1:9007

listen.backlog = -1

pm.max_children = 1024

pm.start_servers = 80

pm.min_spare_servers = 20

pm.max_spare_servers = 80

pm.max_requests = 2000

pm.status_path = /status

ping.path = /ping

ping.response = pong

slowlog = var/log/phpslow_$pool.log

request_slowlog_timeout = 5s

request_terminate_timeout = 60s

rlimit_files = 65534

php_admin_value[open_basedir] = "/tmp/"
php_admin_value[disable_functions] = dl,exec,leak,passthru,pcntl_exec,popen,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,system

 

5 啟動測試PHP

 

#測試php-fpm配置
/usr/local/php5.6/sbin/php-fpm -t
/usr/local/php5.6/sbin/php-fpm -c /usr/local/php5.6/etc/php.ini -y /usr/local/php5.6/etc/php-fpm.conf -t

#啟動php-fpm
/usr/local/php5.6/sbin/php-fpm
/usr/local/php5.6/sbin/php-fpm -c /usr/local/php7/etc/php.ini -y /usr/local/php5.6/etc/php-fpm.conf

#關閉php-fpm
kill -INT `cat /usr/local/php5.6/var/run/php-fpm.pid`

#重啟php-fpm
kill -USR2 `cat /usr/local/php5.6/var/run/php-fpm.pid`

 

 

 

     

centos6.5 安裝php-5.6.31

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.