Can’t upload image to wordpress due to large size

Hi

In my new job I have been working a little bit with cPanel and WordPress. It sounds easy enough and both of the products are easy enough normally. But there is always one of these fun errors that just makes you wonder. What the f*** could be the problem here. Everything seems fine but everything is so wrong.

When the users where going to upload files we changed the upload limit on the PHP server and everything should be working fine. The users should be able to upload files up to 250 MB. At least that was what I was thinking. But no matter what I did I got the following error up: “Post-processing of the image failed. If this is a photo or a large image, please scale it down to 2500 pixels and upload it again”

My picture was below this size and I belive I tried every single solution to this issue I could find on the internet. The only solution that worked for me was the plugin Add from Server, with this plugin I was able to get my pictures to the libary.

After hours of googling and talking to coworkers we suddenly discovered that cPanel is not delivered with mod_fcgid turned on in Apache. This simple feature took me ages to find out. In addition you need to install the imagick module.

imagick you can install in cPanel by go to Software -> Module Installer in the left menu. Manage the PHP PECL and search and install imagick for all needed PHP versions (at least where you run WordPress).

Then you need to enable mod_fcgid. This can be done in Software -> Easy Apache 4 on the left side menu and choose Customize on the menu showing. Now you can go to Apache modules and search for mod_fcgid. When this module is enabled you can try to upload again. Hopefully it works now!

Be aware that the changes done here needs to be done by your hosting provider and unless you have access to the WHM console you need to forward them this article to fix the issues.

Centos 7 with cPanel loose network config

Today I have been struggeling with cPanel. I did install an Centos 7 server with cPanel WHM on it. I followed the instructions from tecmint and it was pretty straight forward! I have to admit, that was my thought all the way until I rebooted the server with an software update.

At firdst I didn’t know what happened. I thought it was a firewall issue etc. But I couldn’t find any issues. When I finally started to check the server more closely I discovereed when running ifconfig that there where no network card configured with the correct IP. I then moved further and tried to restarting the network service with the command:

systemctl restart network.service

When doing this I got an error message :
Job for network.service failed because the control process exited with error code. See “systemctl status network.service” and “journalctl -xe” for details.

Checking “systemctl status network.service” gave me the following error message:

Failed to start LSB: Bring up/down networking.

This led me out on a desperate google search that lasted for a couple of hours. I found alot of articles that could be helpful but none that helped me. Or I did, in the end but it still felt like forever. I had read something similear to the solution below on my google searches. But those articles only said I needed to touch the network file (just create an empty file). But according to the forum post below I needed to add the commands below to /etc/sysconfig/network file.

NETWORKING=yes
GATEWAY=XXX.XXX.XXX.XXX

XXX.XXX.XXX.XXX represent the IP of the gateway for the CentOS server. When the file is edited I did a reboot and it all worked again! 🙂 I tried to restart the network.service but for some reason I had to do a complete reboot for it to work.

Forum post