“php artisan serve”在Mac OS中读取配置在哪里? [重复]

This question already has an answer here:

I'm running my laravel project using php artisan serve, however I got stuck because I need to upload some heavy file to the server.

I've been reading on where php.ini file is in Mac, and i realized that mac has a default php configuration and if won't be read from php.ini at least you copy the php.default.ini from /etc and make a file in /etc called php.ini.

I already struggled with this on Linux, it turns out that since I'm running php artisan serve, the configuration was being taken from /etc/php/cli (Honestly i don't remember well the exact path, but the point is that it wasn't being taken from the php.ini standard file) but in Mac this folder doesn't exists, and even if I make a copy of php.default.ini and save it in /etc, my project seems to be ignoring that configuration. (which makes sense because it must be reading it from another path, just like in linux).

Does anyone know something about it? Has someone struggled with this before?

</div>

Write a <?php phpinfo();?> in anywhere and its output will show you the path of the loaded php.ini file.

I would suggest getting the php.ini location by using phpinfo() and then running this on your terminal to check if there are other ini directives used:

# assuming your php.ini is located on `/etc/php/7.2/cli/php.ini` according to `phpinfo()`:

grep -rEn post_max_size etc/php/7.2/cli