WampServer How To Fix PHP Error Notice: Undefined variable: index
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.
NOTE: This is just for those who wants to save their time to fix entire coding again to define variables. Otherwise i recommend must define variable before use them to avoid this error.Â
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!














November 5th, 2009 at 9:15 am
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
August 15th, 2010 at 2:23 am
Thanks mate- saved some time figuring this problem out!
June 22nd, 2011 at 4:17 pm
WampServer How To Fix PHP Error Notice: Undefined variable ……
[...]open your php.ini from wamp server and search “error_reporting = E_ALL … once you done please restarts your Apache server or “wamp” then go back to the page where …[...]…
October 8th, 2011 at 3:05 am
if i define some thing like $myveriable and it is blank then show me undefine veriable how can it be fix
October 19th, 2011 at 7:30 am
thanks dude…I haven’t touch php in a long time and I was wondering why wamp was doing this…
November 20th, 2011 at 6:52 am
thanks buddy its working;;;;;;;;;;;;
December 26th, 2011 at 3:06 am
thanks dude.. it really works!
January 7th, 2012 at 6:11 pm
i make this changes but stii have the error with undefined variable….i am running with WAMP…someone can help me?