- How To Fix PHP Error Notice: Undefined variable: index in x/x/x.php Line x
This Page Contains information about How To Fix PHP Error Notice: Undefined variable: index in x/x/x.php Line x By webmaster in category Linux with 0 Replies. , Last Updated: Sun Mar 01, 2020
Fri Feb 29, 2008
on one of my website, i kept getting this error on a new script i just installed on a brand new linux server provided by Webune.com which i just leased a dedicated server from Webune.com
this was the errors:
Notice: Undefined variable: leftLinks in /var/www/home/shop/script/header.php on line 124
Notice: Undefined variable: q in /var/www/home/shop/script/header.php on line 138
Notice: Undefined variable: welcome in /var/www/home/shop/script/header.php on line 148
I was trying to figure out how to fix this error, i contacted the support team at Webune and they were able to give me an answer quickly.
so just in case it happens to me in the future, i can have this tutorial guide to remind me on how to fix this PHP error. or if anyone has the same problem they can benefit from the support team at Webune Web Hosting.
so to fix this error you need to login into you Webune Dedicated Server. If you are not a Webune cusotmer, make sure you are having this problem on a linux server like Red Hat, Fedoar, Centos etc..
To start login as root using a SSH connection to your linux shell prompt.
make a backup of the php.ini file with this command:
cp etc/php.ini /etc/php.ini.backup
then open the php.ini file with a text editor, i wll be using nano which comes with linux, you can also us VI, but i like nano better. i will open it using nano with this command: Code:
now look for this line in the php.ini file: Code:
error_reporting = E_ALL
NOTE: you may have something different set for the error_reporting , just make sure you make the changes on the line without a semi-colon because a semi-colon at the begining of the line mean its a comment
So now change it to:
error_reporting = E_ALL & ~E_NOTICE
Save your changes and then restart you Apache server for the changes to take affect witht his command: Code:
once your Apache server restarts, go back to the page where you were getting this error and refresh the web page and you should not see this error anymore.
Hope this help. Please provide any feed back or comments you have by submitting your reply at the bottom of this page. thanks