I\'m using fopen to read from a file
$fh = fopen($path, \'r\') or die(\'Could not open file\');
Now I contantly get error Could not open fi
For php versions prior to 5.2 (lacking error_get_last()) you can use track_errors.
ini_set('track_errors', 1); $fh = fopen('lalala', 'r'); if ( !$fh ) { echo 'fopen failed. reason: ', $php_errormsg; }
see also: http://de.php.net/reserved.variables.phperrormsg