odd question running a subdomain under older php version

dmacleo

Verified User
Joined
Jun 21, 2012
Messages
631
I have no idea how to do this under DA.
I run php 5.4 serverwide (my sites only stuff on it) but I have one subdomain running a video script that needs php 5.3.
not sure how to set that up.
my php installs were plain stock, whatever handler DA and CB default to, apache2handler I think its called.

if I place a php.ini file in the directory of the subdomain and use htaccess to point to it for that subdomain will it get honored?

I have no experience running different sites/domains with their own php.ini's.

thanks for any advice.
 
maybe this is also a CB topic as I need to have both 5.3 and 5.4 installed?
damn this is gonna suck LOL
 
With mod_php (apache2handler) you can not use separate or per user php.ini. You could try to install PHP 5.3 as CGI and enable it for your sub-domain in .htaccess.
 
shoot I just saw there was a php section of forum, sorry.
wasn't sure if this was php, htaccess, or vhost issue initially.
 
off the top of your head do you know of any pitfalls if I swap to cgi?

PHP CGI can not be used with APC/eAccelerator/etc.

so it looks doable.
question is...am i feeling lucky? LOL

It's still possible to do that with custombuild if you've got some experience and knowledges in Linux. Though I have no any guide for this I can give the idea:

1. Protect httpd configs from overwriting, specially those onces with "php" in their names /etc/httpd/conf/extra/
2. Switch PHP version to 5.3 in options.conf
3. Enable php cgi in options.conf
4. Install php-cgi with custombuild, additionally you might need to install suphp
5. Switch back PHP version to 5.4 in options.conf
6. Disable php cgi in options.conf
7. Restart apache and make sure you are still running PHP 5.4 and apache configs were not modified.
8. Add directives into .htaccess (search them here on the forums or take them from apache configs) to enable PHP-CGI 5.3 for your sub-domain.

Note, I did not check the steps, it's up to you to check them. Though I can not guarantee that it will work in your particular case if you are going to do it by yourself, I can set up it for you as well as some other users here as a commerce service, and if you choose me I'll be able to give a warranty period for the work done by me (PM me for a quote, if you are interested).
 
apc is the issue, knew (in back of my mind) that plain cgi had something I had to avoid, thanks for confirming that.
I think I am better off waiting on the video script developers to update, theres a new version due soon so it may only be a week or so inconvience.
now iirc fcgi (which works with apc) could be applied but right now on CB1.2 thats also a chore :(
and with CB2 with php-fpm on the horizon its also probably not efficient to try to shoehorn fcgi and php 5.4 and 5.3 in, probably better off waiting.

Thanks for the advice and assist, its been very helpful.
 
Back
Top