nginx:
與nginx關(guān)聯(lián)配置相對要麻煩一些:
1.user=可用用戶;
2. 全局配置: location / {
root? xxx/nginx/html;#1
index? index.html index.htm index.php;#2
}
3.php文件處理的配置: location ~ ^.+\.php {
root? ? ? ? xxx/nginx/html;
fastcgi_pass? 127.0.0.1:9000;
fastcgi_index? index.php;
####pathinfo
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
#fastcgi_param SCRIPT_FILENAME /path/to/php$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param? SCRIPT_FILENAME? /usr/local/nginx/html$fastcgi_script_name;
include? ? ? ? fastcgi_params;
}
重啟結(jié)束
apache:
當(dāng)用源碼安裝php編譯時需要安裝apxs模塊梆靖,這樣php安裝好了會在httpd.conf里面生成
LoadModule php5_module? ? ? ? /x/modules/libphp5.so
接下來:
找到:
AddType? application/x-compress .Z
AddType application/x-gzip .gz .tgz
在后面添加:
AddType application/x-httpd-php .php(使Apcche支持PHP)
AddType application/x-httpd-php-source .php5
添加:DirectoryIndex index.html index.php
修改ServerName為: 127.0.0.1:80或者localhost:80