-   Linux - General (
-   -   Running CGI version of PHP (

Agento- 02-15-2003 03:35 PM

Running CGI version of PHP
I have a chrooted web hosting solution setup. I am trying to run php as a cgi instead of an apache module so it runs suexec as the chrooted user that owns the domain. So they have control of their own php.ini and uploaded files are owned by the correct user. I am having problems with this however.

I added a "Action" for the .php, .php3... file types and added in User and Group entries for the virtual host but when it tries to load up the file.. it calls up the default document root and then appends on the location of the action. like /var/www/html/usr/bin/php or something. Any one have any experience in setting this sort of thing up?

Thanks in advance

markus1982 02-15-2003 03:54 PM

Well, one question aside, how do you manage to get functions like MAIL to work properly ?

Regarding your question you could set some kind of variables on a per virtual host bases like:

<Location />
php_admin_value doc_root "/server/http/htdocs/virtual_hosts/XYZ/"
php_admin_value open_basedir "/server/http/htdocs/virtual_hosts/XYZ/:/server/http/binary/lib/php/"
php_admin_value phpa on

Agento- 02-15-2003 08:47 PM

I havent gotten to that point yet. Why couldn't you get mail working. Wouldn't you just have to give the user access to sendmail? I'm just worried about getting apache parsing php through cgi... and running the script as the owner of the site. Do you know how to get that running?

markus1982 02-16-2003 02:50 AM

I'm running PHP as module and using the documentroot, etc restrictions which are nice. Also I have the directory set up pretty strict ...

About getting mail working, when you chroot apache there will not be a sendmail in your chroot ... I think the best solution would be PHP supporting mail servers (IP, SMTP authentification) rather than just that sendmail function ... I think this is an important feature missing!

Agento- 02-18-2003 06:39 PM

Well i have a complete chroot enviroment for the user. Not just a chrooted apache. So the sendmail binary can be accessable by php in a chrooted session. I'm just looking for instructions on how to get php running as a cgi so i can have it run php scripts as a different user.

All times are GMT -5. The time now is 05:19 AM.