Solved

Fatal error: Allowed memory size of 33554432 bytes exhausted ?

Posted on 2013-06-11
3
1,418 Views
Last Modified: 2013-06-11
Hi,
I have a PHP script that allows the upload and conversion of photos to jpeg and works fine on one server but not on another.

I have VPS hosting and wanted to know if there is a setting I can change via cPanel/WHM


Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 3168 bytes) in /home/mywebsite/public_html/admin/add_upd_item.php on line 111

$tempFile = $_FILES['image1']['tmp_name'];      
line 111---> $image = imagecreatefromjpeg($tempFile);

Thanks

Andrew
0
Comment
Question by:sabecs
  • 2
3 Comments
 
LVL 11

Expert Comment

by:Paul S
ID: 39239720
I had the same problem. There is a memory limit that you exceed. Only upload smaller images or get more memory resources allocated to your account.
0
 
LVL 11

Expert Comment

by:Paul S
ID: 39239722
PHP imagecreatefromjpeg fails due to memory limit.
http://www.paulscomputerservice.net/articles/article.php?ID=63
0
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 39239724
You could just add into that upload page as the first line
ini_set('memory_limit', '64M');

Or increase as necessary
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now