Tag Archives: php.ini

Where is php.ini located in Ubuntu?

Where is php.ini file?

This is a question I have been asked a few times recently. Depending on what system you are running, php.ini could have different locations. But where is php.ini hidden?

Find php.ini

Firstly, it’s not hidden, it’s a configuration script which determines the settings of your PHP installation. There are few ways to find where the php.ini file.

PHP time limit – extend script running time

Some scripts require some time to execute, and they might reach your PHP time limit.

Fatal error

If PHP time limit is too short for your script, you will see this error:

Fatal error: Maximum execution time of N seconds exceeded in /path/to/script.php on line N

PHP memory limit – increase memory allocation

Sometimes, when executing a script with a strong memory usage, we might reach the PHP memory limit.

Fatal Error

This is what we can see when that moment happens:

Fatal error: Allowed memory size of a certain amount bytes exhausted (tried to allocate another amount bytes) in /path/to/script.php