美文网首页
第三章 安装php

第三章 安装php

作者: Alex_Honnold | 来源:发表于2017-12-11 17:35 被阅读0次

    安装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网上参考链接

    php开机启动设置:链接

    相关文章

      网友评论

          本文标题:第三章 安装php

          本文链接:https://www.haomeiwen.com/subject/doabixtx.html