PDA

View Full Version : PHP Configuration File Not Loading


TheShaner
08-08-2007, 09:39 PM
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

Spookster
08-08-2007, 09:43 PM
Did you restart apache after making changes?

TheShaner
08-08-2007, 09:56 PM
I've restarted the apache server many times and even the actual gentoo server and all to no avail.

-Shane

oracleguy
08-08-2007, 10:09 PM
Are you sure that the user account the apache process is running under has read access to the file and directory in question?

TheShaner
08-08-2007, 10:23 PM
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

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

Reubenxx2007
09-12-2007, 10:45 AM
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.