centos7通過yum安裝php方法
阿新 • • 發佈:2018-08-10
bst lena fpm php cati 數據庫 document maria 模塊
??????????? index? index.html index.htm index.php;
???????? }
location ~ \.php$ {
??????????? root?????????? html;
??????????? fastcgi_pass?? 127.0.0.1:9000;
??????????? fastcgi_index? index.php;
??????????? fastcgi_param? SCRIPT_FILENAME? $document_root$fastcgi_script_name;
??????????? include??????? fastcgi_params;
}
yum remve httpd* php*
安裝nginx
yum install nginx
安裝php和php-fpm
yum install php php-fpm
安裝數據庫
yum install mariadb mariadb-server
安裝擴展
yum install php-gd php-mysql php-mbstring php-xml php-mcrypt? php-imap php-odbc php-pear php –xmlrpc
vim /etc/nginx/nginx.conf
在http模塊中添加配置:
??????? location / {
???????? root?? /usr/share/nginx/html;
???????? }
location ~ \.php$ {
??????????? root?????????? html;
??????????? fastcgi_pass?? 127.0.0.1:9000;
??????????? fastcgi_index? index.php;
??????????? fastcgi_param? SCRIPT_FILENAME? $document_root$fastcgi_script_name;
??????????? include??????? fastcgi_params;
增加驗證文件
<?php?
phpinfo();?
?>
centos7通過yum安裝php方法