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 "HTML Syntax & API for Embedding Widgets""How to contribute to PageCarton Core" Next →


 

Similar article

 

HTML Syntax & API for Embedding Widgets

In a recent update to be available to the public August 2020, we are adding a completely different way to create and customize PageCarton Themes. In addition to existing ways of creating and customizing themes, you can now customize themes completely from the raw HTML code section using your favorite code editor. Before now, most of the theme layout design functions has been limited to the visual Page Editor in the PageCarton Admin Panel, we noticed that this has proved to be difficul...

article
 

 

PageCarton Admin Panel

The PageCarton Admin Panel is the default control center of PageCarton. While PageCarton is built with privileges from ground up, which allows to customization even from the frontend, the Admin Panel now serves as the control center where all the administative functions can be found in one place. The Admin Panel is a component of PageCarton system that provides the ability to view and change application settings. It consists of a set of widgets that include adding or removing fun...

article
 

 

Contact Messages

[This Article Needs Content]

article
 

 

New Site Wizard

[This Article Needs Content]

article
 

 

File Manager

[This Article Needs Content]

article
 

 

Mailing List

[This Article Needs Content]

article