Trying to run chrooted suPHP with UserDir, getting 500 server error

Posted by Greg Antowski on Server Fault See other posts from Server Fault or by Greg Antowski
Published on 2012-11-05T10:06:20Z Indexed on 2012/11/05 11:06 UTC
Read the original article Hit count: 992

Filed under:
|
|
|
|

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.

© Server Fault or respective owner

Related posts about apache2

Related posts about php