By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,806 Members | 1,490 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,806 IT Pros & Developers. It's quick & easy.

lost jpeg functionality

P: n/a
my hosting provider just upgraded the server and now some of my scripts
don't work....

Fatal error: Call to undefined function: imagecreatefromjpeg()

What do I need to look for in order to make sure I still have this
functionality, version is php 4.3.3
should I look for something specific in the output from phpinfo()???

Thanks for all your help
Jul 17 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
"Simon Redmond" <no*****@sibass.com> schrieb:
my hosting provider just upgraded the server and now some of my scripts
don't work....

Fatal error: Call to undefined function: imagecreatefromjpeg()

should I look for something specific in the output from phpinfo()???


Yes. Look at the configure command There should be a '--with-gd'
somewhere in the configuration line. More information about the
configuration of gd should be some blocks down in the phpinfo().

Regards,
Matthias
Jul 17 '05 #2

P: n/a
not there any more
cheers will get onto the provider tomorrow
"Matthias Esken" <mu******************@usenetverwaltung.org> wrote in
message news:bp**********@usenet.esken.de...
"Simon Redmond" <no*****@sibass.com> schrieb:
my hosting provider just upgraded the server and now some of my scripts
don't work....

Fatal error: Call to undefined function: imagecreatefromjpeg()

should I look for something specific in the output from phpinfo()???


Yes. Look at the configure command There should be a '--with-gd'
somewhere in the configuration line. More information about the
configuration of gd should be some blocks down in the phpinfo().

Regards,
Matthias

Jul 17 '05 #3

P: n/a
Simon Redmond wrote:

not there any more
cheers will get onto the provider tomorrow
"Matthias Esken" <mu******************@usenetverwaltung.org> wrote in
message news:bp**********@usenet.esken.de...
"Simon Redmond" <no*****@sibass.com> schrieb:
my hosting provider just upgraded the server and now some of my scripts
don't work....

Fatal error: Call to undefined function: imagecreatefromjpeg()

should I look for something specific in the output from phpinfo()???


Yes. Look at the configure command There should be a '--with-gd'
somewhere in the configuration line. More information about the
configuration of gd should be some blocks down in the phpinfo().


My host keeps doing this to me. For some reason they don't build GD into PHP
whenever they do a rebuild (every few months). In the past it's taken up to 2
weeks for me to notice that the scripts aren't working. I've asked them to
email me when they make changes to the server, so I can make sure my scripts
still work. They never do. So I now use IF (function_exists()), with an array
of functions I need. If the function doesn't exist, a nicely-formatted error
message is displayed on the screen explaining that my host has made changes
again, screwed up the server and the script will no longer work. It also
mentions that I have been notified and the problem will be remedied shortly. I
put similar code into a cron job that runs every half hour. If the functions
don't exist, I get an email. You might want to consider doing this. I wish I'd
done it a year ago.

Regards,
Shawn
--
Shawn Wilson
sh***@glassgiant.com
http://www.glassgiant.com
Jul 17 '05 #4

P: n/a
Simon Redmond wrote:

Hi,

I call this function where I want a warning message to go, with the name of the
function required (i.e. imagecreatefromjpeg):

function warn_function ($funname) {
if (!function_exists($funname)):
?>
<div align = "center"><div class = "warn" align = "left">
This script is not working right now. The most likely cause is my host,
<a href="http://www.veoweb.net" class =
"warn" target = "_blank">VeoWeb.net</a>, messing something up on the server
(it's happened often enough for me to put i
n this automated warning). I have been notified by email that it's not working
and will strive to fix it quickly.
</div>&nbsp;</div>
<?PHP
endif;
}
The following script mails me if something one or more functions in
$functionlist suddenly stops working. It tells me when the build date was and
lists the functions that don't work. It's set to run every half hour.

<?PHP
/*

Check to see if functions are working that have a history of not working after
Veoweb makes changes.

*/

$starttime = explode (" ", microtime());
$starttime = $start_time[1] + $start_time[0];

$email = "Shawn Wilson <sh***@glassgiant.com>";
$subject = "Website functions not working.";
$headers = "From: VeoWeb Hosting <sh***@glassgiant.com>\nX-Priority: 1";
$message = "Some functions are not working. Please check out immediately.\n\n";

