php.ini and vhosts not loading local php.ini

Discussion in 'Install/Configuration' started by rgranger, Apr 13, 2009.

  1. rgranger

    rgranger Member

    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?

    System Linux localhost.localdomain 2.6.18-128.1.6.el5 #1 SMP Wed Apr 1 09:19:18 EDT 2009
    Build Date Apr 13 2009 16:53:57
    './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
    Configuration File
    (php.ini) Path
    Configuration File
    Last edited: Apr 13, 2009
  2. mistwang

    mistwang LiteSpeed Staff

    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. rgranger

    rgranger Member

    I am using vhosts so I want to use for php

    and to use

    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?

  4. mistwang

    mistwang LiteSpeed Staff

    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. rgranger

    rgranger Member

    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. rgranger

    rgranger Member

    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?
  7. mistwang

    mistwang LiteSpeed Staff

    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. rgranger

    rgranger Member

    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...

Share This Page