0

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.

Bux
  • 57
  • 2
  • 11

2 Answers2

0

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:

<?php
ini_set('display_errors', 0);
echo($x);
phpinfo();
jasonwubz
  • 341
  • 3
  • 6
0

Try adding the following at the top of your PHP script :

<?php error_reporting(0); ?>

If the notice disappears, I would suggest making sure you are modifying the good php.ini file.

wlarcheveque
  • 894
  • 1
  • 10
  • 28