lost jpeg functionality

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Simon Redmond

    lost jpeg functionality

    my hosting provider just upgraded the server and now some of my scripts
    don't work....

    Fatal error: Call to undefined function: imagecreatefrom jpeg()

    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


  • Matthias Esken

    #2
    Re: lost jpeg functionality

    "Simon Redmond" <noreply@sibass .com> schrieb:
    [color=blue]
    > my hosting provider just upgraded the server and now some of my scripts
    > don't work....
    >
    > Fatal error: Call to undefined function: imagecreatefrom jpeg()
    >
    > should I look for something specific in the output from phpinfo()???[/color]

    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

    Comment

    • Simon Redmond

      #3
      Re: lost jpeg functionality

      not there any more
      cheers will get onto the provider tomorrow
      "Matthias Esken" <muelleimer2003 nospam@usenetve rwaltung.org> wrote in
      message news:bpe8ki.1lg .1@usenet.esken .de...[color=blue]
      > "Simon Redmond" <noreply@sibass .com> schrieb:
      >[color=green]
      > > my hosting provider just upgraded the server and now some of my scripts
      > > don't work....
      > >
      > > Fatal error: Call to undefined function: imagecreatefrom jpeg()
      > >
      > > should I look for something specific in the output from phpinfo()???[/color]
      >
      > 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[/color]


      Comment

      • Shawn Wilson

        #4
        Re: lost jpeg functionality

        Simon Redmond wrote:[color=blue]
        >
        > not there any more
        > cheers will get onto the provider tomorrow
        > "Matthias Esken" <muelleimer2003 nospam@usenetve rwaltung.org> wrote in
        > message news:bpe8ki.1lg .1@usenet.esken .de...[color=green]
        > > "Simon Redmond" <noreply@sibass .com> schrieb:
        > >[color=darkred]
        > > > my hosting provider just upgraded the server and now some of my scripts
        > > > don't work....
        > > >
        > > > Fatal error: Call to undefined function: imagecreatefrom jpeg()
        > > >
        > > > should I look for something specific in the output from phpinfo()???[/color]
        > >
        > > 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().[/color][/color]

        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_exist s()), 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
        shawn@glassgian t.com

        Comment

        • Shawn Wilson

          #5
          Re: lost jpeg functionality

          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. imagecreatefrom jpeg):

          function warn_function ($funname) {
          if (!function_exis ts($funname)):
          ?>
          <div align = "center"><d iv 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 <shawn@glassgia nt.com>";
          $subject = "Website functions not working.";
          $headers = "From: VeoWeb Hosting <shawn@glassgia nt.com>\nX-Priority: 1";
          $message = "Some functions are not working. Please check out immediately.\n\ n";

          $functionlist = array(
          "imagecreatefro mjpeg",
          "imagecreatefro mpng",
          "imagecreat e",
          "imagecopyresiz ed",
          "imagecopy" ,
          "imagejpeg" ,
          "imagepng",
          "imagecreatetru ecolor",
          "fopen",
          "mysql_quer y",
          "filesize",
          "mysql_conn ect"
          );

          sort ($functionlist) ;

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

          foreach($functi onlist as $var) {
          if (function_exist s($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($notwor ks) > 0)
          mail($email, $subject, $message . $notworks . "\n" . $works . "\n\nBuild
          Date: $builddate\n\nE xecution time: " .
          ($endtime - $starttime) . " sec", $headers);
          echo "DONE";
          ?>




          [color=blue]
          > 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" <shawn@glassgia nt.com>
          > Newsgroups: comp.lang.php
          > Sent: Wednesday, November 19, 2003 1:38 PM
          > Subject: Re: lost jpeg functionality
          >[color=green]
          > > Simon Redmond wrote:[color=darkred]
          > > >
          > > > not there any more
          > > > cheers will get onto the provider tomorrow
          > > > "Matthias Esken" <muelleimer2003 nospam@usenetve rwaltung.org> wrote in
          > > > message news:bpe8ki.1lg .1@usenet.esken .de...
          > > > > "Simon Redmond" <noreply@sibass .com> schrieb:
          > > > >
          > > > > > my hosting provider just upgraded the server and now some of my[/color][/color]
          > scripts[color=green][color=darkred]
          > > > > > don't work....
          > > > > >
          > > > > > Fatal error: Call to undefined function: imagecreatefrom jpeg()
          > > > > >
          > > > > > 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().[/color]
          > >
          > > My host keeps doing this to me. For some reason they don't build GD into[/color]
          > PHP[color=green]
          > > whenever they do a rebuild (every few months). In the past it's taken up[/color]
          > to 2[color=green]
          > > weeks for me to notice that the scripts aren't working. I've asked them[/color]
          > to[color=green]
          > > email me when they make changes to the server, so I can make sure my[/color]
          > scripts[color=green]
          > > still work. They never do. So I now use IF (function_exist s()), with an[/color]
          > array[color=green]
          > > of functions I need. If the function doesn't exist, a nicely-formatted[/color]
          > error[color=green]
          > > message is displayed on the screen explaining that my host has made[/color]
          > changes[color=green]
          > > 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[/color]
          > shortly. I[color=green]
          > > put similar code into a cron job that runs every half hour. If the[/color]
          > functions[color=green]
          > > don't exist, I get an email. You might want to consider doing this. I[/color]
          > wish I'd[color=green]
          > > done it a year ago.
          > >
          > > Regards,
          > > Shawn
          > > --
          > > Shawn Wilson
          > > shawn@glassgian t.com
          > > http://www.glassgiant.com[/color][/color]


          --
          Shawn Wilson
          shawn@glassgian t.com

          Comment

          • Shawn Wilson

            #6
            Re: lost jpeg functionality

            Shawn Wilson wrote:[color=blue]
            >
            > 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. imagecreatefrom jpeg):
            >
            > function warn_function ($funname) {
            > if (!function_exis ts($funname)):
            > ?>
            > <div align = "center"><d iv 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 <your@emailaddr ess.com>";
            > $subject = "Website functions not working.";
            > $headers = "From: Hosting <your@emailaddr ess.com>\nX-Priority: 1";
            > $message = "Some functions are not working. Please check out immediately.\n\ n";
            >
            > $functionlist = array(
            > "imagecreatefro mjpeg",
            > "imagecreatefro mpng",
            > "imagecreat e",
            > "imagecopyresiz ed",
            > "imagecopy" ,
            > "imagejpeg" ,
            > "imagepng",
            > "imagecreatetru ecolor",
            > "fopen",
            > "mysql_quer y",
            > "filesize",
            > "mysql_conn ect"
            > );
            >
            > sort ($functionlist) ;
            >
            > $works = "";
            > $notworks = "";
            > $builddate = "";
            >
            > foreach($functi onlist as $var) {
            > if (function_exist s($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($notwor ks) > 0)
            > mail($email, $subject, $message . $notworks . "\n" . $works . "\n\nBuild
            > Date: $builddate\n\nE xecution time: " .
            > ($endtime - $starttime) . " sec", $headers);
            > echo "DONE";
            > ?>
            >[color=green]
            > > 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" <shawn@glassgia nt.com>
            > > Newsgroups: comp.lang.php
            > > Sent: Wednesday, November 19, 2003 1:38 PM
            > > Subject: Re: lost jpeg functionality
            > >[color=darkred]
            > > > Simon Redmond wrote:
            > > > >
            > > > > not there any more
            > > > > cheers will get onto the provider tomorrow
            > > > > "Matthias Esken" <muelleimer2003 nospam@usenetve rwaltung.org> wrote in
            > > > > message news:bpe8ki.1lg .1@usenet.esken .de...
            > > > > > "Simon Redmond" <noreply@sibass .com> schrieb:
            > > > > >
            > > > > > > my hosting provider just upgraded the server and now some of my[/color]
            > > scripts[color=darkred]
            > > > > > > don't work....
            > > > > > >
            > > > > > > Fatal error: Call to undefined function: imagecreatefrom jpeg()
            > > > > > >
            > > > > > > 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[/color]
            > > PHP[color=darkred]
            > > > whenever they do a rebuild (every few months). In the past it's taken up[/color]
            > > to 2[color=darkred]
            > > > weeks for me to notice that the scripts aren't working. I've asked them[/color]
            > > to[color=darkred]
            > > > email me when they make changes to the server, so I can make sure my[/color]
            > > scripts[color=darkred]
            > > > still work. They never do. So I now use IF (function_exist s()), with an[/color]
            > > array[color=darkred]
            > > > of functions I need. If the function doesn't exist, a nicely-formatted[/color]
            > > error[color=darkred]
            > > > message is displayed on the screen explaining that my host has made[/color]
            > > changes[color=darkred]
            > > > 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[/color]
            > > shortly. I[color=darkred]
            > > > put similar code into a cron job that runs every half hour. If the[/color]
            > > functions[color=darkred]
            > > > don't exist, I get an email. You might want to consider doing this. I[/color]
            > > wish I'd[color=darkred]
            > > > done it a year ago.[/color][/color][/color]

            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
            shawn@glassgian t.com

            Comment

            Working...