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 Blockchain technology will change online and offline gambling

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 backup your Linux files to a Minio storage server using CloudBerry Backup

Subscribe to LinuxBSDos.com

Subscribe to receive the latest articles in your Inbox

I agree to have my personal information transfered to MailChimp ( more information )

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

Please share:

We Recommend These Blockchain Conferences and Servicess

Register now for Blockchain & Decentralized Tech SuperSummit, international conference on blockchain technnology in Dallas, TX (USA), October 30 - November 2, 2018

Learn how to trade cryptocurrencies profitably using technical and fundamental analysis at BDT SuperSummit

Best binary auto trading software reviews by 7binaryoptions.com

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 *

*