$functionlist = array(
"imagecreatefromjpeg",
"imagecreatefrompng",
"imagecreate",
"imagecopyresized",
"imagecopy",
"imagejpeg",
"imagepng",
"imagecreatetruecolor",
"fopen",
"mysql_query",
"filesize",
"mysql_connect"
);

sort ($functionlist);

$works = "";
$notworks = "";
$builddate = "";

foreach($functionlist as $var) {
if (function_exists($var))
$works .= "Function \"$var\" works.\n";
else
$notworks .= "Function \"$var\" does not work.\n";
}

ob_start();
phpinfo();
$string = ob_get_contents();
ob_end_clean();

$string = explode("\n", $string);

foreach($string as $var) {
$var = strip_tags($var);
if (preg_match("/^Build Date\s+([A-Za-z]+ [0-9]+ [0-9]+
[0-9]+:[0-9]+:[0-9]+).+$/", $var)) {
$var = preg_replace("/^Build Date\s+([A-Za-z]+ [0-9]+ [0-9]+
[0-9]+:[0-9]+:[0-9]+)[^0-9]?.*$/", "\$1", $
var);
$builddate = $var;
break;
}
}

$endtime = explode (" ", microtime());
$endtime = $start_time[1] + $start_time[0];

if (strlen($notworks) > 0)
mail($email, $subject, $message . $notworks . "\n" . $works . "\n\nBuild
Date: $builddate\n\nExecution time: " .
($endtime - $starttime) . " sec", $headers);
echo "DONE";
?>


Hope you don't mind me contacting off board....

I'd be real interested in see how you achieved that..... don't want your
script per say.... just how you did it....

Thats if you don't mind : )
Simon
----- Original Message -----
From: "Shawn Wilson" <sh***@glassgiant.com>
Newsgroups: comp.lang.php
Sent: Wednesday, November 19, 2003 1:38 PM
Subject: Re: lost jpeg functionality
Simon Redmond wrote:

not there any more
cheers will get onto the provider tomorrow
"Matthias Esken" <mu******************@usenetverwaltung.org> wrote in
message news:bp**********@usenet.esken.de...
> "Simon Redmond" <no*****@sibass.com> schrieb:
>
> > my hosting provider just upgraded the server and now some of my scripts > > don't work....
> >
> > Fatal error: Call to undefined function: imagecreatefromjpeg()
> >
> > should I look for something specific in the output from phpinfo()???
>
> Yes. Look at the configure command There should be a '--with-gd'
> somewhere in the configuration line. More information about the
> configuration of gd should be some blocks down in the phpinfo().


My host keeps doing this to me. For some reason they don't build GD into

PHP
whenever they do a rebuild (every few months). In the past it's taken up

to 2
weeks for me to notice that the scripts aren't working. I've asked them

to
email me when they make changes to the server, so I can make sure my

scripts
still work. They never do. So I now use IF (function_exists()), with an

array
of functions I need. If the function doesn't exist, a nicely-formatted

error
message is displayed on the screen explaining that my host has made

changes
again, screwed up the server and the script will no longer work. It also
mentions that I have been notified and the problem will be remedied

shortly. I
put similar code into a cron job that runs every half hour. If the

functions
don't exist, I get an email. You might want to consider doing this. I

wish I'd
done it a year ago.

Regards,
Shawn
--
Shawn Wilson
sh***@glassgiant.com
http://www.glassgiant.com

--
Shawn Wilson
sh***@glassgiant.com
http://www.glassgiant.com
Jul 17 '05 #5

P: n/a
Shawn Wilson wrote:

Simon Redmond wrote:

Hi,

I call this function where I want a warning message to go, with the name of the
function required (i.e. imagecreatefromjpeg):

function warn_function ($funname) {
if (!function_exists($funname)):
?>
<div align = "center"><div class = "warn" align = "left">
This script is not working right now. The most likely cause is my host,
<a href="http://www.veoweb.net" class =
"warn" target = "_blank">VeoWeb.net</a>, messing something up on the server
(it's happened often enough for me to put i
n this automated warning). I have been notified by email that it's not working
and will strive to fix it quickly.
</div>&nbsp;</div>
<?PHP
endif;
}

