The requested URL /php5/php-cgi/index.php was not found on this server
It’s look like the rewrite rules about subdomain bypass the ScriptAlias directive. Indeed, it looks like for /php5/php-cgi/index.php. So it is in subdomain. If we create a dir php5 in this subdomain with the php-cgi bin it is much better but as we don’t have a scriptAlias the execution of CGI is not allow there
Well, how to allow CGI in a subdomain by using the Action directive (to not have to enter in very php5 script #!/home/account/domain.com/php5-cgi/php-cgi like we’ll do with a perl script ?)
Ok the problem has been solved by installing SUPHP
If you like I can give you a SRPM of suPHP0.6.1 that will work well with our other SRPM php-5.1.2-cgi-cli (http://interworx.com/forums/showthread.php?t=1630) and which will gibe you the ability to easily have on an interworx box php running as:
php4 as module or cgi
php5 as CGI
More security (mod suPHP in paranoid mode + suexec)
The config file of suphp.conf in /etc/httpd/conf.d/suphp
mod_suphp
LoadModule suphp_module modules/mod_suphp.so
<IfModule mod_suphp.c>
suPHP_Engine off
</IfModule>
Vhost config file of the user who’d like to have php5 and php4 in /etc/httpd/conf.d/domain.conf
…/…
AddHandler x-httpd-php .php
AddHandler x-httpd-php5 .php5
suPHP_Engine on
suPHP_UserGroup user group
suPHP_AddHandler x-httpd-php5 .php5
suPHP_AddHandler x-httpd-php .php
php_admin_flag engine Off
<Files *.php> # ini php file for php4 /etc/php.ini
suPHP_ConfigPath /etc
</Files>
<Files *.php5> # ini php file for php5 /etc/php5/php.ini
suPHP_ConfigPath /etc/php5
</Files>
and finaly the suphp.conf in /etc
…/…
[handlers]
;Handler for php-scripts
x-httpd-php=php:/usr/bin/php
x-httpd-php5=php:/usr/bin/php5
…/…
By default all file in the docroot ending by .php5 will be treat by suPHP handlers and the php5 binary, and all file ending by .php will be treat by suPHP handlers the php4 binary
If your users want to have all their files ending by .php treat by suPHP and php5 bianry just tell them to add in an .htaccess file this
another thought that I had was to create a separate virtual host in the same vhost config file for sub.mydomain.com but it sounds like your idea is better.
In fact Tim I tried this too, but the problem was that the script need some files hosted on the main domain. This script is DotClear2 and it allows to create mutliple blog, so we use it to give blogs to our clients like http://myname.my-blog.com
DotClear2 needs php5 it’s why we did the srpm which install only the cgi and cli version of php5
The inconvenient with suPHP is that as soons as you enable it in a vhost the php4 DSO module doesn’t work anymore on this vhost. You have to use both php4 and php5 as CGI with the suPHP_Handler. The main advantages is that the user might control what he wants via .htaccess file, like .php as php5 and .php4 as php4 or .php as php4 and .php5 as php5. The other advantage is that you don’t have to copy the php binary in the vhost, suPHP use the standard bianary location and suexec still works
Similar issue with PHP4 as a CGI and PHP 5 as a module on my server.
I’ve found I can use PHP4 as a CGI via an .htaccess file at the root level of the site. PHP4 is then propagated throughout the site sub-domains and sub-folders, but can be overridden on any sub-domain or sub-folder by placing another .htaccess file that calls the PHP5 module. This way I don’t have to touch the virtual host file : http://www.interworx.com/forums/showthread.php?p=11549#post11549