When you set up a new server with CloudPages your default PHP upload limits are low. Users need to increase those limits so that they can import large databases or upload large themes/plugins inside WordPress. In this article, I will show you how to increase PHP upload limits on CloudPages.
To change or increase upload limits you need to access your server’s SSH through Putty or Bitvise.
For this article, we choose Bitvise, open Betvise SSH client, provide the User Name, IP, and port of your server.
You can also add the public key to your server for passwordless authentication, however, in this article, we use password authentication but in the production environment, I recommend using key-based authentication for security reasons.
Once you have added the required data click on the Login button.
After some time you will successfully be logged in, you can see the terminal and SFTP window on the sidebar click on the New SFTP window.
Goto to Remote file section, and go to /home/yourwebsitediectory/public_html, here create a new file info.php.
Now you can paste the following code into the info.php file and save it.
<?php
phpinfo();
?>
Once you have saved the file, open the https://websiteurl.com/info.php into your browser, you can see the following page. On this page check the location of Loaded Configuration File, here the php.ini file path is given, now you can open /usr/local/lsws/lsphp73/etc/php/7.X/litespeed/php.ini (path in your case can be different depending upon PHP version) via Bitvise and change your memory limits.
Now move to /usr/local/lsws/lsphp73/etc/php/7.x/litespeed/ location on SFTP. you can see the php.ini file is shown, right-click on it and then click on edit.
The file is opened in a default text editor, you can search the following parameters and update the value according to your choice and save it.
post_max_size: (this must be usually higher than upload_max_filesize)
upload_max_filesize: to increase the upload limit.
Once you update these configurations you need to kill all PHP processes.
Access your server terminal and run this command:
killall lsphp
Once you did the whole procedure, your upload limits are successfully updated.
Go to the info.php page and check the changed limits.