0

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

6
  • I think your url is wrong... maybe localhost/Testing/ Commented Jun 19, 2015 at 10:06
  • I changed the URL to localhost/Testing/index.php/ but still get the error. Commented Jun 19, 2015 at 10:15
  • can you show screenshot of your folder structure Commented Jun 19, 2015 at 10:18
  • if you remove ./ from the include its working? on index.php, line " include './DBConnect.php';" if they are in the same folder , this must be working. Or with a simple index.html with only some text? Commented Jun 19, 2015 at 10:24
  • @rheese They aren't working either. HTML file works when opened with file URL but not with localhost URL as localhost/Testing/index.html Commented Jun 19, 2015 at 10:53

4 Answers 4

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

@vinay_Kumar , then pls post new screenshot of browser below current one in Edited question.
0

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

Comments

0

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

Comments

0

Remove or rename .htaccess the file from the project

you will able to open this project

3 Comments

Where do you htaccess in his project?
check out the testing folder, and remove .htaccess file.
Where is his -> testing folder ? I dont see it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.