Custom PHP Script Handler
Following this thread: http://www.litespeedtech.com/support...ead.php?t=3995
I've now compiled:
1 x PHP 5.3.2 called "lsphpcerb"
1 x PHP 5.2.13 called "lsphpmage"
In /opt/lsws/ I can see those two folders, lsphpcerb and lsphpmage
Following the thread mentioned above, I was hoping this was a matter of setting the External App or Script Handler in the Virtual Host. But my custom named PHP compilations aren't showing.
When I click View/Edit on the VH and then External App I thought maybe I can edit the LSAPI App from something lsphp to lsphpcerb. Or under Script Handler edit php. Handler Type is LiteSpeed API and I had hoped and expected that now under Handler Name I would find my lsphpcerb. But I only get three options:
[Server Level]: lsphp5
[Server Level]: lsphp4
[VHost Level]: $VH_NAME_lsphp
So, what do I need to do to say "This VH needs its php files handled by lsphpcerb instead of lsphp5."
Any directions you can offer?
create a external app called lsphpcerb, using lsphp-5.3.2 binary,
at vhost level add or change script handler for ".php" using the lsphpcerb application.
Thanks mistwang, appreciate your prompt responses.
Virtual Hosts > Xyz VH > External App?
I guess the latter as this is the only VH which will use this specific PHP setup.
I'd be ever so grateful if you could please elaborate on the above two points.
If only used for that VHOST, just add it at vhost level.
In command, use path to lsphp-5.3.2 binary. Socket address should be unique, could be anything you want.
Key fact: You can compile PHP only once per version.
- PHP 5.2.13 with Mailparse, plus;
- PHP 5.3.2 with Curl, plus;
- PHP 5.3.1 with SOAP
Example, not possible:
- PHP 5.3.2 with Curl and Mailparse, plus;
- PHP 5.3.2 with SOAP and GD
LSWS references each instance of a PHP compilation by its version number, not by an arbitrarily set name. (Would be nice if this changed...)
Building on the example, possible, you can have one VH with external app pointing to $SERVER_ROOT/fcgi-bin/lsphp-5.3.2 and one to $SERVER_ROOT/fcgi-bin/lsphp-5.2.13 - simply edit the standard LSAPI App External App and update the Name, Socket Address and Command.
My use case works now. Thanks for your help.
If the above finding is correct, I'd make it a feature request to be able to "label" a certain PHP compile set with a unique arbitrarily chosen reference so withing fast-cgi folder, the PHP binary is referenced with this label. That way, we can have multiple binary compilations of the same PHP version with different PHP extensions. On a busy web server with many sites/scripts, this make environment isolation much easier and greatly helps with upgrade paths etc.
1. assume you have defined external applications:
lsphp532_1 --> PHP 5.3.2 with Curl and Mailparse
lsphp532_2 --> PHP 5.3.2 with SOAP and GD
2. under admin console --> server or vhost --> Script Handler -->Add,
php52,php53 are suffixes.
thus, you've defined new php handlers:
3.you can choose different php handler in different folders.
to select "PHP 5.3.2 with Curl and Mailparse" to run .php, using
AddType application/x-httpd-php52 php
to select "PHP 5.3.2 with SOAP and GD" to run .php, using
AddType application/x-httpd-php53 php
and so on. you can verify this by access phpinfo() in that folder.
|All times are GMT -7. The time now is 03:54 AM.|