1

When I developed a website on my localserver it was working fine.

Now that I've uploaded it live I'm getting several notices.

Notice: Undefined index: ... on line 14

I've figured out that it happens because I'm using variables which arn't defined, and would like to go through and fix it. But I need a live version working tonight.

Is it possible to suppress the Notices and have the website act as it does on my localhost while its on my live server?

Dvir
  • 5,049
  • 1
  • 23
  • 32
Philip Kirkbride
  • 21,381
  • 38
  • 125
  • 225

3 Answers3

9

You've got it twice wrong. On your localhost and on your live server!

Localhost

  • Always show everything on screen, you want to know about notices too before you go live, as you can see now!

Live server

  • Never show anything on screen, it makes you vulnerable (it's deadly)
  • Log everything, also notices! So don't do what the other answers tell you!
Community
  • 1
  • 1
markus
  • 40,136
  • 23
  • 97
  • 142
5

You can choose which kind of errors will show up on your site on a global scale through php.ini or through .htaccess for specific folders, or per script by using error_reporting().

Read more on that and which options to set for your specific needs at www.php.net/manual/en/function.error-reporting.php

Also read: http://www.php.net/error-reporting

Community
  • 1
  • 1
Dvir
  • 5,049
  • 1
  • 23
  • 32
4

Look in the file php.ini for a line similar to error_reporting = E_STRICT - Edit it to remove the STRICT bit and put in error_reporting = E_ERROR.

I would recommend that in the near future that you fix those errors anyway.

Ed Heal
  • 59,252
  • 17
  • 87
  • 127