0

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?

Udhav Sarvaiya
  • 9,380
  • 13
  • 53
  • 64

2 Answers2

0

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

sudip
  • 2,781
  • 1
  • 29
  • 41
  • 1
    If you're using Artisan, you need to do `php -i` in the Terminal. The webserver may be using a *different* php.ini (or even a different version of PHP entirely). – ceejayoz Apr 24 '19 at 21:19
0

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
jpcaparas
  • 181
  • 1
  • 4