problems with includes after upgrade from 5.2.1 to 5.2.11

View: New views
4 Messages — Rating Filter:   Alert me  

problems with includes after upgrade from 5.2.1 to 5.2.11

by Paul J. Smith :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I just upgraded php and am using it with IIS / FastCgi.

Now all my code 'includes' and 'requires' are failing as they don't have drive letters :(

This does not see to happen if you run from the command line.

My php files are all stored on drive e:

Previously all my code just referenced full paths like /mysite/includes/test.php

Now I find this does not work unless I use e:/mysite/includes/test.php

Any way to fix this without having to change 1000's of lines of code!?

Thanks,

Paul

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: problems with includes after upgrade from 5.2.1 to 5.2.11

by Pierre Joye :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi,

I don't see what could have caused this problem in 5.2.x. However it
is a bad idea to use absolute path without a drive letter. It should
be better to setup correctly your include_path and relies on it, or
prefix your include/require with a predefined path:

define('MYINC', 'e:/mysite/include/');
include MYINC . 'foo/test.php';

Cheers,
--
Pierre

On Wed, Sep 30, 2009 at 1:11 PM, Paul J. Smith <pjsmith@...> wrote:

> Hi,
>
> I just upgraded php and am using it with IIS / FastCgi.
>
> Now all my code 'includes' and 'requires' are failing as they don't have drive letters :(
>
> This does not see to happen if you run from the command line.
>
> My php files are all stored on drive e:
>
> Previously all my code just referenced full paths like /mysite/includes/test.php
>
> Now I find this does not work unless I use e:/mysite/includes/test.php
>
> Any way to fix this without having to change 1000's of lines of code!?
>
> Thanks,
>
> Paul
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



--
Pierre

http://blog.thepimp.net | http://www.libgd.org

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: problems with includes after upgrade from 5.2.1 to 5.2.11

by Paul J. Smith :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

It helps us a lot as we clone the site to other servers that may not have the same drive letter.

Strange thing is, this is definitely a behaviour change.  It also is different behaviour from the command line php in the same package, which still works just fine.

Done about 4k search and replaces on my code tree so far to fix this.  Replaced the first part of the path with  $_SERVER['DOCUMENT_ROOT'] , if it helps anyone else.


-----Original Message-----
From: Pierre Joye [mailto:pierre.php@...]
Sent: 30 September 2009 12:38
To: Paul J. Smith
Cc: php-windows
Subject: Re: [PHP-WIN] problems with includes after upgrade from 5.2.1 to 5.2.11

hi,

I don't see what could have caused this problem in 5.2.x. However it
is a bad idea to use absolute path without a drive letter. It should
be better to setup correctly your include_path and relies on it, or
prefix your include/require with a predefined path:

define('MYINC', 'e:/mysite/include/');
include MYINC . 'foo/test.php';

Cheers,
--
Pierre

On Wed, Sep 30, 2009 at 1:11 PM, Paul J. Smith <pjsmith@...> wrote:

> Hi,
>
> I just upgraded php and am using it with IIS / FastCgi.
>
> Now all my code 'includes' and 'requires' are failing as they don't have drive letters :(
>
> This does not see to happen if you run from the command line.
>
> My php files are all stored on drive e:
>
> Previously all my code just referenced full paths like /mysite/includes/test.php
>
> Now I find this does not work unless I use e:/mysite/includes/test.php
>
> Any way to fix this without having to change 1000's of lines of code!?
>
> Thanks,
>
> Paul
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



--
Pierre

http://blog.thepimp.net | http://www.libgd.org

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: problems with includes after upgrade from 5.2.1 to5.2.11

by Elizabeth M Smith :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Paul J. Smith wrote:
> It helps us a lot as we clone the site to other servers that may not have the same drive letter.
>
> Strange thing is, this is definitely a behaviour change.  It also is different behaviour from the command line php in the same package, which still works just fine.
>
> Done about 4k search and replaces on my code tree so far to fix this.  Replaced the first part of the path with  $_SERVER['DOCUMENT_ROOT'] , if it helps anyone else.
>
>

Did you make sure they're both using the same php.ini file and the
include_path is set properly?  Often the command line php will pick up a
different ini file than the cgi - especially on windows.

Thanks,
Elizabeth Smith

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php