Nginx + PHP

一、查看安裝的phpphp

 # rpm -qa | grep php  

 二、刪除phphtml

# yum remove php

三、使用yum remove不能完全刪除,要使用 rpm -e xxxx 把第一步列出的擴展 挨個刪除,注意依賴狀況mysql

# rpm -e php-fpm-5.3.3-22.el6.x86_64

 

全新安裝linux

一、配置yum源nginx

centos 6.5
# rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
centos 7.0
# yum install epel-release
# rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

二、使用yum 查看安裝包sql

# yum list --enablerepo=remi --enablerepo=remi-php56 | grep php

三、安裝,須要其餘擴展包在後邊加上便可centos

# yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof

 

php-fpm 加入系統服務隨系統啓動而啓動php-fpm

# chkconfig --level 345 php-fpm on 

第一次啓動php-fpmspa

# /etc/init.d/php-fpm restart 
Stopping php-fpm:                                          [FAILED]
Starting php-fpm:                                          [  OK  ]

配置nginxdebug

location ~ \.php$ {  
    root           html;  
    fastcgi_pass   127.0.0.1:9000;  #php-fpm的端口號
    fastcgi_index  index.php;  
    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;  
    include        fastcgi_params;  
}  

重啓nginx

# /etc/init.d/nginx -s reload  
相關文章
相關標籤/搜索