Error: The uploaded file exceeds the upload_max_filesize directive in php.ini [duplicate]

You need to make changes in the PHP configuration file (php.ini).

For example, if you are working on a local server and using XAMPP, you can access this file in two ways:

  • Open the XAMPP application and go to Apache > Config > PHP (php.ini)

  • Or open the XAMPP installation folder, usually at C:\xampp, and you can find the file at php\php.ini.

Once you open the file, search for upload_max_filesize and increase the limit value to something that you prefer, like 80M (that will be a maximum size of 80Mb).

If you are using a local server on a Mac, there will be a similar process of finding the php.ini file of your PHP installation and changing the limit in the same way.

This error usually occurs for local PHP installations and that is why I referred to them here. If you have this error on an online server, then again, you need to find a way to edit the php.ini file of your server.