0. nginx 安裝
zlib
tar -zxvf zlib-1.2.7.tar.gz
cd zlib-1.2.7
./configure
make
make install
pcre
tar -zxvf pcre-8.32.tar.gz
cd pcre-8.32
./configure
make
make install
download from:
unzip headers-more-nginx-module-0.26.zip
cd headers-more-nginx-module-0.26
[irobot@test headers-more-nginx-module-0.26]$ pwd
/u01/soft/headers-more-nginx-module-0.26
安裝nginx:
wget
tar -xzvf nginx-1.7.10.tar.gz
cd nginx-1.7.10/
./configure --prefix=/u01/soft/nginx --add-module=/u01/soft/headers-more-nginx-module-0.26
make
make install
1. 安裝php 5.6:
[irobot@test php-5.6.10]$ whereis curl
curl: /usr/bin/curl /usr/include/curl /usr/share/man/man1/curl.1.gz
[irobot@test php-5.6.10]$ which curl
/usr/bin/curl
[irobot@test php-5.6.10]$ pwd
/home/irobot/zhoutao/php-5.6.10
[irobot@test php-5.6.10]$
wget
tar xzvf php-5.6.10.tar.gz
cd php-5.6.10
./configure --enable-fastcgi --enable-debug --with-curl=/usr/bin/curl
make
make install
------------------------
[root@test php-5.6.10]# make install
installing shared extensions: /usr/local/lib/php/extensions/debug-non-zts-20131226/
installing php cli binary: /usr/local/bin/
installing php cli man page: /usr/local/php/man/man1/
installing php cgi binary: /usr/local/bin/
installing php cgi man page: /usr/local/php/man/man1/
installing build environment: /usr/local/lib/php/build/
installing header files: /usr/local/include/php/
installing helper programs: /usr/local/bin/
program: phpize
program: php-config
installing man pages: /usr/local/php/man/man1/
page: phpize.1
page: php-config.1
installing pear environment: /usr/local/lib/php/
[pear] archive_tar - already installed: 1.3.12
[pear] console_getopt - already installed: 1.3.1
[pear] structures_graph- already installed: 1.0.4
[pear] xml_util - already installed: 1.2.3
[pear] pear - already installed: 1.9.5
wrote pear system config file at: /usr/local/etc/pear.conf
you may want to add: /usr/local/lib/php to your php.ini include_path
/home/irobot/php-5.6.10/build/shtool install -c ext/phar/phar.phar /usr/local/bin
ln -s -f phar.phar /usr/local/bin/phar
installing pdo headers: /usr/local/include/php/ext/pdo/
------------------------
[root@test php-5.6.10]# cp php.ini-production /usr/local/lib/php.ini
>>> 將 /usr/local/lib/php.ini 設定為: output_buffering = on
>>> 以上配置開啟後,會影響效能。最好看看php程式是否能夠不使用這樣的配置!!!
>>>將 /usr/local/lib/php.ini 設定為: default_mimetype = ""
>>>php預設是: default_mimetype = "text/html"
>>>規避nginx+php組合下,對於css檔案的content-type總是返回text/html。 正常應該返回是text/css。
啟動 php-cgi:
nohup php-cgi -b 13344 -c /usr/local/lib/php.ini >> /home/irobot/php.log 2>&1 &
2. 存放html5
/u01/soft/htm5root
3. 設定nignx
Nginx PHP 執行原理
nginx engine x 是乙個高效能的http和反向 伺服器,也是乙個imap pop3 smtp伺服器。nginx不只有處理http請求的功能,還能做反向 nginx通過反向 功能將動態請求轉向後端php fpm。下面我們來配置乙個全新的nginx php fpm 進入nginx目錄下,編輯...
nginx php執行請求的工作原理
首先先了解下常聽說的cgi,php cgi,fastcgi,php fpm到底是什麼關係,幫助了解php的工作原理 cgi協議用來確定webserver 例如nginx 也就是內容分發伺服器傳遞過來什麼資料,什麼樣格式的資料 php cgi是php的cgi協議程序直譯器,每次啟動時,需要經歷載入ph...
nginx php執行請求的工作原理
首先先了解下常聽說的cgi,php cgi,fastcgi,php fpm到底是什麼關係,幫助了解php的工作原理 cgi協議用來確定webserver 例如nginx 也就是內容分發伺服器傳遞過來什麼資料,什麼樣格式的資料 php cgi是php的cgi協議程序直譯器,每次啟動時,需要經歷載入ph...