Customize php.ini in GoDaddy cPanel

Issue

My website is hosted in GoDaddy and I used WordPress. But I encountered an issue, whenever I tried to upload a media file, I’ve got error

File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini.

Analysis

Based on the error message, I could tell it’s the configuration in php.ini file. However, I couldn’t find where the file. Google a few posts they were suggesting GoDaddy cPanel. This is how I found it.

Go to cPanel => Software => PHP

Everything looked normal, file_uploads is ON, upload_max_filesize is 2M

However, when I ran the following command on the host, I got the opposite answer.

$ php -i | grep upload_max_filesize
upload_max_filesize => 2M => 2M
$ php -i | grep file_uploads
file_uploads => Off => Off

So there must be some customized changes to php.ini, but where?

Finally I found the setting in “Select PHP Version”, it’s not only where you switch PHP version but also configure php.ini file!!

The trick the is to open “Switch to PHP Options” on “Select PHP version” page

Now I knew why the upload was disabled and file size is so small

Click on the “OFF” to switch the value to “ON”, click file size to switch to a bigger size. Problem solved!

(Visited 7 times, 1 visits today)

Leave a Reply