What is a good way of using PHP with nginx? From the finding I got, maybe using PHP-FPM might be a good way of handing PHP behind nginx.
The problem we have is that the free web based API we serve gets a lot of request (about 500K a day), the requests are mostly very short and small in size but Apache is consuming a lot of memory. I want to try nginx to see if it can handle it better.
Thanks.
Edit (might need this in your site conf) :
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;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With