XF 2.2 problems with GD Image AND Imagemagick!

zoldos

Well-known member
I haven't noticed this until recently (but hadn't uploaded a large pic yet, so I don't know).

Anyway, when Imagemagick PECL extension is selected in Admin --> Attachments (and it does show it as enabled on both XF Admin and my cPanel), animated GIFs work properly when posted in a thread, but, I cannot upload image attachments larger than say less than 1MB (after the upload on large files gets to 100%, I just see a blank placeholder). But, if I select PHP built-in GD image library (PHP 8.1.18), animated GIFs stop working, and then, large images can be uploaded (with thumbnails, etc).

Very strange! I disabled image proxy and tried it, and got the same result regardless of that setting.

Max attachment uploads are set to 12MB.

This seems rather specific, and I don't get any server errors. Does anyone have any idea what could be wrong? Thanks!
 
Hmm...that didn't seem to help, thanks tho! After further testing, I found that whenever I upload an image of say 7MB, as soon as it finishes uploading, the RAM memory usage for my site jumps to 1G used out of 1G, and then the upload errors out (Opps....we had a problem) or there is simply no thumbnail as if the upload didn't process (using ImageMagick). Like I said, larger NON-image files upload normally.

I switched back to PHP GD, and it works great (almost no RAM use at all), I just then can't post animated GIFs. It looks like a regular pic. But, if I click the image, it opens a lightbox where it is animated.

Very strange. Anyone have any ideas? @Brogan
 
Hmm...that didn't seem to help, thanks tho! After further testing, I found that whenever I upload an image of say 7MB, as soon as it finishes uploading, the RAM memory usage for my site jumps to 1G used out of 1G, and then the upload errors out (Opps....we had a problem) or there is simply no thumbnail as if the upload didn't process (using ImageMagick). Like I said, larger NON-image files upload normally.

I switched back to PHP GD, and it works great (almost no RAM use at all), I just then can't post animated GIFs. It looks like a regular pic. But, if I click the image, it opens a lightbox where it is animated.

Very strange. Anyone have any ideas? @Brogan
are you using imagick?

Code:
[@localhost]# php -m
[PHP Modules]
...
imagick
...
 
Have you tried raising PHP memory_limit?
Yes, I put it to 1G, as well as 1G max uploads, and 1G max post size. It still didn't work. I am only allocated 1GB physical memory if that makes a difference. I talked back and forth with my host, and they can't figure it out. They finally said it might be a XF issue. My official support has expired tho. :(
 
Yes, I put it to 1G, as well as 1G max uploads, and 1G max post size. It still didn't work. I am only allocated 1GB physical memory if that makes a difference. I talked back and forth with my host, and they can't figure it out. They finally said it might be a XF issue. My official support has expired tho. :(
No it's a server issue, especially if it's cpanel related. Do you have any logs? You'd think some error would be captured but it's a long time since I've used any control panels.
 
So it’s a 7MB image - what are the image’s actual dimensions in pixels?
This is VERY important... one can easily exceed memory limits based upon pixel size normally as the actually processing requirements in IM of the image are WELL in excess of what the image size is normally.... but if all settings are at 1GB, then it's got to be a gigantic (pixel wise) image.

@zoldos, have you checked your <policy domain="system" name="max-memory-request" value="256MiB"/> setting in your IM policy.xml to see if it is too low? The default is 256MiB as shown).
 
Last edited:
No it's a server issue, especially if it's cpanel related. Do you have any logs? You'd think some error would be captured but it's a long time since I've used any control panels.
I don't have direct access to the server logs. My host does (obviously) and they found several things, but were not able to find an exact cause. :(
 
So it’s a 7MB image - what are the image’s actual dimensions in pixels?
5152 x 3864

This is VERY important... one can easily exceed memory limits based upon pixel size normally as the actually processing requirements in IM of the image are WELL in excess of what the image size is normally.... but if all settings are at 1GB, then it's got to be a gigantic (pixel wise) image.

@zoldos, have you checked your <policy domain="system" name="max-memory-request" value="256MiB"/> setting in your IM policy.xml to see if it is too low? The default is 256MiB as shown).
Where is policy.xml located? See the rez above. GD works fine, but like I said, now animated GIFs don't animate unless you open them in a lightbox. lol
 
I don't have access to that (I can only SFTP to my root folder), since I'm on shared. I will mention it to my host support tho. Thanks!
This is most likely is going to be the big issue. Processing a large image via IM can get somewhat intensive.. so it may not be completing the process due to limitations that the shared hosting provider has set on each instance. Just because you can set a certain memory setting doen't mean that's what you are granted.
 
This is most likely is going to be the big issue. Processing a large image via IM can get somewhat intensive.. so it may not be completing the process due to limitations that the shared hosting provider has set on each instance. Just because you can set a certain memory setting doen't mean that's what you are granted.
Agreed. I can go back to fully dedicated with root access, and tonnes more resources for the same price as their shared "Ultra" plan. bangs head

I've also been going back and forth with their support and all they've done first was increase PHP max memory, which I've already tried, and now claim it's because ImageMagick doesn't work correctly with PHP 8.1
 
Agreed. I can go back to fully dedicated with root access, and tonnes more resources for the same price as their shared "Ultra" plan. bangs head

I've also been going back and forth with their support and all they've done first was increase PHP max memory, which I've already tried, and now claim it's because ImageMagick doesn't work correctly with PHP 8.1
I know at one point, IM wasn't working with PHP 8.1 due to the extension, but I thought that had been resolved? It may be on the hosting setup that it's specific to.
As for dedicated, you will have a lot more control over it. I don't know if you require a panel (cPanel, etc) but if you are comfortable with CLI, then you may (if you go with VPS/dedicated) want to look at CentOS 7 and CentMin Mod.
 
I actually prefer Plesk Obsidian.

Anyway, I tried it with PHP 8.0, and PHP 7.4, and it did the same exact thing.... :(

I'm just going to go back to dedicated. I know it isn't XF, and my host's support is lacking!
 
If you're going to dedicated and want to use EOL stuff like php 7.4, you might rather want to have a look at Almalinux 8.x since you can use them on Alma 8 and Centos 7 is going EOL next year. Alma 8 at least has security support until 2029.
Or Debian so you can do major OS upgrades when needed, supported by the OS itself (not 3rd party).
 
I actually prefer Plesk Obsidian.

The nice thing about CentOS and CentMin is how "lean" it is, allowing more resources for your site.
The other good thing is there is a migration path from CentOS 7 to AlmaLinux 8, which when @eva2000 releases the BETA of CentMin to the public for it (which will probably be around when CentOS 7 goes EOL at the latest) you can easily move forward into a supported environment.
There is a limited BETA of CentMin for AlmaLinux out right now, but as I said, it's limited, so most can't access it, but using CentOS and then migrating to AlmaLinux later would be a feasible path.
Since I host my transactional email with Amazon SES, having my VPS set up to send/receive mail is not that important, and honestly, just about all your base functions you need to run your sites is contained in the text based CentMin menu.
There are some things you still have to do at CLI level (changes to specific files for customization), but it's not that hard to learn.
 
Last edited:
The nice thing about CentOS and CentMin is how "lean" it is, allowing more resources for your site.
The other good thing is there is a migration path from CentOS 7 to AlmaLinux 8, which when @eva2000 releases the BETA of CentMin to the public for it (which will probably be around when CentOS 7 goes EOL at the latest) you can easily move forward into a supported environment.
There is a limited BETA of CentMin for AlmaLinux out right now, but as I said, it's limited, so most can't access it, but using CentOS and then migrating to AlmaLinux later would be a feasible path.
Since I host my transactional email with Amazon SES, having my VPS set up to send/receive mail is not that important, and honestly, just about all your base functions you need to run your sites is contained in the text based CentMin menu.
There are some things you still have to do at CLI level (changes to specific files for customization), but it's not that hard to learn.
Cool. I plan on using Ubunto 20.04 and the latest PHP (and ImageMagick). I ran the exact same setup before when I had another site, and it was incredible, with plenty of growth potential. :cool:
 
Top Bottom