How to use nginx with PHP? -
What is a good way to use PHP with NGNX? From the search I found, maybe using PHP-FPM can be a good way to hand over PHP behind NGNX.
We have the problem that the free web-based APIs we serve receive many requests (about 500K per day), requests are mostly small and small but Apache can take a lot of memory Used to be . I have to try nginx to see if it can be handled better.
Thank you.
- Ubuntu Lucid 64-bit
- Install APT-Go nginx
- App-get updates
- install apt-go php5-cli php5-common php5-suhosin
- install dragon-software-properties
- Add-apt-repository PPA: brianmercer / php
- AppT-Mill Update & amp; Amp; ; Apt-get install php5-fpm php5-cgi
- restart /etc/init.d/nginx
- /etc/init.d/php5-fpm restart
Editing (This may be needed in your site):
location ~ \ .php $ {fastcgi_read_timeout 60000; Fastcgi_pass 127.0.0.1:9000; Fastcgi_index index.php; Fastcgi_param SCRIPT_FILENAME / var / www / site $ fastcgi_script_name; Includes fastcgi_params; } Place ~ /\.ht {reject all; }
Comments
Post a Comment