Hi,
I need to upgrade from php4 to php5 on godaddy.

I tried it last night to see what would happen.

First error I found was that the require_once ('Mail.php') statement failed - so there is some sort of setup I guess I need to do. However I do not remember doing anything previously in php4.

Can anybody help me?

Thanks,
John.

    It would help to know what the exact error message was, and possibly also the lines of code involved.

      Hi,
      the error was...

      <b>Warning</b>: require_once(Mail.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in <b>/home/content/j/o/h/johnbuhladmin/html/10directnew/sendupdatecodeinmailsingle.php</b> on line <b>6</b><br />
      <br />
      <b>Fatal error</b>: require_once() [<a href='function.require'>function.require</a>]: Failed opening required 'Mail.php' (include_path='.:/usr/local/php5/lib/php') in <b>/home/content/j/o/h/johnbuhladmin/html/10directnew/sendupdatecodeinmailsingle.php</b> on line <b>6</b>

      the code is... line 6 is the require_once('Mail.php'); line

      <?php
      // Send mail with the code for easy update

      require_once('Mail.php');
      require_once('Mail/mime.php');

      // email address of the recipient
      $to = $email;

      // email address of the sender

        It's looking for the file "Mail.php" and not finding it, so the question is, where is that file? (And the succeeding question will likely be where is the file it tries to require in the next line.)

        My guess is that your previous PHP configuration had an "include_path" setting that pointed to the directory where those files are, so you either need to replicate that setting in the new config, or if running on an Apache server (which last I heard were the only ones GoDaddy had PHP5 on), you could specify it in a .htaccess file.

          That's beyond me, I'm afraid. I'll try the GoDaddy support and see if I get anywhere.
          Thanks.
          John.

            6 months later

            Did you ever resolve this? Only I have just run into the same problem. When I run the script in my browser it can find mail.php and mail/mime.php but ehn I run it from a cron job it can't. I don't know enough about Apache and Linux to know how to write the correct path.

              possiblyB9;10903882 wrote:

              Did you ever resolve this? Only I have just run into the same problem. When I run the script in my browser it can find mail.php and mail/mime.php but ehn I run it from a cron job it can't. I don't know enough about Apache and Linux to know how to write the correct path.

              A script run via cron is probably running under the command line interface, which does not necessarily have the same config/environment as the web interface. You could correct the include path directly in the script. The simplest thing might be to run this script as a web page:

              <?php
              echo get_include_path();
              

              Then in your cron script, copy-and-paste the output from the above into a set_include_path() at the start of the script:

              <?php
              set_include_path('.;C:\wamp\bin\php\php5.2.6\PEAR;c:\wamp\www\include');
              // . . . rest of script . . .
              
                Write a Reply...