Вопрос

When you use a custom php.ini file in a suPHP web server all the variables you don't configure in that php.ini file get default values. Where those come from exactly?

As an example you can use a totally blank php.ini file and a whole configuration is done anyway. As can be tested with phpinfo() output.

I'm testing in a cPanel server and the php.ini configuration path shown in phpinfo is:

/usr/lib

but the php.ini file in that path has not those default values I'm seeing when I create a custom php.ini.

For example /usr/lib/php.ini has memory_limit at 64MB but with a custom blank php.ini file I get memory_limit 128MB in phpinfo.

I'm not able to figure out where are those default values configured. Where can I find them?

Это было полезно?

Решение

http://www.php.net/manual/en/ini.list.php

List of directives and default values. This isn't an end-all list as extensions have their own settings and defaults.

Другие советы

php.ini is a configuration file that is read when a php script gets executed, when the php script starts it looks for it in the current working directory, if it’s not present then it will check for the main servers php.ini . It contains the directives with their local values and master values – few most common directives are: register_globals, allow_url_include , allow_url_fopen , open_basedir etc…

So, you must be wondering how to find the path for php.ini on your cPanel web server. Assuming that you have root access the command to check the path is:

root@server# php –i | grep php.ini
Configuration File (php.ini) Path => /usr/local/lib/php.ini

Well, Assuming you are using Linux and Apache web server, it depends on the Linux distribution you are using, the version of php and the way you install it with Apache web server. Php.ini may be here:

/etc/php.ini

Or here:

/etc/php/php.ini /etc/php5/php.ini

Or here:

/usr/bin/php5/bin/php.ini

Anyway, you can always find any file named php.ini in this manner

find / -name php.ini

You can also look at the Loaded Configuration File from the phpinfo(); script.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top