centos7安装php72

1.安装软件源
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

2.安装php72
yum install php72w-fpm
yum install php72w-bcmath php72w-gd php72w-json php72w-mbstring php72w-mcrypt php72w-mysqlnd php72w-pdo php72w-soap php72w-xml php72w-exif php72w-curl

3.修改php配置文件
/etc/php-fpm.conf
/etc/php.ini

4.启动php-fpm
systemctl enable php-fpm
systemctl start php-fpm

5.修改apache支持php
ProxyPassMatch  ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/usr/www/xuexi/web/$1

6.修改nginx支持php
server {
    listen       80;
    server_name  xuexi.iefeel.com;

    access_log  /var/log/nginx/xuexi_access.log;
    error_log   /var/log/nginx/xuexi_error.log;

    location / {
        root   /usr/www/xuexi/web;
        index  index.html index.php;
    }

    error_page  404              /404.html;
    location = /404.html {
        root   /usr/share/nginx/html;
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    location ~ \.php$ {
        root   /usr/www/xuexi/web;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #    deny  all;
    #}
}
 

你可能感兴趣的:(PHP,php,apache,nginx)