0

I have the following problem. I started working with the Laravel framework and I'm using the PhpStorm IDE.

Everything works fine if I use the PHP built-in webserver. I execute the following command in the cmd:

C:\phpProjects\project03>php -S localhost:8000 -t public

Everything works fine with this local server. I can access the project in the browser. The welcome page works with http://localhost:8000/ in the browser and a test route "foo" which is a simple "Hello World" works with http://localhost:8000/foo.

But I don't want to start a test server manually. This is why I want to use the PhpStorm's built-in webserver.

The Welcome Page works fine with http://localhost:63342/project03/ but every other route like "foo" which I want to access with http://localhost:63342/project03/foo leads to a "404 Not Found PhpStorm 2018.2" error.

Does anyone have an idea what the problem could be?

LazyOne
  • 158,824
  • 45
  • 388
  • 391
  • Try adjusting your APP_URL or something -- the extra `project03/` part in URL is what must be causing the issue. Plus, PhpStorm's built-in web server is meant for simple stuff .. and you have basically URL-rewriting here (it's handled internally but still). When requesting `/project03/foo` IDE literally looks for `foo` file, it does not pass execution to `index.php` like it normally happens. – LazyOne Aug 07 '18 at 08:12
  • **P.S.** Why not just keep using PHP web server (or proper web server)? You can create Run/Debug Configuration that will start PHP's web server, you can also use Startup Tasks functionality -- it will allow execute certain commands/configs when project is opened. With proper web server (Apache/nginx/IIS) you will not have to start it as it always will be ready for you. – LazyOne Aug 07 '18 at 08:14
  • 1
    Why not use `php artisan serve` instead which supports rewrite? The default PHP server does not – apokryfos Aug 07 '18 at 08:40

0 Answers0