Re: Problem with 'include' function in PHP 4.3
| From: | Christoph Grottolo | Date: | Mon, 06 Jan 2003 23:52:06 +0000 |
| Subject: | Re: Problem with 'include' function in PHP 4.3 | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-17690@lists.php.net to get a copy of this message | ||
Mehran Ziadloo wrote:
> It's about 'include' function, I can't include a php file using an
> absolute address. For example, all my pages are in
> "D:\Inetpub\wwwroot". And when I want to include a page with the
> address:
>
> "D:\Inetpub\wwwroot\includes\a.php"
>
> with the command:
>
> "include '/includes/a.php';"
>
> it can't be done, it says:
>
> Warning: main(/includes/a.php) [function.main]: failed to create
> stream: No such file or directory in D:\Inetpub\wwwroot\index.php on
> line 2
>
> Warning: main() [function.main]: Failed opening '/includes/a.php' for
> inclusion (include_path='.;D:\Inetpub\wwwroot') in
> D:\Inetpub\wwwroot\index.php on line 2
>
try like this:
include ('includes/a.php'); //without slash at the beginning
The slash at the beginning has a special meaning on all *nix systems (it's
the system root). You must not confund file system paths which you use in
PHP scripts with link paths in HTML (i.e. <a
href="/mainpage.html">Homepage</a>).
Christoph