How to Make Changes to php.ini

See Changing PHP Settings for customizing settings with Craft Nitro.

php.ini is the name of PHP’s master configuration file.

To find out where your php.ini file is located, create a PHP file called ini.php in your web root (alongside your index.php file) with this:

<?php
echo 'Loaded php.ini: ' . php_ini_loaded_file();

Then access that file in your web browser by going to https://your-project.nitro/ini.php.

There’s a good chance that the php.ini file will be different for console requests. If you need to make a change that targets console requests, open up your terminal and run this command:

php -i | grep 'Loaded Configuration File'

Or if you’re on a Windows server:

php -i | find "Loaded Configuration File"

Once you known where your php.ini file is, you can open it with your favorite text editor to make changes to it.

For example, we recommend that you set the max_execution_time setting to at least 120 (two minutes), to accommodate for long-running Composer operations.

max_execution_time = 120

Craft also requires a memory_limit value of at least 256M.

memory_limit = 256M

Before adding any new lines to the file, search for the setting you want to modify, and make sure it’s not already defined somewhere.

It may be that the setting is listed, but commented out. To uncomment it, remove the ; from the beginning of the line.

Changes made to the php.ini file will not take effect until you restart the server.

If you’re running MAMP or similar local hosting software, you might need to edit a php.ini template file rather than the loaded php.ini file. In MAMP on a Mac, for example, go to FileEdit templatePHP (php.ini) → [your php version].