1.系統Ubuntu
2.修改nginx配置文件后 nginx -s reload 重新加載
3.nginx -t 會檢查配置文件,root用戶。
3.安裝mysql :sudo apt-get install mysql
4.\q 退出mysql
5.ubuntu 安裝 sudo apt-get install php5-mysql
6.網站所在目錄 絕對路徑 到index.php上一層
7.給網站目錄設置讀寫權限 chmod -R 777 /www/
8.創建數據庫 create database tuotuo;分號必須。退出\q
9.網站配置文件 ituotuo.conf 路徑/etc/nginx/sites-enabled
幾個必填項
listen 80 (http 不用證書)
server_name 域名或者ip
root /home/tuotuo/www;(網站文件絕對路徑 root是根目錄 不是用戶名)
index index.html index.htm index.php;(需要加上index.php)
fastcgi配置 重點 沒有fastcgi配置 nginx不理解php
fastcgi下不需要加root
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
10.php環境配置/etc/php5/fpm/php.ini? ? 搜索 extension_dir = "XXXXXXX"? 注釋去掉 路徑是擴展路徑 /usr/lib/php5/20121212/? .so 后綴 擴展文件? extension=mysql.so
11./etc/php5/fpm/pool.d/www.conf 改成 ?listen=127.0.0.1:9000?