How to increase PHP upload file size directive

How to increase PHP upload file size directive

Many times, trying to upload a file in AppMail for different purposes, like importing a subscriber's CSV list or uploading an email template, you got stuck with this error message:

This means that the maximum allowed file size is 2MB (the default for most of the PHP installations). The file that we were trying to upload had 5MB.

If we go to Backend->Miscellaneous->PHP info we will see this directive setup to 2MB as below:

To change this directive, you should edit your php.ini file and put a higher value. You will find the location of the php.ini file using the info below:

Depending on your PHP version or server configuration, the path of the php.ini will be different.

Now, all you need to do is to edit that file and change the directive value. After the change, we need to restart the web server and/or php-fpm:

NOTE: As you can see in the image above, there are other directives that can prevent you to upload files. Using the same steps, you can change them too if needed.

After you change the value to 108Mb, checking the PHP info in the backend you will see:

Now, our import will start:

NOTE: If the upload still fails after this, you might need to adjust your server to allow uploading larger files.

    • Related Articles

    • Unable to upload file for importing

      When you try to import your subscribers from a text or csv file, sometimes you might get an error like: Your form has a few errors, please fix them and try again! The file "filename.csv" cannot be uploaded. Only files of these MIME-types are allowed: ...
    • How to increase the PHP timeout on VirtualMin

      This can be done on a per domain basis in Virtualmin: Login to Virtualmin. Select the domain in the drop-down box to configure. Click Server Configuration -> Website Options. Change the Maximum PHP script run time value to the new limit in seconds. ...
    • While importing, I get this error - The CRSF token could not be verfied

      This error happens when you try to upload a larger file than your PHP configuration allows. In order to fix this issue, you need to edit your server php.ini file, usually located in /etc/ and increase the upload limit. The 3 directives that you have ...
    • How to add a custom theme for the file manager

      AppMail uses ElFinder as its file manager of choice. While we think the default ElFinder theme looks very good, there are people that look for a different look, and this is why ElFinder supports custom themes. In order to add a custom theme in ...
    • How can I tell AppMail how to use or not to use php’s Tidy extension?

      Please note that the setting from the code also works and has more weight than the one from the web interface, therefore if Tidy is enabled from the code but disabled from the web interface, then it will be disabled, but if it is disabled from the ...