0

I've been searching this for hours and still I can't figure out what am I doing wrong. Xampp is installed and Apache is running. I set PHP 5 Interpreter to

C:\xampp\php\php.exe

My project folder:

C:\xampp\htdocs\myphpproject

Source folder:

C:\xampp\htdocs\myphpproject

But I can't run my PHP files on browser. When I click run it opens

localhost/dashboard/

Please, someone explain me like I'm five. What's the problem here?

2
  • I don't know whether it matters, but I have PHP Interpreter set to C:\xampp\php\windowsXamppPhp\php.exe instead, so you might try that. Commented Oct 6, 2019 at 13:54
  • 1
    have you try localhost/myphpproject Commented Oct 6, 2019 at 14:27

1 Answer 1

1

You said "When I click Run"... So, you are trying to run the application from within NetBeans. So, have you changed the configuration from within NetBeans to point to your project? What happens if you open a browser and navigate to http://localhost/myphpproject? Also, if you are running on a specific port, you may have to specify that port.. For example, I use port 8888, so to reach a project within MAMP, I use http://localhost:8888/WhateverTheProjectName. In that you are running XAMPP on Windows, you are probably using port 80. In which case http://localhost/myphpproject should work without specifying a port. Does that work? If so, it is definitely something in the way NetBeans is configured and you will need to adjust the configuration in order to run your project through NetBeans. I don't usually run a project through the IDE. Instead, I go straight to the browser. Let me know after you try going straight to the browser and also check your configuration in NetBeans.

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

2 Comments

Thank you, sir. I changed the Open Result In option to Web Browser as you said. But Output Window option is also starts web browser. If you mean to ask whether my code written correct I'd say that I walk through books so it can't be wrong. localhost/myphpproject directs to localhost/dashboard and displays Xampp welcome screen. And also I configured the ports (to 80) as it must be, there's no any error indication in Xampp control window.
if you open a browser window and type into the address bar localhost/myphpproject and it is still going to the Xampp welcome screen, then you have something configured incorrectly in Xampp. Do you have the myphpproject directory located inside the htdocs directory in Xampp?

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.