Question about maintaining multiple Apache handler names for PHP

Ballard

Verified User
Joined
May 8, 2009
Messages
7
I'd very much appreciate the insight of people familiar with how DirectAdmin works. I've only really used DirectAdmin from the reseller / user perspective and don't have in depth knowledge of its back end or use from admin perspective. However, I now really need to find out the answer to a question about how the PHP configuration works. Today I've done some reading about that and I do understand it better, but still not well enough to be able to answer my question without actually setting up DA and experimenting (which I can't do right now). So I'd really appreciate your help.

In the following I assume that either CustomBuild 1.1 or 1.2 is in use, but perhaps not.

Let's say there's a server running: DirectAdmin 1.43.3; PHP 5.2 as the default and also PHP 5.3, which can be invoked using the appropriate AddHandler directive. The following two handlers are defined:

x-httpd-php => 5.2
x-httpd-php53 => 5.3

Let's say the server config is updated so that PHP 5.3 is the default, but PHP 5.2 can be invoked using an AddHandler directive. So now the following handlers are defined:

x-httpd-php => 5.3
x-httpd-php52 => 5.2

At this point both 5.2 and 5.3 are running as CGI/FastCGI and probably were before the update. I'm not sure if that's possible with CustomBuild via some kludge, or if CustomBuild is not in fact in use.

1) As a result of the update described above, is there any technical reason that the x-httpd-php53 handler that was originally defined could not continue to be defined? (It would point to the same script that it originally did, and that the x-httpd-php handler now points to.) So, there would be a total of 3 handlers defined, and a total of 2 PHP versions.

2) It's my understanding that for some screwy reason CustomBuild only accomodates enabling 2 versions of PHP at a time. Does that mean that following the update, the x-httpd-php53 handler would be undefined if no further action were taken?

3) If so, can the x-httpd-php53 handler simply be redefined?

4) How would that be done? Action directive in httpd-includes.conf? Or something in one of the suphp related config files? Other?

Thank you.

Please spare me any "you shouldn't be using PHP 5.2" responses -- has nothing to do with my question.
 
When I need PHP 5.2. and PHP 5.3. with custombuild 1.x, I use suPHP with:

x-httpd-php => 5.3
x-httpd-php52 => 5.2
x-httpd-php53 => 5.3

or similar. That really does not much matter how you call them, if you keep their names the same both in suphp.conf and apache configs.
 
Thanks for your reply zEitEr.

Ok, so you're using CustomBuild 1.x and you have at least 2 versions of PHP running and at least 3 Apache handler names related to those versions.

If you could comment on this question, that would be great:

It's my understanding that for some screwy reason CustomBuild only accomodates enabling 2 versions of PHP at a time. Does that mean that following the update, the x-httpd-php53 handler would be undefined if no further action were taken?

In DirectAdmin or CustomBuild is there some inherent limit of 2 PHP versions and / or 2 Apache handler names for PHP that you had to work around or that made it necessary for you to take additional steps to achieve the configuration you described? Or were you able to configure things that way just using built-in features of DirectAdmin and / or CustomBuild?

You mentioned using the same names in suphp.conf and apache config files. Did you manually configure those handlers in those files, or did you configure them indirectly via CustomBuild or some other means?

When you say that you "use suPHP with...", does that mean that both PHP versions are CGI in that case? Based on the stuff I read, I got the impression that it isn't possible to achieve that configuration just using CustomBuild 1.x.

Thank you.
 
There were a guide somewhere on the forums on how to install two versions of PHP 5.x with custombuild 1.x with minimal customization. I don't use it, you probably want to give a try. A way how I do install two versions of PHP 5.x with CB 1.x requires some understanding of what you are doing, as many things should be done manually (apache configs, suphp.conf and configure scripts are to be modified manually), and custombuild script of 1.x version does not allow it by default. And of course no built-in PHP selector would work in this case.

And yes, I install both versions of PHP-CGI 5.2. and 5.3, and I don't use mod_php.
 
Thanks again.

I don't use it, you probably want to give a try.

I'm not actually trying to do it, I just need to understand how it works.


And of course no built-in PHP selector would work in this case.

I didn't even know there was such a thing until I started looking into this. I don't even know for sure what it is -- I assume a dropdown in the DirectAdmin UI that causes an AddHandler directive to be inserted in the VirtualHost, or something along those lines. If that's the gist of it, then a PHP selector is not a factor in my scenario and can be disregarded for the purposes of my questions.


A way how I do install two versions...

I think CustomBuild is probably being used to configure the PHP versions and handlers in the scenario I'm asking about, so I think I probably need to find out the answer in that context. But from what you've said, it sounds like in the context of DirectAdmin, there's nothing stopping you from configuring more than 2 PHP versions / handler names if you don't rely on CustomBuild to do it for you.
 
Back
Top