Community Forums

PHP Warning: imagecopyresampled()

General support for technical problems with OpenCart v1.x

PHP Warning: imagecopyresampled()

Postby madfish » Thu Feb 21, 2013 7:53 pm

Hello,

my server crashes all of sudden with this error : Warning: mysql_connect(): Too many connections in /home/profumino/public_html/system/database/mysql.php on line 6 Error: Could not make a database connection using root@localhost Warning: mysql_close() expects parameter 1 to be resource, boolean given in /home/profumino/public_html/system/database/mysql.php on line 67

In the opencart log i find this (the error comes every 30seconds ) :


2013-02-22 1:15:24 - PHP Warning: imagecopyresampled() expects parameter 2 to be resource, null given in /home/profumino/public_html/system/library/image.php on line 87
2013-02-22 1:15:24 - PHP Warning: imagedestroy() expects parameter 1 to be resource, null given in /home/profumino/public_html/system/library/image.php on line 88
2013-02-22 1:15:53 - PHP Warning: imagecopyresampled() expects parameter 2 to be resource, null given in /home/profumino/public_html/system/library/image.php on line 87
2013-02-22 1:15:53 - PHP Warning: imagedestroy() expects parameter 1 to be resource, null given in /home/profumino/public_html/system/library/image.php on line 88
2013-02-22 1:16:10 - PHP Warning: imagecopyresampled() expects parameter 2 to be resource, null given in /home/profumino/public_html/system/library/image.php on line 87
2013-02-22 1:16:10 - PHP Warning: imagedestroy() expects parameter 1 to be resource, null given in /home/profumino/public_html/system/library/image.php on line 88
2013-02-22 1:16:10 - PHP Warning: imagecopyresampled() expects parameter 2 to be resource, null given in /home/profumino/public_html/system/library/image.php on line 87
2013-02-22 1:16:10 - PHP Warning: imagedestroy() expects parameter 1 to be resource, null given in /home/profumino/public_html/system/library/image.php on line 88
2013-02-22 1:16:24 - PHP Warning: imagecopyresampled() expects parameter 2 to be resource, null given in /home/profumino/public_html/system/library/image.php on line 87
2013-02-22 1:16:24 - PHP Warning: imagedestroy() expects parameter 1 to be resource, null given in /home/profumino/public_html/system/library/image.php on line 88
2013-02-22 1:16:56 - PHP Warning: imagecopyresampled() expects parameter 2 to be resource, null given in /home/profumino/public_html/system/library/image.php on line 87
2013-02-22 1:16:56 - PHP Warning: imagedestroy() expects parameter 1 to be resource, null given in /home/profumino/public_html/system/library/image.php on line 88
2013-02-22 1:17:20 - PHP Warning: imagecopyresampled() expects parameter 2 to be resource, null given in /home/profumino/public_html/system/library/image.php on line 87
2013-02-22 1:17:20 - PHP Warning: imagedestroy() expects parameter 1 to be resource, null given in /home/profumino/public_html/system/library/image.php on line 88



What should I do ??? Thank you.
My fragrance parfum site profumi
madfish
 
Posts: 42
Joined: Thu Dec 03, 2009 7:49 am

Re: PHP Warning: imagecopyresampled()

Postby JAY6390 » Thu Feb 21, 2013 8:19 pm

They are two unrelated issues, though the second may inadvertently be caused by the first. The first is pretty simple. Your server can't handle the number of requests to MYSQL meaning your database is overloaded with connections. If you're on a shared server this is pretty common. The second error is because your image likely doesn't exist, possibly because the image name can't be retrieved from the database as a result of the mysql error
ImageImageImage

SEO MEGA KIT PLUS - Get your site ranking higher in the search engines
Better Product SEO URL's - Perfectly structured product links
SEO URL's Route Editor - Fix all of your index.php links


Image
User avatar
JAY6390
 
Posts: 4921
Joined: Wed May 26, 2010 10:47 am
Location: United Kingdom

Re: PHP Warning: imagecopyresampled()

Postby madfish » Thu Feb 21, 2013 8:30 pm

Thank your for your answer. Well I dont use a shared server, but a VPS.

Yes I understand, but the problem started 3 hours ago, until than it worked fine. Is there anyone able to take a look ? I will pay for the service of course.
My fragrance parfum site profumi
madfish
 
Posts: 42
Joined: Thu Dec 03, 2009 7:49 am

Re: PHP Warning: imagecopyresampled()

Postby JAY6390 » Thu Feb 21, 2013 8:36 pm

It appears your traffic is causing the mysql error and there's little other than configuration or a better server that will accomodate this. If you have a host that offers tech support, I would recommend you contact them first to see if they can fix the issue as it may even be a problem with the server
ImageImageImage

SEO MEGA KIT PLUS - Get your site ranking higher in the search engines
Better Product SEO URL's - Perfectly structured product links
SEO URL's Route Editor - Fix all of your index.php links


Image
User avatar
JAY6390
 
Posts: 4921
Joined: Wed May 26, 2010 10:47 am
Location: United Kingdom

Re: PHP Warning: imagecopyresampled()

Postby cheepnis » Thu Apr 04, 2013 5:57 am

I've been getting a lot of the second errors, but no issues with mysql. This seems to be during an image resize function, based upon the code that triggers it. Any ideas?

PHP Warning: imagecopyresampled() expects parameter 2 to be resource, null given in /home/renamed/public_html/store/system/library/image.php on line 109
PHP Warning: imagedestroy() expects parameter 1 to be resource, null given in /home/renamed/public_html/store/system/library/image.php on line 110
User avatar
cheepnis
 
Posts: 44
Joined: Thu Feb 14, 2013 2:56 pm

Re: PHP Warning: imagecopyresampled()

Postby cheepnis » Fri May 03, 2013 8:44 pm

I think I found the problem. This function cannot handle BMG image files. File was converted to jpg and the problem seems to have gone away. 8)
User avatar
cheepnis
 
Posts: 44
Joined: Thu Feb 14, 2013 2:56 pm

Re: PHP Warning: imagecopyresampled()

Postby Thales3 » Sun Oct 06, 2013 3:51 am

I get the same errors :
...PHP Warning: imagecopyresampled() expects parameter 1 to be resource, null given in...
...PHP Warning: imagecopyresampled() expects parameter 2 to be resource, null given in...
but i don't have any file with BMP extension.
Any ideea how to solve this ?
Thales3
 
Posts: 32
Joined: Fri Sep 20, 2013 9:58 am

Re: PHP Warning: imagecopyresampled()

Postby butte » Mon Oct 07, 2013 12:33 am

You can check images' integrities locally before sending them up (initially or after testing) by using badpeggy ( http://download.cnet.com/Bad-Peggy/3000 ... 91203.html and https://github.com/coderslagoon/BadPeggy among others). It was useful in reviewing images in context of a bad feed at viewtopic.php?f=20&t=110435&p=439018#p439018 .
butte
 
Posts: 7212
Joined: Tue Mar 19, 2013 5:58 pm


Return to General Support

Who is online

Users browsing this forum: Majestic-12 [Bot], vapestore, vitalyk and 63 guests

Hosted by Arvixe Web Hosting