[thelist] Supress php errors

Ivo P ipletikosic at gmail.com
Tue Aug 8 11:18:25 CDT 2006


Hello all,

This seems so simple yet i cant get it right.

I have an html file with embedded php constants that I want to parse
into pure html. I have a simple script that does the following
(abbreviated):

<snip>
error_reporting(0);
ini_set('error_reporting', 0);
ini_set('display_errors', false);

ob_start();
@include_once($included_file);
$output = ob_get_contents();
ob_end_clean();
file_put_contents($output_file, $output);
</snip>

The output in $output_file has Notices and Warnings, these are
expected and I want to supress them so they should not appear in the
output.

This is on a server that I do not control so I made a copy of the
php.ini file and set error_reporting=0 and display_errors=Off as well.

I then run the script with php -c php.ini -q html_with_php_file.php
and the output still contains Warnings and Notices .

Thanks for the help,

Ivo



More information about the thelist mailing list