Bluehost.com Web Hosting $6.95

Include fails when "./" is in front of file name

This is a discussion on Include fails when "./" is in front of file name within the PHP General forums, part of the PHP Programming Forums category; Daniel Brown wrote: > On Mon, Apr 7, 2008 at 12:24 PM, Noah Spitzer-Williams <noahsw@gmail.com&...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #11 (permalink)  
Old 04-07-2008
Lester Caine
 
Posts: n/a
Default Re: [PHP] Include fails when "./" is in front of file name

Daniel Brown wrote:
> On Mon, Apr 7, 2008 at 12:24 PM, Noah Spitzer-Williams <noahsw@gmail.com> wrote:
>> Here's the error I get:
>>
>> Warning: include(.\file.inc.php) [function.include]: failed to open stream:
>> No such file or directory in C:\Inetpub\httpdocs\test.php on line 3
>>
>> Warning: include() [function.include]: Failed opening '.\file.inc.php' for
>> inclusion (include_path='.;.\includes;.\pear') in
>> C:\Inetpub\httpdocs\test.php on line 3

>
> If you're going to use Windows-style paths, try escaping your
> slashes and see what happens.
>
> <?php
> include(".\\file.inc.php");
> ?>


People seem to be missing the point here. These are PUBLIC applications that
are failing to work for Noah. He should not need to re-write PHPMyAdmin in
order to get it to work?

Next people will be saying that we should re-write PHP if it does not work for
us.

Noah - I know that some 'security' has been added to the include function, but
I'm not sure why you are having problems. I'm running applications on windows
and Linux and the "./otherdir/" select is working fine.

--
Lester Caine - G8HFL
-----------------------------
Contact - http://home.lsces.co.uk/lsces/wiki/?page=contact
L.S.Caine Electronic Services - http://home.lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php
Reply With Quote
  #12 (permalink)  
Old 04-07-2008
Daniel Brown
 
Posts: n/a
Default Re: [PHP] Include fails when "./" is in front of file name

On Mon, Apr 7, 2008 at 1:05 PM, Lester Caine <lester@lsces.co.uk> wrote:
>
> People seem to be missing the point here. These are PUBLIC applications
> that are failing to work for Noah. He should not need to re-write PHPMyAdmin
> in order to get it to work?
>
> Next people will be saying that we should re-write PHP if it does not work
> for us.


Oh, did I say that? Must not have been paying attention as I
typed in words to that effect. Sorry.

I'm giving steps to debug and recreate the issue, not to rewrite
anyone else's code. You may have noticed where I mentioned
cross-platform portability.

--
</Daniel P. Brown>
Ask me about:
Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo.,
and shared hosting starting @ $2.50/mo.
Unmanaged, managed, and fully-managed!
Reply With Quote
  #13 (permalink)  
Old 04-08-2008
Noah Spitzer-Williams
 
Posts: n/a
Default Re: [PHP] Include fails when "./" is in front of file name

I appreciate the help guys. I don't understand what's going on. Here's
what I've tried since posting:

Copied over the PHP binaries and php.ini from my old server to my new one.
No luck.
Copied over the phpMyAdmin from my old server to my new one. No luck.

I've double-checked all permissions. Seriously, what else could there be?!

I repeat:
on old server, include('./file.inc.php') works FINE
on new server, include('./file.inc.php') BREAKS

I'm about to do a replace of "./" with "" but I know that's giving up!



""Daniel Brown"" <parasane@gmail.com> wrote in message
news:ab5568160804071010l3eff856evdc25409a4a46028a@ mail.gmail.com...
> On Mon, Apr 7, 2008 at 1:05 PM, Lester Caine <lester@lsces.co.uk> wrote:
>>
>> People seem to be missing the point here. These are PUBLIC applications
>> that are failing to work for Noah. He should not need to re-write
>> PHPMyAdmin
>> in order to get it to work?
>>
>> Next people will be saying that we should re-write PHP if it does not
>> work
>> for us.

>
> Oh, did I say that? Must not have been paying attention as I
> typed in words to that effect. Sorry.
>
> I'm giving steps to debug and recreate the issue, not to rewrite
> anyone else's code. You may have noticed where I mentioned
> cross-platform portability.
>
> --
> </Daniel P. Brown>
> Ask me about:
> Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo.,
> and shared hosting starting @ $2.50/mo.
> Unmanaged, managed, and fully-managed!


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 05:27 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0