Tutorials/Tips

Editing php.ini file in VestaCP for upload_max_filesize exceeded error

VestaCP is an open core Web hosting control panel similar to cPanel. It’s a popular replacement for cPanel when you don’t want to pay cPanel’s monthly fee. I actually use it to host several websites on Vultr but perform most of the system management from the command line.

This short article shows how to edit the php.ini file to fix the upload_max_filesize exceeded error that’s usually encountered when one attempts to upload a file whose size exceeds that allowed by PHP. That error should be very familiar to users of WordPress, because that was what I was using when I encountered the error shown in the image below.

Error uploading huge file in WordPress

Though the error message tells you what directive to modify and the file to find it in, it doesn’t tell you what directory the file is in. I can tell you that if you’re using CentOS 7, the same Linux distribution that powers my server, you’ll find the file under the /etc directory.

Related Post:  How to enable two-factor authentication on Dropbox

By default, the value of that directive is 2M, that is, 2 MB. Since the file I was trying to upload was 3.3 MB, I only needed to give the directive a higher value and restart Apache. How I went about it is shown in the following code block. By this time you know that I first had to log into the server by SSH. I manage the server from the command line using the root account and not sudo, so sudo is not used in the following commands:

After Apache has been restarted, you may try uploading the file again. That fixed it for me. Did not need to modify any other directive.

Related Post:  How to send bulk email to your students using R

Subscribe to LinuxBSDos.com

Subscribe to receive the latest articles in your Inbox

Trust me, you'll not be spammed...

Please share:

We Recommend These Vendors and Free Offers

Google has got competition, because Presearch is building a blockchain-based search engine controlled by the community. At $0.15 a token, you can participation in Lot 3 of the token sale by clicking here

Open Money is building a solution that will run mainstream software on blockchain tech. Click here to get free tokens that will be the digital currency of the platform

COMSA allows centralized businesses to adopt blockchain technology. The token sale starts soon! Sign up for free by clicking here

Register now for Blockchain & Cryptocurrency Con 2018, international conference on blockchain technnology in Dallas, TX (USA), Feb. 23-24, 2018. Students can register at a 50% discount.

Launch an SSD VPS in Europe, USA, Asia & Australia on Vultr's KVM-based Cloud platform starting at $5:00/month (15 GB SSD, 768 MB of RAM).


Leave a Comment

Your email address will not be published. Required fields are marked *

*