Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

imagecreatefromjpeg as undefined function

Status
Not open for further replies.

JRBeltman

IS-IT--Management
Feb 5, 2004
290
NL
when running my PhP script on my hosting provider's server it tells me that the imagecreatefromjpeg() function is undefined.

How can this be resolved by the host?
The system is running under apache and latest PhP version.

JR
As a wise man once said: To build the house you need the stone.
Back to the Basics!
 
The image*() functions are not turned on by default. Even if some are available, not all will necessarily be available, depending on the libraries available on the system and the PHP compile-time options used.

Run a script which consists of:

<?php
phpinfo();
?>

and look for a section called "gd". If there is not one, image*() functions will not be available. If it is, you can get some idea what parts of the function family are available.

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Hi sleipnir214,

what would be the consequences of switching both
extension=php_gd.dll
extension=php_gd2.dll
on in the config?

Would this create a conflict?

Cheers

JR
As a wise man once said: To build the house you need the stone.
Back to the Basics!
 
From PhPInfo:

GD Support enabled
GD Version bundled (2.0.28 compatible)
GIF Read Support enabled
GIF Create Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled

Still the php script tells me:
Fatal error: Call to undefined function: imagecreatefromjpeg() in /home/c8519x/ on line 41

However the script works without problems on my local PhP installation (windows based).

What else can be wrong?

JR
As a wise man once said: To build the house you need the stone.
Back to the Basics!
 
Use of both libraries at once would create a conflict.

Your script should tell you that imagecreatefromjpeg() isn't available. My phpinfo() output contains a line in the "gd" section that reads:


JPG Support enabled


You simply don't have JPEG support available in your current PHP installation.

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Thanks,
I did just notice that as well,
most likely a mistake when compiling the module.

Thanks for your help.



JR
As a wise man once said: To build the house you need the stone.
Back to the Basics!
 

Just use imagecreatefrompng() seeing as that is enabled.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top