關於服務器linux系統安裝php72出現的問題
1. 卸載低版本的php,安裝php72並安裝配置文件
- yum remove php* # 刪除php
- yum install epel-release # 安裝epel
- yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm #安裝remi
- yum install yum-utils #安裝yum-utils
- yum-config-manager --enable remi-php72
- yum update
- yum install php72 # 安裝php72
- yum install php72-php-fpm php72-php-gd php72-php-json php72-php-mbstring php72-php-mysqlnd php72-php-xml php72-php-xmlrpc php72-php-opcache
- yum install php72w php72w-cli php72w-common php72w-devel php72w-embedded php72w-fpm php72w-gd php72w-mbstring php72w-mysqlnd php72w-opcache php72w-pdo php72w-xml php72w-ldap php72w-mcrypt #安裝擴展
2. 通過瀏覽器訪問服務器
service unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
- systemctl start php-fpm.service 開啓服務
- 修改 /etc/httpd/conf/httpd.conf文件,將 DocumentRoot=“自己的路徑”
- 由原來訪問phpinfo();該爲訪問html,結果html能夠訪問,則php服務沒有啓動
- service php-fpm start,結果顯示:Starting php-fpm:Unable to create the PID file (/run/php-fpm/php-fpm.pid)
- 在/run文件夾中缺少php-fpm文件夾以及php-fpm/php-fpm.pid 文件
- 在php-fpm.pid文件中添加9000並保存文件
- service php-fpm start,執行成功後,phpinfo() 就能夠正常訪問