masterexploder / PHPThumb

PHP Thumbnail & Image Manipulation Library
http://phpthumb.gxdlabs.com
980 stars 264 forks source link

Cannot show image, headers have already been sent #94

Open srikanttowakel opened 11 years ago

srikanttowakel commented 11 years ago

All the images that are being resized using adaptiveResize are not displaying anymore. Site: www.pr-property.com

Error getting from Chrome: Fatal error: Uncaught exception 'RuntimeException' with message 'Cannot show image, headers have already been sent' in /home/prprop1m/public_html/phpthumb/GdThumb.inc.php:569 Stack trace: #0 /home/prprop1m/public_html/en/cropSquare100.php(48): GdThumb->show() #1 {main} thrown in /home/prprop1m/public_html/phpthumb/GdThumb.inc.php on line 569

They used to display. Kindly tell me what you need to troubleshoot.

Thanks, Srikant

srikanttowakel commented 11 years ago

Locallly, I am using WAMP and it is OK. When uploading to server, then they do not display.

julioaze commented 11 years ago

Hi srikanttowakel. You solved this problem? I have the same problem in my website, but no found solutions help me, please.

cbabos commented 11 years ago

Hi,

try this: delete the ?> sign from your php file (at the end). I think you have an empty line at the end of your php script.

Upd.: please check all of the included files in the session.

If this doesn't help, then please compare the settings on your local machine, and on the server.

On 2013.09.17., at 14:58, julioaze notifications@github.com wrote:

Hi srikanttowakel. You solved this problem? I have the same problem in my website, but no found solutions help me, please.

— Reply to this email directly or view it on GitHub.

julioaze commented 11 years ago

Hi cbabos. Thanks for reply. Unfortunately, not work for me :(

cbabos commented 11 years ago

Is there any difference in the local config and the server config?

julioaze commented 11 years ago

Locally it works perfect. I do not have access to the server settings.

cbabos commented 11 years ago

But you can see the PHP settings with phpinfo(); :)

On 2013.09.17., at 15:29, julioaze notifications@github.com wrote:

Locally it works perfect. I do not have access to the server settings.

— Reply to this email directly or view it on GitHub.

cbabos commented 11 years ago

Is your phpThumb cache directory writeable on the server?

julioaze commented 11 years ago

Yes! The directory CHMOD is 755

julioaze commented 11 years ago

On the server was working normally, then the images disappeared

cbabos commented 11 years ago

In this case, there must be a change in the configuration of the server (i think). I have no exact idea what is it, so it's up to you to experiment with it. Sorry. :(

srikanttowakel commented 11 years ago

Hi, Yes solved the problem partially. First thing i did was to rebuild the server. But the issue appeared again. Then i noticed that there was a "error.log" thing file on the directory. I had to delete all these files, mainly in the phpthump directory and the images appeared again.

Hope this helps.

Srikant

On Tue, Sep 17, 2013 at 4:58 PM, julioaze notifications@github.com wrote:

Hi srikanttowakel. You solved this problem? I have the same problem in my website, but no found solutions help me, please.

— Reply to this email directly or view it on GitHubhttps://github.com/masterexploder/PHPThumb/issues/94#issuecomment-24585782 .

cbabos commented 11 years ago

I think, that the phpthumb cache directory has another user:group owner than the user:group owner of the apache process. Maybe that is the change. If this is the situation, then the 755 rights isn't enough because the cache directory isn't writeable by the server. If the images disappear again try the full 777 rights. If this helps, then make sure, that the cache dir is created by the apache itself.

If this is the case, then it's not a problem with the phpThumb code, it's simply a server config issue. Hope this helps

On 2013.09.17., at 21:37, srikanttowakel notifications@github.com wrote:

Hi, Yes solved the problem partially. First thing i did was to rebuild the server. But the issue appeared again. Then i noticed that there was a "error.log" thing file on the directory. I had to delete all these files, mainly in the phpthump directory and the images appeared again.

