Jump to content

Regenerate thumbnails => 500 Internal Server Error


Gekko

Recommended Posts

Greetings

Unfortunately I decided to click on the "Regenerate thumbnails" and all my pictures are gone and I get a "Internal Server Error" in backend after trying. So after some look in the forum and help from my support I have created a php5.ini file with the following changes:

max_execution_time = 3000
max_input_time = 600
max_input_nesting_level = 64
memory_limit = 128M

and I also tested these changes with a phpinfo file and it works... But regenerating the thumbnails still wont work, still "Internal Server Error"....

Any other suggestion?

  • Like 1
Link to comment
Share on other sites

turn php error logging on in your php.ini and see what errors occurs.

It could also be security on the server. I have had issues (other stuff) with the suhosin patch, this can be turned to monitor only via the php.ini, effectively turns it off.

you can find these settings on google, if you cannot find them post here and i will dig them out as i do not have them to hand.

shoulders

Link to comment
Share on other sites

this sounds like folder permissions

there are 2 ways a server can be setup. with suphp/suexec and without. both require different permissions to execute scripts and write files etc.

so set these following folders to 755 (for with suphp/suexec) and if that doesnt work try 777 (for without)

/img/
/img/admin/
/img/c/
/img/co/
/img/l/
/img/m/
/img/os/
/img/p/
/img/s/
/img/scenes/
/img/su/
/img/t/
/img/tmp/

you might not need to do all folders in /img/ but it wont harm.

Link to comment
Share on other sites

Thanks for the reply. My folders are all 755. I tried resetting them to 777 but no luck. Still the 500 error. The strange thing for me was that it was all working fine. In this case I think it all went wrong after I deleted one of the image sizes but I'm not sure. Previously I had a problem where I couldn't upload product images at all without getting an error. That had also started out fine and was fixed by a fresh installation, but I can't just keep reinstalling every time something goes wrong :-(

p.s. another strange thing is that each time I get the error after clicking the 'regenerate thumbnails' button, it deletes only the second half of my list of thumbnails and leaves the rest (which I think were products added the day before) intact.

p.p.s. update - this may be something to do with timing out as indicated in the first post. I just deleted the 'scenes' thumbnails that I'm not using and that managed to squeeze out the generation of one more set of thumbnails before it gave up. This would explain why it worked before - there were fewer products, hence less work to do.

Anything that can be done about that on shared hosting? I don't have access to php.ini.

Link to comment
Share on other sites

it does sound like a timeout issue or server resource thing. here are a few things to do.

1. find out, does 1and1 support php.ini overide, if it does you could try the settings at the top of this post, basically copy the global php file and alter the settings mentioned at the top of this thread. this file is then put in your root of your www folder. one thing to note, the changes might not be applied instantly. could be 15 - 60 mins, it all varies.

2. find out, does 1and1 support suphp/suexec if not get another host, the script might be having issues with files it cannot delete because it does not own them.

3. you could create a copy of your website on your local PC with xammp (google it) and then run thumbnail regeneration and upload the results. a few people do this and timeouts etc are a lot easier to deal with and change.

4. delete all uneeded image sizes in image preferences and use the original pictures for the thickbox see the link below for instructions
http://www.prestashop.com/forums/viewthread/36250/

5. if your can turn on php error reporting and look in the log file you might find the solution there, also your control panel might let you see the server error log which is also worth a look.

6. it could be the suhosin security patch (hard PHP) installed on some servers, this can be effectively turned off by putting it into monitor mode via the php.ini

Try these and see where you get.

shoulders

Link to comment
Share on other sites

Thank you for all interesting suggestions, some more symptoms of the problem:

Actually a couple of pictures are being recreated, let's say 10% so I don't think this is a folder permission problem.

Now my PHP5 value error_reporting is set to 1 so it should be logging the problem? Maybe I should turn on error_log as well, or where does this info turn up? On my server and in my control-panel I only found some access logs so far...

Keep up the good work everyone :-)

Link to comment
Share on other sites

Gekko that's the same scenario as me, although as I don't have that big a catalogue and the images uploaded weren't very big to start with, It's getting about 60% of the way through before quitting. It sounds like you have the same issue as me, which is nothing to do with permissions and almost certainly to do with the process taking too long. Unfortunately I haven't yet managed to change max_execution_time in my setup, although it looks like it is possible.

Link to comment
Share on other sites

