Trying to run chrooted suPHP with UserDir, getting 500 server error
- by Greg Antowski
I've managed to get suPHP working fine with UserDir (i.e. PHP files run from the /home/$username/public_html) directory, but I can't get it to work when I chroot it to the user's home directory.
I've been following this guide:
http://compilefailure.blogspot.co.nz/2011/09/suphp-chroot-gotchas.html
And adapting it to my needs. I'm not creating vhosts, I just want PHP scripts to be jailed to the user's home directory.
I've gotten to the part where you use makejail and set up a symlink. However even with the symlink set up correctly, PHP scripts won't run. This is what's shown in the Apache error log:
SoftException in Application.cpp:537: Could not execute script "/home/jimmy/public_html/test.php"
[error] [client 127.0.0.1] Caused by SystemException in API_Linux.cpp:444: execve() for program "/usr/bin/php-cgi" failed: No such file or directory
The thing is, if I try running either of the following commands in the terminal it works without any issues:
/home/jimmy/usr/bin/php-cgi /home/jimmy/public_html/test.php
/usr/bin/php-cgi /home/jimmy/public_html/test.php
I've been trying for hours to get this going and documentation for this kind of stuff is almost non-existent. If anyone could help me out with this, I'd be extremely grateful.