CentOSInstall php
1. Check the currently installed php package
[root@wow~]# yum list installed | grep php
- 1
2. If again, delete
[root@wow~]# yum remove ...
- 1
Different versionsyum sourceChange
Check the system version command: cat /etc/redhat-release
CentOS
rpm -Uvh /yum/el5/
CentOS
rpm -Uvh /yum/el6/
CentOS
rpm -Uvh /yum/el7/
rpm -Uvh /yum/el7/
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
4. Run and install
56w is the version number, which can be changed according to your needs
[root@wow~]# yum install php56w.x86_64 php56w-cli.x86_64 php56w-common.x86_64 php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64 php56w-mcrypt.x86_64 php56w-mysql.x86_64 php56w-pdo.x86_64
- 1
5. Install php fpm
[root@wow~]# yum install php56w-fpm
- 1
6. Test
Create and edit content under the test project (/happy/ppppp):
[root@wow~]# vim /happy/ppppp/
<?php phpinfo();?>
- 1
- 2
existnginxAdd the configuration to parse php under server in the configuration file
location ~ \.php$ {
root /happy/ppppp;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index ;
#fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
7. Test successful
No screenshots