Re: possible of the php engine corrupt?
| From: | php3 at developersdesk dot com | Date: | Thu, 22 Jun 2000 12:00:10 +0000 |
| Subject: | Re: possible of the php engine corrupt? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-2613@lists.php.net to get a copy of this message | ||
Addressed to: "yat" <yat@usa.net>
php-general@lists.php.net
** Reply to note from "yat" <yat@usa.net> Thu, 22 Jun 2000 15:06:34 +0800
>
> Thanks reply first... but most wired is from the php.net doc,
> "require" should only use *relative path* and should not use
> "absolute path" (ie.
> 'http://www.mysite.com/include.inc") , is it
> true? When i run nslookup, the respond is good and no unexpected
> delay, that's why i suspect how the php3 lookup the include file
> process..
>
Like many things in programming, the only real answer is 'It
depends...'
There are three kinds of paths that you can use to open a file:
relative: myfile.php or lib/myfile.php
The first opens the file myfile.php, either in the directory the
program is run from, or for require()/inculde() from a directory in the
include_path. The second one looks for a file in a directory lib/ in
the program's directory, or a directory listed in the include_path.
absolute: /usr/httpd/htdocs/www.mydomain.com/htdocs/myfile.php
The path starts with /, and is relative to the root directory on your
server. I think either Safe Mode, or possibly the include_path may
affect if this one works or not. I've had it work sometimes, and not
others, so I just avoid it.
internet: http://www.somedomain.com/index.html
ftp://ftp.somedomain.com/some/path/somefile_tar.gz
This does NOT just open the file, even if it resides on the same
machine as the program that you are running. It issues a request to
the named web or ftp server, which sends the file to be included, using
http or ftp protocol, and unless you use localhost, it probably
causes traffic to flow over your network. (even if the file is on the
local machine.) This will be SLOW! Don't use it without a good reason,
and then only to get files from machines other than the one the script
is running on.
Rick Widmer
Internet Marketing Specialists
www.developersdesk.com