第三章 安裝php

安裝PHP:

[root@CentosMain app]# yum -y install zlib-devel libxml2 libxml2-devel libjpeg-devel libiconv-devel freetype-devel libpng-devel gd gd-devel openssl openssl-devel curl-devel libxslt-devel libmcrypt libmcrypt-devel mhash mcrypt bzip2-devel bzip2 ncurses-devel  php-mcrypt  libmcrypt  libmcrypt-devel
[root@CentosMain ~]# tar -xvf php-5.6.32.tar.gz -C /app
[root@CentosMain ~]# cd /app/php-5.6.32
[root@CentosMain php-5.6.32]#  ./configure --prefix=/app/php --enable-fpm --enable-mysqlnd --enable-zip --enable-mbstring --enable-exif --with-fpm-user=nginx --with-fpm-group=nginx --with-openssl --with-mysql --with-mysqli --with-curl --with-zlib --with-gd --with-mcrypt --with-jpeg-dir --with-freetype-dir --enable-bcmath --enable-sockets --with-gettext
[root@CentosMain php-5.6.32]#  make
[root@CentosMain php-5.6.32]#  make test
[root@CentosMain php-5.6.32]#  make install

配置文件修改:

[root@CentosMain etc]# cd /app/php/etc
[root@CentosMain etc]# cp php-fpm.conf.default php-fpm.conf
[root@CentosMain etc]# cd /app/php-5.6.32/
[root@CentosMain php-5.6.32]# cp php.ini-production /app/php/lib/php.ini
[root@CentosMain php-5.6.32]# cd /app/php-5.6.32/sapi/fpm
[root@CentosMain fpm]# cp init.d.php-fpm /etc/init.d/php-fpm
[root@CentosMain fpm]# chmod +x /etc/init.d/php-fpm

修改/app/php/lib目錄下php.ini文件:

date.timezone = Asia/Shanghai
post_max_size = 32M
max_execution_time = 300
max_input_time = 300
always_populate_raw_post_data = -1

修改nginx的配置文件nginx.conf,以支持php網(wǎng)上參考鏈接

php開(kāi)機(jī)啟動(dòng)設(shè)置:鏈接

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容