1.系統(tǒng)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.網(wǎng)站所在目錄 絕對路徑 到index.php上一層
7.給網(wǎng)站目錄設(shè)置讀寫權(quán)限 chmod -R 777 /www/
8.創(chuàng)建數(shù)據(jù)庫 create database tuotuo;分號必須绊茧。退出\q
9.網(wǎng)站配置文件 ituotuo.conf 路徑/etc/nginx/sites-enabled
幾個必填項(xiàng)
listen 80 (http 不用證書)
server_name 域名或者ip
root /home/tuotuo/www铝宵;(網(wǎng)站文件絕對路徑 root是根目錄 不是用戶名)
index index.html index.htm index.php;(需要加上index.php)
fastcgi配置 重點(diǎn) 沒有fastcgi配置 nginx不理解php
fastcgi下不需要加root
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
10.php環(huán)境配置/etc/php5/fpm/php.ini? ? 搜索 extension_dir = "XXXXXXX"? 注釋去掉 路徑是擴(kuò)展路徑 /usr/lib/php5/20121212/? .so 后綴 擴(kuò)展文件? extension=mysql.so
11./etc/php5/fpm/pool.d/www.conf 改成 ?listen=127.0.0.1:9000?