Ok Sorted it!!!!

A little one to watch out for...

In the virtual server setup in httpd.conf I had:

DocumentRoot /home/chrisbetts/public_html
                      ^^
       Note the lack of drive ID!

This works as expected if you DO NOT have an include_path
in either your php.ini or .htaccess files.

However if you do set an include_path (even if you redefine the
default path of ".") ALL attempts to execute a PHP script
(even a simple script comprising nothing more than <?="hello";?>)
will fail and you will get a warning like:

"Warning: Failed opening '/home/chrisbetts/public_html/blank.php'
for inclusion (include_path='.') in Unknown on line 0"

Solution:
Simply fully define the path INCLUDING the Drive ID

DocumentRoot c:/home/chrisbetts/public_html

I assume that it is a problem with the way the new include_path
is parsed or added to the DocumentRoot!

You have no idea how long I have searched for that!
Its the sort of thing you go blind to after scanning lines of code
for hours on end!

I hope this helps someone in the future!!!!

Chris

"Chris Betts" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> HI
>
> using: php 4.0.6 /Apache 1.3.12 /Win98se
>
> If I set the php include_path in either php.ini or the .htaccess I get:
>
> "Warning: Failed opening '/home/chrisbetts/public_html/blank.php' for
> inclusion (include_path='.;..\include') in Unknown on line 0"
>
> i.e. it is failing to load the file it is loading at present (blank.php)
> ?????
>
> I am changing the include path in .htaccess file using:
> php_value include_path ".;..\include"
> (this is the only thing in the .htaccess file during testing)
>
> Even if I just set it to the default (current directory) value "." I get
the
> same warning.
>
> If I do the equivelent on a hosted Linux box it works ok?????
> i.e. php_value include_path ".:../include"
>
>
> If I move the relevent included files to the same dir as the calling
program
> and remove the include_path ... it works ok???
>
> I am (up to this point sucessfully) mimiking the layout of my clients
> virtual servers running on different Linux boxes, So I can test complete
> installations before upload. To do this I am using Apache Virtual Servers
> each one having its own DocumentRoot pointing to the public_html
> subdirectory.
>
> i.e. in httpd_conf
> <VirtualHost 127.0.0.2>
> DocumentRoot /home/chrisbetts/public_html
>
> <VirtualHost 127.0.0.3>
> DocumentRoot /home/anothervs/public_html
> etc...
>
> What I am trying to do is to move certain sensitive data to a safe area
out
> of the public_html subtree.
>
> So I now have dirs:
> /home/chrisbetts/include
> /home/chrisbetts/public_html
>
> /home/anothervs/include
> /home/anothervs/public_html
>
> safe_mode is off
>
> I think that this is something to do with not being able to escape from
the
> DocumentRoot ... but not sure!?!
>
> As I say it works on the linux virtual servers ... but I am missing
> something on the windows version!
>
> Any Ideas would be a great help.
>
> Chris
>
>
>
>
>
>
>



-- 
PHP Install Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to