php.ini and vhosts not loading local php.ini

#1
i compiled with the --config-file-path=../php and phpinfo shows that it is loading the master php.ini from /usr/local/lsws/php/php.ini

rats, pdf file was too big, snipped below. what am I missing?
thanks
Rob


System Linux localhost.localdomain 2.6.18-128.1.6.el5 #1 SMP Wed Apr 1 09:19:18 EDT 2009
i686
Build Date Apr 13 2009 16:53:57
Configure
Command
'./configure' '--prefix=/usr/local/lsws/lsphp5' '--with-mysql' '--with-mysqli' '--with-zlib' '--with-
gd' '--enable-shmop' '--enable-track-vars' '--enable-sockets' '--enable-sysvsem' '--enable-
sysvshm' '--enable-magic-quotes' '--enable-mbstring' '--with-iconv' '--with-config-file-
path=../php' '--with-jpeg-dir=/usr/lib' '--with-litespeed'
Server API LiteSpeed
Virtual Directory
Support
disabled
Configuration File
(php.ini) Path
../php
Loaded
Configuration File
/usr/local/lsws/php/php.ini
 
Last edited:

mistwang

LiteSpeed Staff
#2
That's normal, the executable is /usr/local/lsws/lsphp5, ../php will be /usr/local/lsws/php, if php.ini exists under that directory, it will be used. if do not want that, just remove that configuration option, or change to absolute path.
 
#3
That's normal, the executable is /usr/local/lsws/lsphp5, ../php will be /usr/local/lsws/php, if php.ini exists under that directory, it will be used. if do not want that, just remove that configuration option, or change to absolute path.
I am using vhosts so I want www.rob.com to use for php
doc_root=/home/rob
/home/rob/php/php.ini

and
www.bill.com to use
doc_root=/home/bill
/home/bill/php/php.ini

as they may each have seperate requirements. My first read said that it shoudl be looking under the /home/xxx/php folder for php.ini?

Thanks
Rob
 

mistwang

LiteSpeed Staff
#4
It only possible with vhost configured natively through vhost template. Not with Apache httpd.conf.

You have to add "-c $VH_ROOT/php/php.ini" to the command of PHP suEXEC external application.
 
#5
It only possible with vhost configured natively through vhost template. Not with Apache httpd.conf.

You have to add "-c $VH_ROOT/php/php.ini" to the command of PHP suEXEC external application.
Ok, now I am thinking that I will go back to apache :)

I am not using httpd.conf file or apache mode, strickly litespeed and vhosts configured though the gui. I don't have and external suphp scripts and am using the default handlers. do I need to setup an external php handler for each vhost?
 
#6
Ok, now I am thinking that I will go back to apache :)

I am not using httpd.conf file or apache mode, strickly litespeed and vhosts configured though the gui. I don't have and external suphp scripts and am using the default handlers. do I need to setup an external php handler for each vhost?
the command for php5 now has:
$SERVER_ROOT/fcgi-bin/lsphp5 -c $VH_ROOT/php

and when I restart and run phpinfo.
configuration File (php.ini) path = ../php
Loaded Configuration file = (none)
Scan this dir for add... = (none)
Additonal .ini files parsed = (none)


if I hard-code the path for the ini in the external app config, then it appears to work. but that would be dumb to require a different php app for each vhost? I must be missing something right?
 

mistwang

LiteSpeed Staff
#7
You can customize vhost template based on the PHP suexec template.
If you want to use per-user php.ini, you need to create a php app for each user.

Or, you can let user override some php configuration via .htaccess.
 
#8
You can customize vhost template based on the PHP suexec template.
If you want to use per-user php.ini, you need to create a php app for each user.

Or, you can let user override some php configuration via .htaccess.
So, for a site with many vhosts they each would require a new handler, why not just expand the -c $VH_ROOT/php/php.ini? is there something with the architecture that prevents this? Is there a way to copy the handler and then just change the command line? it would save a lot of typing and potential mistakes...
 
Top