Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Senior Coder TheShaner's Avatar
    Join Date
    Sep 2005
    Location
    Orlando, FL
    Posts
    1,126
    Thanks
    2
    Thanked 40 Times in 40 Posts

    PHP Configuration File Not Loading

    Hey all,

    This is something that I'm really stuck on. I configured PHP to look for my configuration file (php.ini) in /php/ini. /php/ini is a symbolic link to my actual php folder. In that folder resides php.ini.

    When I display phpinfo(), next to Loaded Configuration File is (none), but next to Configuration File (php.ini) Path is /usr/local/php.

    None of my settings in php.ini are in place, so I know that php.ini is not loading for sure. What can I do to see what's going on? Can I set PHP's Config File Path to a symbolic link? I don't see why not. Could my php.ini be erroring out and that's why it doesn't load? If so, how do I found out if it's really erroring and what line is bad?

    Thanks for any guidance,

    Shane
    Last edited by TheShaner; 08-09-2007 at 04:20 PM. Reason: Probably shouldn't have my actual paths on the web

  2. #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,298
    Thanks
    4
    Thanked 84 Times in 83 Posts
    Did you restart apache after making changes?
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  3. #3
    Senior Coder TheShaner's Avatar
    Join Date
    Sep 2005
    Location
    Orlando, FL
    Posts
    1,126
    Thanks
    2
    Thanked 40 Times in 40 Posts
    I've restarted the apache server many times and even the actual gentoo server and all to no avail.

    -Shane

  4. #4
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,073
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Are you sure that the user account the apache process is running under has read access to the file and directory in question?
    OracleGuy

  5. #5
    Senior Coder TheShaner's Avatar
    Join Date
    Sep 2005
    Location
    Orlando, FL
    Posts
    1,126
    Thanks
    2
    Thanked 40 Times in 40 Posts
    I'm working under root, although if you're talking about the apache web server's account, then should i make that php directory owned by the apache account?

    None of the other folders, like public_html, are owned by the apache account and the website comes up locally no problem

    Edit: I ran php --ini on the command line and contrary to what phpinfo() says, it told me that configuration file path is /usr/local/lib. When I put my php.ini file in that location, it works. What can I do to correct this?


    -Shane
    Last edited by TheShaner; 08-09-2007 at 04:22 PM. Reason: Editting out actual server paths

  6. #6
    New to the CF scene
    Join Date
    Sep 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    When you compile php, use these options:

    --sysconfdir=/etc --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d

    I had this same problem and this fixed it so that php.ini is loaded correctly when php is run from command line, or via apache module.


 

Posting Permissions

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