LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Install/Configuration > php.ini and vhosts not loading local php.ini

Reply
 
Thread Tools Display Modes
  #1  
Old 04-13-2009, 03:31 PM
rgranger rgranger is offline
New Member
 
Join Date: Apr 2009
Posts: 6
Default php.ini and vhosts not loading local php.ini

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 by rgranger; 04-13-2009 at 03:34 PM..
Reply With Quote
  #2  
Old 04-13-2009, 04:05 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
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.
Reply With Quote
  #3  
Old 04-13-2009, 04:10 PM
rgranger rgranger is offline
New Member
 
Join Date: Apr 2009
Posts: 6
Quote:
Originally Posted by mistwang View Post
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
Reply With Quote
  #4  
Old 04-13-2009, 04:18 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
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.
Reply With Quote
  #5  
Old 04-13-2009, 04:22 PM
rgranger rgranger is offline
New Member
 
Join Date: Apr 2009
Posts: 6
Quote:
Originally Posted by mistwang View Post
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?
Reply With Quote
  #6  
Old 04-13-2009, 04:36 PM
rgranger rgranger is offline
New Member
 
Join Date: Apr 2009
Posts: 6
Quote:
Originally Posted by rgranger View Post
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?
Reply With Quote
  #7  
Old 04-13-2009, 05:25 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
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.
Reply With Quote
  #8  
Old 04-13-2009, 05:43 PM
rgranger rgranger is offline
New Member
 
Join Date: Apr 2009
Posts: 6
Quote:
Originally Posted by mistwang View Post
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...
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 11:32 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.