WampServer How To Fix PHP Error Notice: Undefined variable: index


2 Votes, Rating: 51 Star2 Stars3 Stars4 Stars5 Stars

Tags: , ,

How To Fix PHP Error Notice: Undefined variable: index

Today i have face this problem as listing below, and i have search a lot and try to fix my wamp server setting and waste my few professional hours. Im writing this so any other developer or designer not waste.

this was the errors:

Notice: Undefined variable: q in in home.php on line 8

Notice: Undefined variable: module in home.php on line 11

you need to do some minor change on your php.ini file. please follow these steps

open your php.ini from wamp server and search “error_reporting = E_ALL & ~E_NOTICE

if that module not active, please active it.

and close (replace) 

error_reporting  =  E_ALL

to

;error_reporting  =  E_ALL

if any place.

——– 2nd step —— 

if you wont found this. only found

error_reporting = E_ALL

so replace that to

error_reporting = E_ALL & ~E_NOTICE

once you done please restarts your Apache server or “wamp” then go back to the page where you were getting this error and refresh the web page and you should not see this error anymore.

Warning: .htaccess/php.ini file can stop working your site if you use wrong code, USE ONLY AT YOUR OWN RISK!

Share/Save/Bookmark

One Response to “WampServer How To Fix PHP Error Notice: Undefined variable: index”

  1. salman says:

    if we disable this option error_reporting are we wont see any error massage from the php so its hard to find where is the error so what to do for that

Leave a Reply


CSS (Design) - TOP.ORG