Gekko that's the same scenario as me, although as I don't have that big a catalogue and the images uploaded weren't very big to start with, It's getting about 60% of the way through before quitting. It sounds like you have the same issue as me, which is nothing to do with permissions and almost certainly to do with the process taking too long. Unfortunately I haven't yet managed to change max_execution_time in my setup, although it looks like it is possible.


local php.ini, you can overide it with this. if not your server people have php.ini overide turned off.
Link to comment
Share on other sites

Well I did managed to override some settings with php.ini but probably I need to change more, here is my PHPinfo file at the moment if someone clever would like to take a look and make a guess:

http://www.breathcatchers.com/shop/phpinfo.php

Of course I would also like to get the error reporting in order, should I turn on the error_log as well to get more info on the table?

@goosedesign, did you ask your hosting support how to change php.ini. There are some difference between the companies so just ask them right away ;-) In my case I had to make a php5.ini file, otherwise it would be for php4 etc.

Link to comment
Share on other sites

  • 4 weeks later...
  • 5 weeks later...

I cannot even begin to fathom the amount of stress that this is causing me. I've literally been trying to get this to work for the past 6 hours, but I haven't a clue. How do I find my php.ini file? Can I use a .htaccess file instead? Where abouts do I position that? I've discussed this with "Just Host" and they simply do not have a clue, their support is a total waste of time. I just want to regenerate my images so that they appear again - But I get a Internal 500 error. Can someone even point me n the direction of doing it manually in Photoshop using the batch feature, how would I go about doing this?

I'd be so grateful if someone could help me.

Thank you.

Link to comment
Share on other sites

  • 2 months later...

I wanted to change the product image size, so unaware of what will happen I clicked on "Regenerate thumbnails"... And I've got same error as most of you... My shop is now without images and I'm totally depressed with this unsolvable problem... Probably I'll throw my computer out of window and go hang myself :(

Link to comment
Share on other sites

The only thing that I could do was to manually replace every image that disappeared, which took me forever. Just don't expect any solutionsfrom any other forum members or Prestashop staff. So many topics and questions seems to go unanswered here, so it's mostly pointless in my opinion. There's very little use in boasting how many forum members you have when the majority of them don't want to help!

/rant

Link to comment
Share on other sites

Don't quote me on this but it may be timing out due to a feature within PHP. If you get in contact with your host you can tell them to increase the allowed time before it decides to time out. Maybe someone who's more technical can explain that better, but it's another option before doing it manually.

Link to comment
Share on other sites

  • 3 weeks later...
Don't quote me on this but it may be timing out due to a feature within PHP. If you get in contact with your host you can tell them to increase the allowed time before it decides to time out.


Guys, this is probably exactly what is happening here. If you cannot access your php.ini file via ftp or SSH (due to web hosting restrictions) then you will need to ask them to do it for you, and allow scripts to run longer before them timing out on you. Shared hosts tend to lock this down a bit for security so you may not have the privilege of playing with this file which controls the server behavior and restrictions.

The only other option I am aware of is to generate the thumbs on a local copy (local development environment) of the site, so it does not time out on you, and then upload these to the live server.
This is a faff and we should not have to do it.... but if you got a live store with no thumbnails in it... you may have to resort to this method!

Try the packages WAMP or MAMP on mac if you want to setup a local development environment. If you are playing with your store alot then you should always be doing it locally anyhow and then when tested upload the changes to live.

Cheers,
Link to comment
Share on other sites

Yes, the "Regenerate thumbnails" feature didn't work for lots of images in Prestashop v1.2.5 and earlier. This feature has been improved in v1.3 though. You can now choose to regenerate individual image types and sizes. Also, Prestashop now detects when it is approaching the PHP maximum execution time then automatically stops regenerating thumbnails and allows you to resume regenerating thumbnails.

Link to comment
Share on other sites

  • 9 months later...
  • 7 months later...

Hi, thought I would share. I use this feature and lost all my thumbnails. Good thing the original images were still there 800 over of them. Can't imagine if I have to go thru the whole uploading process. It will be a nightmare.

 

Then I decided to take one step at a time. I regenerated them individually. Format by format.

 

Under "Select Image" I chose Products

Under "Select Format" I chose one format at a time to regenerate.

 

Then I unchecked the "Erase previous images"

Clicked "Regenerate" and prayed.

 

It worked!!!

All the images were regenerated batch by batch one format at a time without any loss.

 

Thank God :)

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...