Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Fatal error: Allowed memory size of 33554432 bytes exhausted ?

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

Suggested Solutions

In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

789 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