I've installed Nginx + FPM-PHP under Debian and ArchLinux. Both are working fine. However, I can't figure out how to get the PHP part to follow symlinks. I've also tried with Lighttpd, but to no avail.
Here is what I want to do:
- Root directory configured as usual: /srv/http
- Symlinks from each project to /srv/http (example: /home/user/projects/site1 to /srv/http/@site1), in such a manner that to test a local development, I just need to add the name of the site to the URL:
"http://localhost/site1/xyz"
or"http://localhost/site2/abc"
, etc;
I can make it work (after fixing permissions) with html and other static files, but whenever there is a PHP script, I get the famous "Primary script unknown" error. Inside the "real root" directory (/srv/http) there is not such an error. But when I tried to copy a subdirectory to another location (ie /home/user/projects/xyz) and symlink it to /srv/http/, I get that error.
I've followed many tutorials, including excellent posts by a Danish guy. But I can't make it work. I've tried to use all combinations of "fastcgi_param SCRIPT_FILENAME", ALIAS, etc, including hardcoding another directory into it to make sure this was (or not) the cause of the problem.
So, here are the questions:
- Is it possible to use symlinks for PHP execution under nginx or lighttpd?
- This setup is for development only, is there a reason not to use it?
- What kind of magic would be necessary to make it work?
Since the target environment is going to be nginx (there are other projects already working), I would like to stick to nginx for development, if possible. For the sake of speed, I would also use lighttpd too. I would like to avoid Apache (only because of resources), if feasible.