The following script mails me if something one or more functions in
$functionlist suddenly stops working. It tells me when the build date was and
lists the functions that don't work. It's set to run every half hour.

<?PHP
/*

Check to see if functions are working that have a history of not working after
Veoweb makes changes.

*/

$starttime = explode (" ", microtime());
$starttime = $start_time[1] + $start_time[0];

$email = "Your Name <yo**@emailaddress.com>";
$subject = "Website functions not working.";
$headers = "From: Hosting <yo**@emailaddress.com>\nX-Priority: 1";
$message = "Some functions are not working. Please check out immediately.\n\n";

$functionlist = array(
"imagecreatefromjpeg",
"imagecreatefrompng",
"imagecreate",
"imagecopyresized",
"imagecopy",
"imagejpeg",
"imagepng",
"imagecreatetruecolor",
"fopen",
"mysql_query",
"filesize",
"mysql_connect"
);

sort ($functionlist);

$works = "";
$notworks = "";
$builddate = "";

foreach($functionlist as $var) {
if (function_exists($var))
$works .= "Function \"$var\" works.\n";
else
$notworks .= "Function \"$var\" does not work.\n";
}

ob_start();
phpinfo();
$string = ob_get_contents();
ob_end_clean();

$string = explode("\n", $string);

foreach($string as $var) {
$var = strip_tags($var);
if (preg_match("/^Build Date\s+([A-Za-z]+ [0-9]+ [0-9]+
[0-9]+:[0-9]+:[0-9]+).+$/", $var)) {
$var = preg_replace("/^Build Date\s+([A-Za-z]+ [0-9]+ [0-9]+
[0-9]+:[0-9]+:[0-9]+)[^0-9]?.*$/", "\$1", $
var);
$builddate = $var;
break;
}
}

$endtime = explode (" ", microtime());
$endtime = $start_time[1] + $start_time[0];

if (strlen($notworks) > 0)
mail($email, $subject, $message . $notworks . "\n" . $works . "\n\nBuild
Date: $builddate\n\nExecution time: " .
($endtime - $starttime) . " sec", $headers);
echo "DONE";
?>
Hope you don't mind me contacting off board....

I'd be real interested in see how you achieved that..... don't want your
script per say.... just how you did it....

Thats if you don't mind : )
Simon
----- Original Message -----
From: "Shawn Wilson" <sh***@glassgiant.com>
Newsgroups: comp.lang.php
Sent: Wednesday, November 19, 2003 1:38 PM
Subject: Re: lost jpeg functionality
Simon Redmond wrote:
>
> not there any more
> cheers will get onto the provider tomorrow
> "Matthias Esken" <mu******************@usenetverwaltung.org> wrote in
> message news:bp**********@usenet.esken.de...
> > "Simon Redmond" <no*****@sibass.com> schrieb:
> >
> > > my hosting provider just upgraded the server and now some of my

scripts
> > > don't work....
> > >
> > > Fatal error: Call to undefined function: imagecreatefromjpeg()
> > >
> > > should I look for something specific in the output from phpinfo()???
> >
> > Yes. Look at the configure command There should be a '--with-gd'
> > somewhere in the configuration line. More information about the
> > configuration of gd should be some blocks down in the phpinfo().

My host keeps doing this to me. For some reason they don't build GD into

PHP
whenever they do a rebuild (every few months). In the past it's taken up

to 2
weeks for me to notice that the scripts aren't working. I've asked them

to
email me when they make changes to the server, so I can make sure my

scripts
still work. They never do. So I now use IF (function_exists()), with an

array
of functions I need. If the function doesn't exist, a nicely-formatted

error
message is displayed on the screen explaining that my host has made

changes
again, screwed up the server and the script will no longer work. It also
mentions that I have been notified and the problem will be remedied

shortly. I
put similar code into a cron job that runs every half hour. If the

functions
don't exist, I get an email. You might want to consider doing this. I

wish I'd
done it a year ago.


I probably should have mentioned: ;o)

IF ANYONE USES THIS SCRIPT, PLEASE CHANGE THE EMAIL ADDRESSES _BEFORE_ YOU
TEST!!!

I am receiving emails telling me functions aren't working.

Thanks,
Shawn
--
Shawn Wilson
sh***@glassgiant.com
http://www.glassgiant.com
Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.