File not found error

File not found error

am 17.01.2007 07:53:47 von Alex Keim

I can't figure out how to fix the file not found error that I'm
getting. "... failed to open stream: No such file or directory..."
I've looked for answers all over the net and can't find anything that
seems to help. Basically I only get the error when using relative
paths. My PHP include_path is set to ".;c:\php\includes". Absolute
paths work just fine. I know my PHP is at least mostly configured
correctly. I say mostly because I run Gallery (which uses PHP) on my
server and it works just fine but I cann't run either phpBB2 or
MediaWiki because they use relative paths for includes. phpBB2 does
work when I change relative to absolute but I don't want to go through
and edit ever single file... plus upgrades will be a pain. So anyone
run into this problem and solve it? Thanks.
- Alex

some phpinfo:
PHP Version 5.2.0RC3-dev
Build Date Aug 31 2006 20:16:01
Configure Command cscript /nologo configure.js
"--enable-snapshot-build" "--with-gd=shared"
Server API Apache 2.0 Filter
Virtual Directory Support enabled
Configuration File (php.ini) Path C:\php\php.ini
PHP API 20041225
PHP Extension 20060613
include_path .;c:\php\includes .;c:\php\includes

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

Re: File not found error

am 18.01.2007 02:48:08 von Niel Archer

Hi,

Relative paths only work from the php file's directory. NOT for the
include directory. In my experience phpBB2 works just fine as it is, if
installed in its default layout (do not put it in the includes directory,
that won't work).

Niel

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

Re: File not found error

am 18.01.2007 03:16:06 von Alex Keim

Thanks for the reply. I'm not sure I know what you mean by "if
installed in its default layout". I didn't changed it at all. I just
unpacked it in apache/htdocs/phpBB2. I have php installed in c:\php. I
probably wasn't very clear as to the broken includes thing. Basically
anywhere in phpBB2 that says "include( "./../file.php" ) or "require(
"./../file.php)" fails with file not found error. I can change them
all to have absolute path or do something like "include( dirname(
_FILE_ ) . "../file.php" )" but I don't want to do that for all of
phpBB2 and all of MediaWiki. So I figure I must have something
configured incorrectly right? Thanks.
- Alex

On 1/17/07, Niel Archer wrote:
> Hi,
>
> Relative paths only work from the php file's directory. NOT for the
> include directory. In my experience phpBB2 works just fine as it is, if
> installed in its default layout (do not put it in the includes directory,
> that won't work).
>
> Niel
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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

Re: File not found error

am 18.01.2007 03:37:23 von Niel Archer

Hi

> Thanks for the reply. I'm not sure I know what you mean by "if
> installed in its default layout". I didn't changed it at all. I just
> unpacked it in apache/htdocs/phpBB2.

That's the default layout. Installed as a sub-directory off the
document root.

Does the 'c:\php\includes' directory actually exist and spelled the
same? As it's not one created by php by default.
Also your info indicates that you're using a development version of
php (albeit a RC3). I'd download/install the latest stable version,
which is newer than that one anyway. Unless you're an experienced user
willing to do testing, NEVER use a development/beta version of software
as it's asking for problems that you're volunteering to help fix.


Niel

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

Re: File not found error

am 19.01.2007 08:19:46 von Alex Keim

You know I didn't even notice that there is no php\includes dir until
you mentioned it. That's just the default config path so I just
assumed that includes dir would be there. I realize the release
canidate is probably not the best version of php to use but at the
time of install the most recent version of php did not actually work
on the most recent version of apache (this was several months back
now). The work around was to use the RC. I have a hard time believing
though that my problem is due to using an RC instead of the latest
stable version. Of course you never know. I will likely give the
latest version of php a shot when I get some time? Hopefully it has no
problems with Apache 2.2? Thanks again.
- Alex

On 1/17/07, Niel Archer wrote:
> Hi
>
> > Thanks for the reply. I'm not sure I know what you mean by "if
> > installed in its default layout". I didn't changed it at all. I just
> > unpacked it in apache/htdocs/phpBB2.
>
> That's the default layout. Installed as a sub-directory off the
> document root.
>
> Does the 'c:\php\includes' directory actually exist and spelled the
> same? As it's not one created by php by default.
> Also your info indicates that you're using a development version of
> php (albeit a RC3). I'd download/install the latest stable version,
> which is newer than that one anyway. Unless you're an experienced user
> willing to do testing, NEVER use a development/beta version of software
> as it's asking for problems that you're volunteering to help fix.
>
>
> Niel
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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