Find the answer to your Linux question:
Results 1 to 3 of 3
Hello, I'm running CentOS 5 with suPHP in FastCGI mode. PHP 5.2.5. For some reason the custom php.ini is not loading from within the current directory. I've setup my server ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2007
    Posts
    26

    PHP4 & PHP5 custom php.ini file not loading


    Hello,

    I'm running CentOS 5 with suPHP in FastCGI mode. PHP 5.2.5.

    For some reason the custom php.ini is not loading from within the current directory.

    I've setup my server to host shared hosting plans and I would like the ability for each account to have a custom php.ini file load when the want. However, regardless of the version that is loaded (4 or 5) of php, the default php.ini file for PHP5 loads (/usr/local/php5/cgi/php.ini)

    I cannot seem to get the php.ini fille to load from the current directory.

    Can someone please help me with this?

    Also... If it is possible, I would like it to load recursively from the directory ABOVE the /home/username/public_html location. I want to be able to have it not accessible from the internet if possible.

    Please help!

  2. #2
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,769

    Smile

    Quote Originally Posted by jim.thornton View Post

    However, regardless of the version that is loaded (4 or 5) of php, the default php.ini file for PHP5 loads (/usr/local/php5/cgi/php.ini)

    I cannot seem to get the php.ini fille to load from the current directory.

    If i understand your problem correctly,by default ,you are using php.ini - but you want to use php.ini file found in

    /some/directory/path/php.ini

    If so , Check your environmental variables $PATH whether
    /usr/local/php5/cgi/ comes in front of /some/directory/path/.

    If you have .bash_profile file


    open the file
    Code:
    vi ~/.bash_profile
    Then add the following line:

    Code:
    PATH=/some/directory/path : $PATH
    export PATH
    Now check output of the echo $PATH and make sure your desired directory listed before default path /usr/local/php5/cgi/

    HTH
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

  3. #3
    Just Joined!
    Join Date
    May 2007
    Posts
    26
    Not exactly.

    By default I want to use PHP5. I want the ability for somone to run PHP4 when needed. This works fine, they can activate php4 by either using .php4 extensions or they can AddHandler and AddType to the .htaccess file to use PHP4.

    That works fine.

    I've had a hosting plan in the past that if you placed a php.ini file in the directory that your script is executed then PHP will use the local config file instead of the default (/usr/local/php5/cgi/php.ini).

    I want my installation to behave like this. But, when I place a php.ini file into the local directory, it isn't loading it for some reason.

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •