PHP files don't work in Windows network drive 
Author Message
 PHP files don't work in Windows network drive

I have a local Apache 2 web server in my PC (a Windows XP box). There's a
virtual host in that Apache with DocumentRoot pointing to a Windows share
(in an NT Server 4 box). I use the UNC name (\\server\folder) and a domain
user with the appropriate credentials (according to Apache documentation).
HTML can be accessed fine but whenever a ask for a *.php file (*no matter
its content*) I get the same error message:

   Warning: Cannot open "blah blah" for inclusion in Unknown 0

All PHP files are parsed correctly in local folders. Does anyone know why
this happens? Thank you in advance,

--
---------------------------------------------------------------------------
Alvaro G. Vicario          Un hombre sin una religin es                ICQ
Burgos, Spain              como un pez sin una bicicleta           46788716
Mi paginita de humor <> http://www.*-*-*.com/ ;> My little humour site



Sat, 30 Apr 2005 22:53:11 GMT  
 PHP files don't work in Windows network drive



Quote:
> I have a local Apache 2 web server in my PC (a Windows XP box). There's a
> virtual host in that Apache with DocumentRoot pointing to a Windows share
> (in an NT Server 4 box). I use the UNC name (\\server\folder) and a domain
> user with the appropriate credentials (according to Apache documentation).
> HTML can be accessed fine but whenever a ask for a *.php file (*no matter
> its content*) I get the same error message:

>    Warning: Cannot open "blah blah" for inclusion in Unknown 0

> All PHP files are parsed correctly in local folders. Does anyone know why
> this happens? Thank you in advance,

Not sure if this helps, but take a look at the info at this URL:

http://bugs.php.net/bug.php?id=13292



Sun, 01 May 2005 04:18:33 GMT  
 PHP files don't work in Windows network drive
*** Andrew G escribi/wrote (12 nov 2002):

Quote:
>> I have a local Apache 2 web server in my PC (a Windows XP box).
>> There's a virtual host in that Apache with DocumentRoot pointing to a
>> Windows share (in an NT Server 4 box). I use the UNC name
>> (\\server\folder) and a domain user with the appropriate credentials
>> (according to Apache documentation). HTML can be accessed fine but
>> whenever a ask for a *.php file (*no matter its content*) I get the
>> same error message:

>>    Warning: Cannot open "blah blah" for inclusion in Unknown 0

>> All PHP files are parsed correctly in local folders. Does anyone know
>> why this happens? Thank you in advance,

> Not sure if this helps, but take a look at the info at this URL:

> http://bugs.php.net/bug.php?id=13292

Thank you for the tip, but I believe this bug report doesn't apply since
I'm not actually including any file. If I create a file called helloworld.html
with this content:

        <html>Hello world!

I get the expected result:

        Hello world!

But if I simply rename it to helloworld.php I get an error message:

        Warning: Failed opening 'helloworld.php' for inclusion (include_path='.;c:\foxserve\php\pear') in Unknown on line 0

It seems Apache passes the file name to the PHP interpreter but the interpreter
can't find it.

--
-------------------------------------------------------------------------
-- Alvaro G. Vicario          Un hombre sin una religin es            
  ICQ Burgos, Spain              como un pez sin una bicicleta          
46788716 Mi paginita de humor <> http://www.demogracia.com/ <> My little
humour site



Sun, 01 May 2005 05:37:15 GMT  
 PHP files don't work in Windows network drive



Quote:
> *** Andrew G escribi/wrote (12 nov 2002):
> >> I have a local Apache 2 web server in my PC (a Windows XP box).
> >> There's a virtual host in that Apache with DocumentRoot pointing to a
> >> Windows share (in an NT Server 4 box). I use the UNC name
> >> (\\server\folder) and a domain user with the appropriate credentials
> >> (according to Apache documentation). HTML can be accessed fine but
> >> whenever a ask for a *.php file (*no matter its content*) I get the
> >> same error message:

> >>    Warning: Cannot open "blah blah" for inclusion in Unknown 0

> >> All PHP files are parsed correctly in local folders. Does anyone know
> >> why this happens? Thank you in advance,

> > Not sure if this helps, but take a look at the info at this URL:

> > http://bugs.php.net/bug.php?id=13292

> Thank you for the tip, but I believe this bug report doesn't apply since
> I'm not actually including any file. If I create a file called
helloworld.html
> with this content:

>     <html>Hello world!

> I get the expected result:

>     Hello world!

> But if I simply rename it to helloworld.php I get an error message:

