Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does PHP get its settings if no configuration file is loaded?

Tags:

php

I have set up PHP 5.3.10 on a RHEL 4 server.

When I ran php -i | grep "Loaded" it returned

Loaded Configuration File => (none)

It's OK with that setup. PHP is working the way we needed it to. I just need to know, if no php.ini is being used, where does PHP get all its settings? Thanks.

Update: I realized this after I hit submit. Sorry, how do I move this to Stack Overflow? -_-

Update 2: Result of php --ini:

Configuration File (php.ini) Path: /usr/local/lib Loaded Configuration File: (none) Scan for additional .ini files in: (none) Additional .ini files parsed: (none)

like image 355
d4ryl3 Avatar asked Mar 27 '13 01:03

d4ryl3


2 Answers

If there is no php configuration file loaded it just takes the default values. Please check the documentation to have the list of the default values :

http://php.net/manual/en/ini.core.php

like image 136
fe_lix_ Avatar answered Oct 29 '22 18:10

fe_lix_


It may depend on your server setup.

It could be (depending on PHP version) that the PHP configuration is controlled from within the Apache configuration files: How to change configuration settings

You can use the phpinfo() function to view your PHP configuration settings (including the config file directory). Create a file called info.php (for example in the folder that is the "DocumentRoot"), and edit the file to contain the following code:

<? phpinfo(); ?>

So, if your domain is:

http://example.com

And your "DocumentRoot" is:

".../www" or  ".../public_html"

Place the file in that folder and then using a browser, go to:

http://example.com/info.php

This should show you all the settings.

like image 2
Kevin Fegan Avatar answered Oct 29 '22 16:10

Kevin Fegan