Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Fatal error: Allowed memory size of 33554432 bytes exhausted ?

Posted on 2013-06-11
3
Medium Priority
?
1,455 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
[X]
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
  • 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 2000 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
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…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

609 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