php.ini vs php.ini.default

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
textheavy
Forum Newbie
Posts: 6
Joined: Fri Mar 11, 2005 12:16 am

php.ini vs php.ini.default

Post by textheavy »

When I run the function phpinfo() through a browser I get this path to php.ini:

/usr/local/php/lib/

When I run the same function in a command-line script I get this path to php.ini:

/etc/

Now, there is no php.ini in the /etc/ directory. There's only a php.ini.default file.

Does this mean that when I run a command-line PHP script it's loading php.ini.default?

The extensions_dir in both of these files is set to "./"

Now, when I run a script from the command line (and it references the /etc/php.ini.default file) it does not load GD.

My question is, should I change the extensions_dir in php.ini.default to point to /usr/local/php/lib ?

Thanks for any advice.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Why not try changing the .default one to find out definitively?
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

It probably shouldn't ever, ever look for php.ini.default. It's not a ini file.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Use the -c flag in the command line to change the ini location, or you could maybe copy the other php.ini into /etc/ - not sue if that works :?
Post Reply