Zen Cart Logo
Forums / Upgrading to 1.5.x / Upgrading PHP from Version 4.X To 5.2 isssue with include_once("Mail.php");

Upgrading PHP from Version 4.X To 5.2 isssue with include_once("Mail.php");

Views: 1,840

Results 1 to 2 of 2
31 Aug 2012, 5:15 PM
#1
donn avatar

donn

Zen Follower

Join Date:
Oct 2007
Posts:
241
Plugin Contributions:
0

Upgrading PHP from Version 4.X To 5.2 isssue with include_once("Mail.php");

Hello, all.

Recently, I've been upgrading all of my carts, from various versions, from 1.3.7, to 1.3.8A, to 1.9H.

On my server set to PHP 5.2, almost everything works.

I added a few things that were custom, and porting them to the newer version has me stumped.

One such change sent out mails, but not via the ZENMail functions within the cart. (I had my reason for this!)

But now, I get an error message when trying to use the same statement that worked in PHP 4.X:

include_once("Mail.php");

I now get get this error msg with PHP 5.2:

Warning: include_once(Mail.php) [function.include_once] failed to open stream. No such file or directory in my/path/t/o/f/i/l/e/s
Warning: include_once() [function.include] Failed opening Mail.php for inclusion include_path="./usr/local/php5/lib/php

Is this not valid for PHP 5.2?
What should I use instead???

31 Aug 2012, 5:35 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Upgrading PHP from Version 4.X To 5.2 isssue with include_once("Mail.php");

Your question isn't a Zen Cart issue.

In its purest sense it's just a basic PHP thing.
You're asking it to load a file that doesn't exist in either the current directory or the include_path.
Most contemporary PHP configurations add ".;" into the include_path so that "files in the current folder" (that's what a single-dot means in a directory path) will also be searched when you don't specify a complete path.

So, either fix your server's PHP configuration, or change your include_once command to specify a complete path to the php file you're trying to load.

More info on properly configuring include_path can be found at https://www.php.net