Re: Reading files in PHP 5.3.0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-- On Fri, 9/11/09, Steve Brown <sbrown25@xxxxxxxxx> wrote:

> From: Steve Brown <sbrown25@xxxxxxxxx>
> Subject: Re:  Reading files in PHP 5.3.0
> To: php-general@xxxxxxxxxxxxx
> Date: Friday, September 11, 2009, 9:08 AM

Perhaps you should add some error checking to see where it breaks

> >> function
> parseResponseHeaders($header_file) {
> >>     $http_found = $error_found = false;
> >>     $http_reponse = $error_message = NULL;
> >>
> >>     $response = array();
> >>     $response['ResponseCode'] = NULL;
> >>     $response['ErrorMessage'] = NULL;
> >>
> >>     if (!is_file($header_file) ||
> >> !is_readable($header_file)) {
> >>         return $response;

             error_log($header_file . " is neither a file nor is it readable. Verify full physical path?? ");

> >>     }
> >>
> >>     $fin = fopen($header_file, 'r');

if ($fin == false) error_log("Failed to open " . $header_file);

> >>     while ($line = fgets($fin)) {
> >>         var_dump($line);
> >>
> > What does var_dump($line); tell you?
> 
> Nothing, not even an empty variable.  Which is why I
> think something
> is completely screwed up here.
> 
> BTW, squares at the end of lines are your platform not
> interpreting
> EOL characters correctly from another platform. 
> Generally, its the
> sending client thats not being friendly, not the receiving
> client.

Those additions will hint you where the problem is.  Just check your PHP error log, provided that you have it enabled in the ini.

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

> 

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux