Of course, the first step is to install php5-egi packages: nginx does not have in-built support forfastegi processes unlike Apache and lighttpd, and so we have to take charge for managingfastegi processes.
As recommended on the nginx wiki, I would like to use the lighttpds spawnjegi program for php5jastegi implementation. There are loads of other possibilities that you can check by visiting the URLs mentioned in the resources section at the end of this article.
To get spawnjegi, I downloaded the latest stable lighttpd and compiled it. Once the compilation was done and I had the script, I removed all the build tools.
Now let, lS remove what we have installed for building the lighttpd.
To start thefastegi server after every reboot, we can put the following line in / ete/re.loeal file, or as suggested on the nginx wiki, we can write a custom script also. I have chosen to take the ancient route of /etc/re.loeal file:
Now, to configure nginx to pass all incoming requests for PHP files to the fastegi process listening on port 9000, we need to add the following location directive to /ete/ nginx/sites-available/defaultfile. This line needs to be added before the closing of the server directive:
Finally, let US create a simple PHP script in the document root to test this. The traditional route is to create a phpinfoO script, but I will just create a "Hello World!" script for security reasons.



Reply With Quote
Copyright Techfuels
Bookmarks