php files connected with mysql server not working

91 views Asked by At

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..

enter image description here

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. enter image description here

Edit2 : Folder structure of /var/www enter image description here

4

There are 4 answers

1
Pratik Joshi On

Use path like localhost/Testing/index.php. Remove html folder from URL.

Reason ? Linux by default considers PHP files in html folder. So no need to give that folder name in url.

0
Salar On

type

localhost

in your browser, it must show you a page with all of the folders in your www directory. then find your desirable folder and click on it, continue this until you get to your index.php file

0
Alexandru  Gojinetchi On

First try to access the localhost. If all is well configured you will see there all projects. Then access project that you need to see what gives you url

3
YOG_PHP On

Remove or rename .htaccess the file from the project

you will able to open this project