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


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 "Installing PageCarton via Composer""Steps in Creating a PageCarton Theme" Next →


Similar article


Installing PageCarton via Composer Photo

Installing PageCarton via Composer

If you have Composer installed on your computer, you can easily get PageCarton up by running the following commands on your command line.  # download PageCarton via composer composer create-project pagecarton/pagecarton --prefer-dist -s dev # go into the project cd pagecarton # set up your web root cp -r pagecarton/core/local_html/* html # start your development server cd html && php -S localhost:8001 With this, you do not need to install any other server. Easy, ...



Setting up PageCarton via Docker Photo

Setting up PageCarton via Docker

PageCarton now has a few files in its GitHub repository that helps to set it up on Docker easily. If you are familiar with Docker or a newbie, you should be able to get started with PageCarton on Docker without stress.  The beauty of working with Docker is that you do not have to worry about setting up your server or configuring it. We have created a few settings in the Docker file to ensure the system will be using a compatible server to run your PageCarton in its container...



Steps in Creating a PageCarton Website Offline Photo

Steps in Creating a PageCarton Website Offline

Creating a website has now been made easy with the use of Pagecarton, it's not necessary to know much about coding. If you have your contents ready, and the style of how your website wants to look, your website creation with pagecarton is as easy as ABC.  For this tutorial, we will be using an offline server called LOCALHOST. After installing your favorite offline server, pagecarton will be needed to install on it so that we can access the pagecarton admin panel locally. If you do...



Steps in Creating a PageCarton Theme Photo

Steps in Creating a PageCarton Theme

Creating a PageCarton theme isn't actually a difficult task, but just that it might involve a long process and a little bit of how programming codes work. The main purpose of having a PageCarton theme is to ensure other users get an easy and fast customization of their own personal websites with the use of the themes(which serve as a template) created by other users. Getting an HTML Template File Download your desired already-designed template file. These kind of templates are most ...



HTML Syntax & API for Embedding Widgets Photo

HTML Syntax & API for Embedding Widgets

In an update to PageCarton that was available from August 2020, we added a new 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 dif...



PageCarton Admin Panel Photo

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...