Note My answer below turned out to be popular, but I did not answer the question very correctly. This is not about suppressing a warning, but about fixing the error that caused the warning. I will leave it here for posterity.
The correct way to prevent a warning would be to check if the first exists, and not try to turn it on if it is not.
if (file_exists($includefile)) { include_once($includefile); }
(obviously replace $ includefile with the file you included)
A quick and dirty way to do this, which I recommend NOT recommending , is to suppress the warning using the @ expression.
@include_once($includefile);
Note that while suppressing the warning, this method still works with the PHP error handling code, but with the modified PHP value, error_reporting ini is temporarily ignored. This is generally not a good idea, as it may mask other errors.
As others have noted, "1" is an unusual file name for a PHP file, but I assume that you have a specific reason for this.
source share