2012-02-18

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.

No comments:

Post a Comment