I started a php project in netbeans and connected it with a database in localhost/phpmyadmin. But on running it gives this error on browser..

Why does this happen? How to avoid it?
Here are the codes in the project.. dbconnect.php and index.php. Files are saved in /var/www/html/Testing/ (Testing is name of project).
Edit : I tried URL localhost/Testing/index.php but still gets the same error.

Edit2 : Folder structure of /var/www

localhost/Testing/localhost/Testing/index.php/but still get the error.localhost/Testing/index.html