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.

  1. Ubuntu Lucid 64-bit
  2. Install APT-Go nginx
  3. App-get updates
  4. install apt-go php5-cli php5-common php5-suhosin
  5. install dragon-software-properties
  6. Add-apt-repository PPA: brianmercer / php
  7. AppT-Mill Update & amp; Amp; ; Apt-get install php5-fpm php5-cgi
  8. restart /etc/init.d/nginx
  9. /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

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -