简体   繁体   中英

PHP error reporting will not turn off

Preface: I have already searched for previous answers to similar questions, tried to implement suggested solutions, and my problem has still not been resolved. Also, I do not need to be told to solve the problem causing the error message as I have deliberately caused an error to learn the ins and outs of changing the error reporting values in the php.ini file, directly and indirectly.


I have tried to turn off error reporting directly in the php.ini file by making display_errors=Off. Also, I have tried to switch it off indirectly using error_reporting(0); and ini_set('error_reporting',0);

I still cannot get error reporting to switch off. If someone could help me to identify why I cannot turn off error reporting, I would appreciate it.

Edit: I apologise for not being more specific. Can't believe I forgot to say: I am working with XAMPP offline.


Here is the code causing the error (a semicolon is missing after the echo)

<?php
echo $var = 'Dave'
$var = 'John';
?>

@Chris Rasco: I'm not entirely sure what information you would like from the phpinfo() page, but here's what seems to me (as a newbie) to be the most relevant:

Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--disable-isapi" "--enable-debug-pack" "--without-mssql" "--without-pdo-mssql" "--without-pi3web" "--with-pdo-oci=C:\\php-sdk\\oracle\\instantclient10\\sdk,shared" "--with-oci8=C:\\php-sdk\\oracle\\instantclient10\\sdk,shared" "--with-oci8-11g=C:\\php-sdk\\oracle\\instantclient11\\sdk,shared" "--enable-object-out-dir=../obj/" "--enable-com-dotnet=shared" "--with-mcrypt=static" "--disable-static-analyze" "--with-pgo"

Configuration File (php.ini) Path C:\\Windows

Loaded Configuration File C:\\xampp\\php\\php.ini

Scan this dir for additional .ini files (none)

Additional .ini files parsed (none)


@Fred -ii-: yes, that is essentially what I am doing. I am trying to see how to change how changing various parts of the php.ini file affects the output in the browser.


Finally! I've fixed the problem. Thanks, guys! I can't believe I made the stupid error of not restarting Apache after editing the php.ini file.

Could you share the error message? I'd be curious to see if it's a E_FATAL error.

Missing a ; would produce a E_FATAL error. You can't suppress a fatal error because it is a compiling error.

In other words: In that case your php script cannot compile and has to terminate.

search below line in php.ini file in your xamp

;error_reporting=E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE

then once you found above line then remove ; from line. it will switch off your error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM