Problems, need help? Have a tip or advice? Post it here.
10 posts Page 1 of 1
Hi,

I have built a website for a client, and when I try to edit pages that I can upload images, if I select an image from the library or if I upload a new one, and click "SAVE", it sends me to an error page (HTTP ERROR 500).
But if I edit text and other content, and click SAVE, it will work fine.
It seems to be linked with images. I can upload images just fine, and I see them in the library (file manager) just fine too.
But it's only when I click on the SAVE button that it shows me an error page HTTP ERROR 500.

My clients server is an Apache cPanel / PHP 5.6 / MySQL 5.1.73

Any ideas?

I tried checking permissions for upload folder and it's fine. Also deleted htaccess files from the main couch folder, and the one in the upload folder (I've seen some people saying this might help), but no luck.

Thanks a lot
Please try taking a look at your web-server's error log - it should show the exact cause behind the 500 error.
I have looked at a "error log" file on the server, and it's only describing memory limit issues, but it's all errors that happened last week, and I got these 500 error this week.

Is there anything else I can do to fix this? Thanks!
I think the 'memory limit' could explain the problem.
Look, what happens upon page-save is that all uploaded images are 'processed' according to the specified width and height parameters of the type 'image' editable regions.

This processing is likely to use a lot of memory and a lack of which can lead to the error.

Please try increasing the amount available to your PHP and let me know if it helps.
Thanks KK, my clients cannot change this setting by himself in the cPanel, but he will ask his hosting provider to change it.
I will come back here once it's done and tell you if that worked.
Thanks
The memory limit has been more than doubled, and it's still not working.
Any ideas why?
Is there any file I can upload to my clients server to see if everything is compatible with Couchcms?

Thanks
Can you get me access to the site?
Please PM me the FTP+Couch super-admin creds is that is fine.
Do make sure to mention the specific template where I can get to experience this problem first-hand.
Sure!
Sent :)

Thanks a lot
Any news?
Or maybe there's someone here that knows how to fix this? My client cannot import photos to his website and I seriously have no idea why. Thanks!
Sorry couldn't take a look at the issue any earlier.
Did that just a while back and found the issue to be this -

The error log mentioned
PHP Fatal error: Call to undefined function k_resize_image()

This 'k_resize_image' function is defined in 'couch/includes/timthumb.php' so I had to take a look if this file was somehow corrupt or incomplete in your installation.

Upon browsing the 'includes' folder, I found that the 'timthumb.php' file in there was of size '0 bytes'.
Also found that the original file that ships with Couch had been renamed to 'timthumb.php.orig' and all its permissions removed to prevent it form executing.

You can take a look at the mentioned folder to see what I mean.

OK, so that would explain the problem with images you have been experiencing.
What remains unexplained is who or what caused this renaming of the original timthumb.php file.

My hunch is that your over-zealous web-host (or even perhaps the 'Suhosin' PHP-hardening mod active on your server) did this own their own accord in a bid to 'neutralize' a perceived security threat that was discovered in the timthumb library (used by Wordpress and many other scripts) several years back.

In actuality, the version of timthumb that ships with Couch is a heavily modded version and never suffered from this security vulnerability. So, this kind of "throwing the baby out with the bathwater" action is totally unnecessary.

Anyway, I think if you were to replace the 0 byte file with the one from Couch's installation zip, that would rectify the error.
I, however, did not do that myself because I fear that your host (or any security process running over there) would go ahead and 'neutralize' it yet again leaving us back on square one.

Perhaps you should take this topic up with your host?

Hope this helps.
10 posts Page 1 of 1