VmWare Cloud Server
CentOS Linux 7.6.1810 – Php 5.6.40 – Apache/2.4.6
test.php
<?php
echo($x);
phpinfo();
?>
Output :
Notice: Undefined variable x in /var/www/html/test.php on line 1
In CORE section of phpinfo output I have
display_errors Off
display_startup_errors Off
error_reporting 0
Why Notice is shown?
I’d like not to show any error/notice/warning etc.
2
Answers
It’s possible that your settings are controlled in the htaccess file, see more info: https://www.php.net/manual/en/configuration.changes.php
But you can try this:
Try adding the following at the top of your PHP script :
If the notice disappears, I would suggest making sure you are modifying the good php.ini file.