Re: Disaple warnings
| From: | David Otton | Date: | Tue, 17 Jun 2003 17:53:29 +0000 |
| Subject: | Re: Disaple warnings | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-151868@lists.php.net to get a copy of this message | ||
On Tue, 17 Jun 2003 19:25:39 +0200, you wrote:
>I have the following code:
>if (file_exists("themes/$ThemeSel/modules/$name/$mod_file.php")) { $modpath
>= "themes/$ThemeSel/"; }
>
>At home on my PC (WinXP+PHP4.3.2) this code works without warnings.
>But in my office (Win2000+PHP4.3.0) I always becom warnings for this line
>and in case of any other file_exists call.
>(Both case the file doesn't exist)
>
>How can I disable display warning in such case?
Change your error reporting level
http://www.php.net/manual/en/function.error-reporting.php
(or set globally in php.ini)
or supress the error with @ (can't find a URL, but essentially place @ in
front of a statement to supress errors).
However... that's just supressing the warning, not fixing it. It's odd that
PHP would throw a warning if the file doesn't exist. What warning are you
getting, exactly? What happens if you have a script that just contains
<?
if (file_exists('test.txt')) {
echo("one");
} else {
echo("two");
}
?>
Hmm... could this be your bug? http://bugs.php.net/bug.php?id=15932 Maybe an
upgrade would fix it.