Re: No such file... but there is!
| From: | Carsten Jensen | Date: | Wed, 29 Nov 2017 08:32:25 +0000 |
| Subject: | Re: No such file... but there is! | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-326285@lists.php.net to get a copy of this message | ||
Den 28-11-2017 kl. 16:34 skrev Aziz Saleh:
On Tue, Nov 28, 2017 at 10:22 AM, Jennifer <jennifer@superiorshelving.com> wrote:it should be ../ (2 dots) or if you want to go parent 2 times ../../Hi!Use the absolute file location instead of the relative one. .../ looks wrong.I'm having an intermittent problem with a script locating a textfile. Here's the code section: function is_crawler($agent) { global $path;$bots_file = $path; $spiders = file($bots_file, FILE_IGNORE_NEW_LINES |FILE_SKIP_EMPTY_LINES); foreach ($spiders as $spider) {if (stristr($agent, $spider)) { return true; }} }The error log shows these lines:[28-Nov-2017 06:50:03] PHP Warning: file(.../counter/bots.txt): failed to open stream: No such file or directory in /home/.../counter/page_hit_counter.php on line 235 [28-Nov-2017 06:50:03] PHP Warning: Invalid argument supplied for foreach() in /home/.../counter/page_hit_counter.php on line 238The bots file is there and is populated, so I'm not sure why thishappens from time to time. It's not read by any other script, so I don't think it's a locking issue(?).What could be causing this issue?Thank you, Jenni -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php