I got error in my laravel project 413 (Payload too large) on ajax post.

Now I edited the post_max_size & upload_max_filesize on php.ini file in my /etc/php/7.1/cli/php.ini.

Now I want to restart apache server since I updated the php.ini file.

I have done this

/etc/init.d/apache2 restart

And still got the error.

Is there something missing? Hope anyone can help me. Thanks


as stated in the comment, thats true. You have to modify correct ini at correct path. You have just changed only the cli configuration (PHP called from bash or so (cli)).

So the path should be: /etc/php/7.1/apache2/php.ini.

But it depend on Your distro .. etc

  • Working... thank you dude.. – Jin Mar 9 '20 at 0:43

If you use php-fpm you will need to restart this service too. Try

systemctl restart php7.<X>-fpm.service

where X is the version number of your php


Press ctrl+Alt+t then run this command

sudo service apache2 restart


You can restart server by following command

sudo systemctl restart apache2

Hope this will work for you

Not the answer you're looking for? Browse other questions tagged or ask your own question.