php.ini does not get reloaded when i restart apache. WHY???

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

ivj
Forum Commoner
Posts: 31
Joined: Sat Mar 05, 2005 3:07 am

Post by ivj »

When I try to do this:

Code: Select all

echo "Configuration file: <b>".get_cfg_var("cfg_file_path")."</b><br>";
I get an empty string. http://us2.php.net/function.get_cfg_var Suggests that IF I am using a configuration file, then this will return it's value. So I can only assume that it's not using a configuration file. Now how can I find out why the hell not? Also, can I force PHP to use a specified config file during runtime?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Maybe you should set the PHPIniDir directive in httpd.conf.
ivj
Forum Commoner
Posts: 31
Joined: Sat Mar 05, 2005 3:07 am

Post by ivj »

I thought ini location was hardcoded when you compile? Let me give that a try.
ivj
Forum Commoner
Posts: 31
Joined: Sat Mar 05, 2005 3:07 am

Post by ivj »

Holy crap that actually worked! http://thailandhaven.com/test.php

Check it out now!

You guys are the best! I told you you were super mods. I guess I should add this to a list of another "extremely simple thing that caused a lot of time to be wasted".

Now I just gotta figure out that PHPMailer thing but that's for another thread.

Thanks fellas!
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

ivj wrote:I thought ini location was hardcoded when you compile?
That's only the last resort
http://de2.php.net/ini wrote: php.ini is searched in these locations (in order):
* SAPI module specific location (PHPIniDir directive in Apache 2, -c command line option in CGI and CLI, php_ini parameter in NSAPI, PHP_INI_PATH environment variable in THTTPD)
* The PHPRC environment variable. Before PHP 5.2.0 this was checked after the registry key mentioned below.
* HKEY_LOCAL_MACHINE\SOFTWARE\PHP\IniFilePath (Windows Registry location)
* Current working directory (except CLI)
* The web server's directory (for SAPI modules), or directory of PHP (otherwise in Windows)
* Windows directory (C:\windows or C:\winnt) (for Windows), or --with-config-file-path compile time option
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Glad you got it working man.
Post Reply