>     Warning: Failed opening 'helloworld.php' for inclusion

(include_path='.;c:\foxserve\php\pear') in Unknown on line 0

Quote:

> It seems Apache passes the file name to the PHP interpreter but the
interpreter
> can't find it.

I see, it seems this is not related to the fact that is on a network drive
at all.

The include path for PHP is set in the php.ini file.
Your error: blah (include_path='.;c:\foxserve\php\pear')  blah etc is
telling you that it can't find the file, but it seems that it is only
looking in your include path which suggests that it is not looking in the
directory you specified. This seems strange because you say it works with
"hello.html".

Is there any chance you could post the script contents, both the relavent
part of the calling script and the entire contents of the "helloworld.php"
file. It would be easier to debug if you did that.

Andrew



Sun, 01 May 2005 07:50:45 GMT  
 PHP files don't work in Windows network drive

Quote:

> Is there any chance you could post the script contents, both the relavent
> part of the calling script and the entire contents of the "helloworld.php"
> file. It would be easier to debug if you did that.

Sure. Also, now I'm in front of the computer and don't have to write
error messages by heart. I have a virtual host (for testing purposes)
defined this way in httpd.conf:

<VirtualHost *>
    ServerName php
    DocumentRoot "\\\\servidor\\webs\\fullhardware\\www"
    ErrorLog logs/fullhardware-error.log
    CustomLog logs/fullhardware-access.log common

    Options All Multiviews
    IndexOptions FancyIndexing VersionSort FoldersFirst


</VirtualHost>

I've placed these two files in the www folder:

*** hola.html:

<html>
<head><title></title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
</head>
<body>

<h1>Hola</h1>

<p>Prueba de Apache+PHP en unidad de red</p>

</body>
</html>

*** hola.php:

<html>
<h1>Hola</h1>

When I load http://php/hola.html I get the expected output:

Hola
Prueba de Apache+PHP en unidad de red

When I load http://php/hola.php I get an error message:

Warning: Failed opening '//servidor/webs/Fullhardware/www/hola.php'
for inclusion (include_path='.;c:\php4\pear') in Unknown on line 0

I have no problems at all with PHP in local drives like this:

<VirtualHost *>
    ServerName fullhardware
    DocumentRoot "D:\DOCUMENTOS\FullHardware\www"
    ErrorLog logs/fullhardware-error.log
    CustomLog logs/fullhardware-access.log common

    Options All Multiviews
    IndexOptions FancyIndexing VersionSort FoldersFirst


</VirtualHost>

This virtual host parses PHP perfectly.



Sun, 01 May 2005 16:36:59 GMT  
 PHP files don't work in Windows network drive




Quote:
> > Is there any chance you could post the script contents, both the
relavent
> > part of the calling script and the entire contents of the
"helloworld.php"
> > file. It would be easier to debug if you did that.

> Sure. Also, now I'm in front of the computer and don't have to write
> error messages by heart. I have a virtual host (for testing purposes)
> defined this way in httpd.conf:

> <VirtualHost *>
>     ServerName php
>     DocumentRoot "\\\\servidor\\webs\\fullhardware\\www"
>     ErrorLog logs/fullhardware-error.log
>     CustomLog logs/fullhardware-access.log common

>     Options All Multiviews
>     IndexOptions FancyIndexing VersionSort FoldersFirst


> </VirtualHost>

This is not really a PHP issue, I thought you were trying to use PHP's
"include()" function.

Is there any way you can use a mapped drive instead of "\\\\servidor\\webs"
so you can use something like:
DocumentRoot "s:\\fullhardware\\www"

That might get around your problems, I have no experience using UNC paths
for a document root in Apache but have had some success using mapped drives
if the permissions are set correctly.



Andrew



Mon, 02 May 2005 03:39:48 GMT  
 PHP files don't work in Windows network drive
*** Andrew G escribi/wrote (13 nov 2002):

Quote:
>> <VirtualHost *>
>>     ServerName php
>>     DocumentRoot "\\\\servidor\\webs\\fullhardware\\www"
>>     ErrorLog logs/fullhardware-error.log
>>     CustomLog logs/fullhardware-access.log common

>>     Options All Multiviews
>>     IndexOptions FancyIndexing VersionSort FoldersFirst


> This is not really a PHP issue, I thought you were trying to use PHP's
> "include()" function.

I believe it *is* a PHP issue. HTML pages work fine, the problem is the PHP
interpreter. But I suppose you mean it isn't related to PHP *language*.

