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?
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