Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: "Christoph M. Becker" Newsgroups: comp.lang.php Subject: Re: PHP CSV Date: Thu, 18 Dec 2014 17:04:24 +0100 Organization: solani.org Lines: 38 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: solani.org 1418918657 9295 eJwNyMEBwCAIA8CVQEPQcZTg/iO097yYdFaCQcSLl1it0l4yzP8F2ijKz83L7hnyPuKwqI2sDyPhEWQ= (18 Dec 2014 16:04:17 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Thu, 18 Dec 2014 16:04:17 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 X-User-ID: eJwFwQkBACAIBLBK8p7EAYT+EdxMnLyhbq62ttQUM9MVWRV+6F1+YaWNRnLJAgleORXXaD8zsBGX In-Reply-To: Cancel-Lock: sha1:pl6wOuzvpb+3ZClKOihxwFihshg= X-NNTP-Posting-Host: eJwFwYEBwCAIA7CXVilFzhGG/59g4iaog3LRr98dYJkugSUbh4jO1JqoOp2nxc10Ws/3mx7/VRBJ Xref: csiph.com comp.lang.php:14766 Markus Heinz wrote: > On 2014-12-18 at 16:26 Joydeep Chakrabarty wrote: > >> Markus Heinz wrote: >> >>> If the fopen fails it should issue a warning. If the warning is not >>> displayed on screen, it should be found in the server logs. For apache >>> this is the file "error.log". >>> >> That's right. I changed my code to just - >> >> $fp = fopen ($file, "r") or die("Unable to open file"); >> >> It returned "Unable to open file". >> So it was wrong. What is the right way to access the file? > > Do you have PHP warnings enabled in your configuration? If so, did you > check the server logs for a message about the failed fopen? There should > be a hint about the cause. From php.ini (PHP 5.4): ; display_errors ; Development Value: On ; display_startup_errors ; Development Value: On ; error_reporting ; Development Value: E_ALL I suggest to use the suggested development values in a development environment. Then there is no need to consult the error log. -- Christoph M. Becker