Search code examples
phpstorm

What is the difference between PHPStorm localhost, and the usual XAMPP localhost?


I am using PHPStorm with XAMPP.

What is the difference between:

http://localhost:63342/PhpstormProjects/project.php

And

http://localhost/PhpstormProjects/project.php

It seems like this two are different localhosts. The first one works only with PHPStorm opened.

Now I have a problem with the first one, it keeps throwing an 500 Internal Server error and I can not figure out why. But the Localhost from the second url does not.

So is there a way to tell PHPStorm, to randomly use the Localhost without the 63342?


Solution

  • The first one is PhpStorm's own simple built-in web server which IDE uses by default when you choose to open file in browser and alike from IDE and when you do not specify your own URL.

    In order to use it you need to have local PHP Interpreter defined (as it needs actual PHP to process your .php files).

    In general the URL is: localhost:63342/YOUR_PROJECT_NAME/path/to/file.php.

    You can read a bit more about it here.


    The second one is your actual XAMPP -- it uses default & standard for http protocol port 80.