Hope this helps.

Srikant

On Tue, Sep 17, 2013 at 4:58 PM, julioaze notifications@github.com wrote:

Hi srikanttowakel. You solved this problem? I have the same problem in my website, but no found solutions help me, please.

— Reply to this email directly or view it on GitHubhttps://github.com/masterexploder/PHPThumb/issues/94#issuecomment-24585782 .

— Reply to this email directly or view it on GitHub.

julioaze commented 11 years ago

Hello and thanks again for the answers. Srikant, I did just that. Deleted the error.log from the server, the images appeared, but then disappeared again. Cbabos, the folders have permission 777, but not solved too.

cbabos commented 11 years ago

Try to enable the debug mode (fully enable, so log messages are shown), and look at the content of error.log There must be some clue, or hint what the problem is.

On 2013.09.17., at 22:04, julioaze notifications@github.com wrote:

Hello and thanks again for the answers. Srikant, I did just that. Deleted the error.log from the server, the images appeared, but then disappeared again. Cbabos, the folders have permission 777, but not solved too.

— Reply to this email directly or view it on GitHub.

julioaze commented 11 years ago

message on log in phpthumb folder:

Uncaught exception 'RuntimeException' with message 'Cannot show image, headers have already been sent' in /home/odontoes/public_html/thumb/GdThumb.inc.php:569 Stack trace:

0 /home/odontoes/public_html/thumb/thumb.php(16): GdThumb->show()

1 {main}

thrown in /home/odontoes/public_html/thumb/GdThumb.inc.php on line 569

messagem on log in thumb_plugins folder

PHP Fatal error: Class 'PhpThumb' not found in /home/odontoes/public_html/thumb/thumb_plugins/gd_reflection.inc.php on line 179

srikanttowakel commented 10 years ago

it can be also because of memory of the virtual server hosting the website.

On Wed, Sep 18, 2013 at 12:16 AM, julioaze notifications@github.com wrote:

message on log in phpthumb folder:

Uncaught exception 'RuntimeException' with message 'Cannot show image, headers have already been sent' in /home/odontoes/public_html/thumb/GdThumb.inc.php:569 Stack trace:

0 /home/odontoes/public_html/thumb/thumb.php(16): GdThumb->show()

1 https://github.com/masterexploder/PHPThumb/issues/1 {main}

thrown in /home/odontoes/public_html/thumb/GdThumb.inc.php on line 569

messagem on log in thumb_plugins folder

PHP Fatal error: Class 'PhpThumb' not found in /home/odontoes/public_html/thumb/thumb_plugins/gd_reflection.inc.php on line 179

— Reply to this email directly or view it on GitHubhttps://github.com/masterexploder/PHPThumb/issues/94#issuecomment-24618625 .

workzentre commented 10 years ago

scan your "thumb" directory for all "error_log" files or "_notes" directories, and delete them. In my case I had an error_log file at the thumb_plugins, as soon as I deleted it it worked on the remote side.

I came to this because there was no reason why it whould work differently localy and remotely, the only difference was these files.

Good Luck

ir3nicus commented 9 years ago

Hi, I have similar problem. I used PHPThumb on other serwer (it worked properly then and on localhost). Now I am trying to migrate whole portal to another hosting (vps on digitalocean). I've installed Ubuntu (php version 5.5.9-1ubuntu4.9), I installed gd php library too. When I execute a php script that should display image, this empty square is being shown (as on attached screenshoot): link

HillbillyGeek commented 6 years ago

I also have this: It does sound like a config issue. on a new install locally, the thumbnailer will work for a while and then quit. I drop a new copy of the core files in and replace the old ones and the problem goes away. (GdThumb.inc.php PhpThumb.inc.php thumb_plugins { gd_reflection.inc.php gd_watermark.inc.php } ThumbBase.inc.php ThumbLib.inc.php)