Re: A Strange Problem

From: Date: Fri, 21 Jun 2013 10:14:11 +0000
Subject: Re: A Strange Problem
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-321442@lists.php.net to get a copy of this message
On Jun 20, 2013 7:20 PM, "Tedd Sperling" <tedd@sperling.com> wrote: > > On Jun 20, 2013, at 7:12 PM, Stuart Dallas <stuart@3ft9.com> wrote: > > Whatever the reason for this, I'd recommend you always specify a path relative to the current script. > > > > In PHP 5.3+: > > > > $fcontents = file(__DIR__.'/docs/admin-email.txt'); > > > > Prior to 5.3: > > > > $fcontents = file(dirname(__FILE__).'/docs/admin-email.txt'); > > > > -Stuart > > -Stuart: > > Thats' an excellent idea -- I will do that. > > I just don't know why after so many years this problem came up -- I never experienced it before -- AND when I am really up against it. > > Maybe someone smarter than me (open to many) will explain why it happened. > > Cheers, > > tedd > > _____________________ > tedd@sperling.com > http://sperling.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > This was aeons ago, but i recall reading somewhere that could not necessarily trust what directory one's script was executing in so always spec abs paths. I've been more lax on that lately, but such things appear from time-to-time.

« previous php.general (#321442) next »