Solved

Fatal error: Allowed memory size of 33554432 bytes exhausted ?

Posted on 2013-06-11
3
1,426 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

770 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