Quote:
> Is there any way you can use a mapped drive instead of
> "\\\\servidor\\webs" so you can use something like:
> DocumentRoot "s:\\fullhardware\\www"

That'd be pretty complicate since Apache runs as service. Mapped drives
only seem to get mounted when user logs in the "traditional" way.

We'll have to install a Linux box sooner or later :)

--
---------------------------------------------------------------------------
Alvaro G. Vicario          Un hombre sin una religin es                ICQ
Burgos, Spain              como un pez sin una bicicleta           46788716
Mi paginita de humor <> http://www.demogracia.com/ <> My little humour site



Mon, 02 May 2005 05:30:49 GMT  
 PHP files don't work in Windows network drive



Quote:
> *** Andrew G escribi/wrote (13 nov 2002):
> >> <VirtualHost *>
> >>     ServerName php
> >>     DocumentRoot "\\\\servidor\\webs\\fullhardware\\www"
> >>     ErrorLog logs/fullhardware-error.log
> >>     CustomLog logs/fullhardware-access.log common

> >>     Options All Multiviews
> >>     IndexOptions FancyIndexing VersionSort FoldersFirst


> > This is not really a PHP issue, I thought you were trying to use PHP's
> > "include()" function.

> I believe it *is* a PHP issue. HTML pages work fine, the problem is the
PHP
> interpreter. But I suppose you mean it isn't related to PHP *language*.

Yes, that's what I mean. This is an Apache/PHP configuration issue.

Perhaps you have permission to read the files on that drive but not execute
them.

Quote:
> > Is there any way you can use a mapped drive instead of
> > "\\\\servidor\\webs" so you can use something like:
> > DocumentRoot "s:\\fullhardware\\www"

> That'd be pretty complicate since Apache runs as service. Mapped drives
> only seem to get mounted when user logs in the "traditional" way.

Are you using an "untratitional" method to log in? I don't understand what
you mean by "traditional" in that sentance. Do you want apache to be running
when no user is logged in?

I do not understand why you cannot just map a drive to get around the
problem. There is seems to be an issue with the way the apache/PHP
combination handles UNC paths on windows so the obvious workaround in my
mind is to map a drive and be done with it. If there is some reason you
cannot do this then you may be stuck.

Quote:

> We'll have to install a Linux box sooner or later :)

Please do!!

Quote:
> --
> --------------------------------------------------------------------------
-
> Alvaro G. Vicario          Un hombre sin una religin es
ICQ
> Burgos, Spain              como un pez sin una bicicleta
46788716
> Mi paginita de humor <> http://www.demogracia.com/ <> My little humour

site


Mon, 02 May 2005 06:48:23 GMT  
 PHP files don't work in Windows network drive
*** Andrew G escribi/wrote (13 nov 2002):

Quote:
>> That'd be pretty complicate since Apache runs as service. Mapped
>> drives only seem to get mounted when user logs in the "traditional"
>> way.

> Are you using an "untratitional" method to log in? I don't understand
> what you mean by "traditional" in that sentance. Do you want apache to
> be running when no user is logged in?

Oh, this poor English of mine! With "traditional" I meant opening a desktop
session (you know: Ctrl+Alt+Del, username, password, OK). I work in my
computer with an user called "alvaro" but Apache runs with a user called
"apache" (alvaro is an admin and I prefer apache not to be so). The Apache
service runs with the apache user credentials, but doesn't really log in.
Since network drive letters are a per-user setting, they don't get mounted.

Never mind, you've already done a lot, this stuff doesn't really deserve
more attention. I'll keep on using the simpliest solution (host site files
in my PC instead of in the server).

--
---------------------------------------------------------------------------
Alvaro G. Vicario          Un hombre sin una religin es                ICQ
Burgos, Spain              como un pez sin una bicicleta           46788716
Mi paginita de humor <> http://www.demogracia.com/ <> My little humour site



Mon, 02 May 2005 22:15:32 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Aache 2.0.42 with PHP 4.3 don't work

2. Copy file from network drive to local drive?

3. Backquotes `somecommand` don't work on Windows (bug)

4. SWI Prolog: Windows 1.9.5: tty don't work

5. Unix style font sizes on Windows don't work

6. menu unpost and destroy don't work in Windows

7. Grab + wm (resizable) don't work under Windows NT

8. PHP under Apache on Win NT and Network drive

9. Help: File drops in Finder don't always work

10. Performance when working directory is slow network drive

11. Dolphin Applet's don't work...

12. match works, don't match doesn't

 

 
Powered by phpBB® Forum Software