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:  Wildcard certificates coming to Let's Encrypt January 2018

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 set up a Ruby project structure on Ubuntu 16.10

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

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

Deploy an SSD Cloud server in 55 seconds on DigitalOcean. Built for developers and starting at $5:00/month (20 GB SSD, 512 MB of RAM).

Want to become an expert ethical hacker and penetration tester? Request your free video training course of Online Penetration Testing and Ethical Hacking

Whether you're new to Linux or are a Linux guru, you can learn a lot more about the Linux kernel by requesting your free ebook of Linux Kernel In A Nutshell.


Leave a Comment

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

*