Welcome ,
  1. Home
  2. How to increase PHP Upload Limit

PageCarton Documentation



Interested in coding widgets, classes, or methods? Check out the Code section!

How to increase PHP Upload Limit


Image

Sometimes, one may need to upload a large file and if there is a limit in the PHP Configuration, you may not be able to use your PageCarton installation to upload large file. An example is if you want to upload a large theme, you may need to tweak your server settings to make this possible.

By default, the maximum upload file size for PHP scripts is set to varying sizes. Sometimes it is set to as large as 128MB, sometimes, 2MB. However, you may want to change these limits. For example, you can set a lower limit to prevent users from uploading large files to your site. To do this, change the upload_max_filesize and post_max_size directives in your php.ini file.

In some cases, default server settings may not let you upload larger files via your website. To increaes file upload size in PHP, you need to modify the upload_max_filesize and post_max_size variable’s in your php.ini file. This tutorial shows how to increase PHP upload limit in PageCarton by locating the PHP.ini file and updating it accordingly.

  1. Login to your PageCarton Admin Panel. Usually a link like http://www.example.com/pc-admin should take you to the PageCarton Admin Panel if your website is powered by PageCarton. Don't forget to change www.example.com to your real domain name if you are coying and pasting.
  2. Navigate to Server Info and Configuration Page. The option should be under the System Settings in the PageCarton Admin Panel.

  3. On the pop-up screen, look for the section where it says "Loaded Configuration File", then chech the corresponding filename to the PHP.ini file being used for the PageCarton installation.

  4. Locate this file in your file explorer, the file path differs from installation to installation, in this example, we are using MAMP Server on Mac. Your installation or operating system may have this path pointing to a different location

  5. Open this file in a Code Editor. Any text editor could work fine but using a code editor like Notepad++ , or VSCode is recommended because of their advanced features. The mission is to change some configuration set in this file.

  6. Locate the part of the text document concerned and change to a preffered value. The following items should have values above the file sizes you want to upload. For example set to 200M to allow uploads up to 200M. For example update file to have the variables to reflect the following
    upload_max_filesize = 128M
    
    post_max_size = 128M
    memory_limit = 128M
    The concerned items are:
    1. upload_max_size
      Sets the max size total uploaded file can be
    2. post_max_size
      The variable post_max_size which is used to set the maximum size of POST data that PHP will accept. Setting a value of 0 disables the limit.
    3. memory_limit
      Sets the limit to the memory available to your application. This also can affect your upload limit
  7. When you are done updating this file to high values dependng on your case, save the file
  8. Restart PHP web service and Web Server. If you don't know how to do this, just reboot the server and start the server as usual.

By default, PHP file upload size is set to maximum 2MB file on most servers, but you can increase or decrease the maximum size of file upload using the PHP configuration file (php.ini), this file can be found in different locations on different OS distributions. Hope this has been resolved with this article.

 

 

← Previous "A Step By Step Guide To Back up and Downloading your Website on PageCarton.""Setting up PageCarton via Docker" Next →


 

Similar article

 

How to Backup and Restore on PageCarton Photo

How to Backup and Restore on PageCarton

Backing up your PageCarton website helps protect your data against mistakes, server issues, hacking, or accidental deletion. A proper backup allows you to restore your website quickly if anything g...

article
 

 

Multi-Site Manager on PageCarton Photo

Multi-Site Manager on PageCarton

The Multi-Site Manager in PageCarton allows you to manage multiple websites from a single PageCarton installation. With the Multi-Site Manager, each site can have its theme, content, and setting...

article
 

 

How to Create a Form on PageCarton Photo

How to Create a Form on PageCarton

Forms on PageCarton allow you to collect information from website visitors, such as contact details, inquiries, or feedback. Follow the steps below to create a form on your PageCarton website. S...

article
 

 

Creating of Pages on PageCarton Photo

Creating of Pages on PageCarton

Step 1: Log in to the PageCarton Admin Panel 1.     Open your browser. 2.     Visit https://yourdomain.com/pc-admin (For local installation: http://lo...

article
 

 

How to add posts on PageCarton Photo

How to add posts on PageCarton

PageCarton makes it easy to create and publish posts such as blog articles, news updates, or announcements on your website. Follow the simple steps below to add a post successfully. Step 1: Log ...

article
 

 

How to Use Access Level Widgets to Control Content Visibility in PageCarton Photo

How to Use Access Level Widgets to Control Content Visibility in PageCarton

This article explains how to use PageCarton's Access Level Widgets to control content visibility based on user roles, such as content owners, invited users, or administrators. It helps ensure t...

article