Support » Plugin: Crop-Thumbnails » 500 Internal Server Error when Cropping after domain change!

  • Resolved vasco.eduardo


    Hey there I am using the Plugin for a while and everything worked very good till today. But now I have a problem.

    I did a Domain change and for that I copied the whole Instalation to a new folder and did a DB copy to. After setting everything up the Site(Copy) is up again and working (nearly)perfect. If I want to crop a Thumbnail the image isn’t saved correctly. I activated “JS-Debug” and “Daten-Debug” to see what the problem might be and my JS Console gives me this error:

    Post 500 Internal Server Error

    Cache-Control	no-cache, must-revalidate, max-age=0
    Connection	close
    Content-Length	0
    Content-Type	text/html; charset=UTF-8
    Date	Tue, 12 Nov 2013 23:57:06 GMT
    Expires	Wed, 11 Jan 1984 05:00:00 GMT
    Pragma	no-cache
    Server	Apache/2.2.16 (Debian) PHP/5.2.17 mod_ssl/2.2.16 OpenSSL/0.9.8o
    X-Powered-By	PHP/5.2.17
    X-Robots-Tag	noindex
    x-content-type-options	nosniff
    x-frame-options	SAMEORIGIN
    Accept	*/*
    Accept-Encoding	gzip, deflate
    Accept-Language	de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
    Content-Length	921
    Content-Type	application/x-www-form-urlencoded; charset=UTF-8
    Cookie	wordpress_4ddc84a6d8ad2e446cb8f80be165a8a7=administrator%7C1384463400%7C1878c413f7025a84553deead699d0416; __atuvc=68%7C46; wordpress_test_cookie=WP+Cookie+check; wordpress_logged_in_4ddc84a6d8ad2e446cb8f80be165a8a7=administrator%7C1384463400%7C1b7d36024292e5e70fca1eaebc36d45f; wp-settings-1=editor%3Dhtml%26ed_size%3D955%26hidetb%3D1%26libraryContent%3Dbrowse%26align%3Dleft%26imgsize%3Dfull%26urlbutton%3Dnone%26wplink%3D1; wp-settings-time-1=1384290601
    User-Agent	Mozilla/5.0 (Windows NT 6.2; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0
    X-Requested-With	XMLHttpRequest

    hope somebody can give me a hint what the problem might be?!?


Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Volkmar Kantor


    A domain- or even directory-change is always problematic for wordpress. Cause the system and much plugins inserts server or url related variables into the db.

    For my personal use i write a small script to rename all locations where the old domain/directory name occurred. But there should be a few plugins that do the same job well. I transferred nearly every WP-Installation before going live at least once (sometimes twice) and didn’t get a problem.

    As far as i know, i didn’t use any url-specific-path-variables in the plugin (that may cause the error).

    You may try: upload a new image and crop it

    • if it works you had anywhere a problem with the path of your images
    • if it dosent work you may have a problem with file permissions or server requirements

    So, does it work?


    I copied the Folder via shell access with all the file permissions and ownerships:

    cp -R -a old-folder/ new-folder/

    so I think file permissions or server requirements(same server) should not be a Problem.

    After that I copied the Database and did this commands to update the URLs:

    UPDATE wp_options SET option_value = REPLACE(option_value, 'http://devdomain.local', '') WHERE option_value NOT LIKE '%{%';
    UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, 'http://devdomain.local', '') WHERE meta_value NOT LIKE '%{%';
    UPDATE wp_posts SET guid = REPLACE(guid, 'http://devdomain.local', '');

    Today I installed a Plugin for Updating URLs ( used it. In fact it found some more entries with the old Path and changed them.

    But the Problem is still there. I uploaded a new Image and I still can not crop it?!? Any more ideas?

    Plugin Author Volkmar Kantor


    where does the message appear? After you click “crop-image” or even on the when the lightbox is openend (no display of the croping area)?

    Is that the only log you get from the console?

    Plugin Author Volkmar Kantor


    Also try: go to settings and “resave” the crop-thumbnail settings.


    in the moment I click “crop-image” the Error

    Post 500 Internal Server Error

    appers in my JS Console
    I allready tried “resave” the crop-thumbnail settings. No change?!? 🙁

    Now I also used this tool:

    Database Search and Replace Script in PHP

    And it changed some 112 more entries in the DB(all the resting serialized PHP strings I think)… Now no evidence of the Old Domain can be found in the DB and the Problem still exists!?!

    Plugin Author Volkmar Kantor


    than there has to be a problem with the server functions. But i can not debug from here.

    It seems you are fit with programming, so if you want, we may debug the code that causes the problem.
    Go open plugins/crop-thumbnails/functions/save.php

    First: Insert the following code on line 32
    echo 'END';die();

    Second: Click on crop and check the console


    • If there is still the Server-Response 500: clear the code you inserted and write it in a few lines earlier. Go To First Step.
    • If there is another error: clear the code you inserted and write it in a few lines later. Go To First Step.

    Post the Line-Number, that causes the Server Response 500.



    first of all Thanks for the great support!

    I did what you said and the Server Response 500 is caused in line 111
    the if codition:

    if(!@copy($result,$_filepath)) {

    seems to cause the problem!


    Plugin Author Volkmar Kantor


    Hi vasco,
    i think we can accelerate this if we communicate directly.
    You find my email in the top comment of “crop-thumbnails.php” or on

    See you.

    Plugin Author Volkmar Kantor


    So we found the problem.

    On the server the php was running in safe mode. After it turned of the problem disappear. I am not very familiar with this setting but i assume that it blocks some kind of file access reading or writing on the server.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘500 Internal Server Error when Cropping after domain change!’ is closed to new replies.