0

I am running PhpStorm's built-in server locally on port 8888. I also checked "use router script" in the Run/Debug Configurations and pointed it to my routes.php.

But when I run localhost:8888 in the browser, I get an error of

Class 'Route' not found in .../routes.php on line 23.

Any advise?

LazyOne
  • 158,824
  • 45
  • 388
  • 391
user-123
  • 874
  • 1
  • 13
  • 34
  • 1
    PhpStorm's built-in web server does not allow to specify any routes. I assume you mean [PHP's built-in web server](http://php.net/manual/en/features.commandline.webserver.php) (same as `php artisan serve` basically) – LazyOne Jan 15 '18 at 23:11

1 Answers1

1

You need to use server.php (at the root of your project) as the router script - that's the entry point into the application. routes.php just defines the routes themselves, rather than executing anything.

iainn
  • 16,826
  • 9
  • 33
  • 40
  • Thanks, it seems better, but now it says: "Function mcrypt_get_iv_size() is deprecated" – user-123 Jan 15 '18 at 23:12
  • 1
    You'll get that warning whenever you try and use the `mcrypt_*` functions in PHP 7.1. Those functions are removed entirely in PHP 7.2, so it's just giving you some advance warning. You'll need to migrate to something more up to date in future, but for now you can hide the error messages. See https://stackoverflow.com/questions/2803772/turn-off-deprecated-errors-php-5-3 for some details (it's not PHP 5.3 specific) – iainn Jan 15 '18 at 23:19
  • 1
    Actually, for Laravel, this link might be more useful: https://stackoverflow.com/questions/41031076/php7-1-and-laravel-5-3-function-mcrypt-get-iv-size-is-deprecated – iainn Jan 15 '18 at 23:20
  • Thanks! Can you please also help me debug it? I have xdebug installed, but if I simply put a breakpoint in one of my route methods, it does not stop there – user-123 Jan 15 '18 at 23:25
  • 1
    Not very easily in the comments, that could be a few different things. You might be better off asking a new question if you're still having problems. Laracasts has a few tutorial videos here that might be useful: https://laracasts.com/series/how-to-be-awesome-in-phpstorm – iainn Jan 15 '18 at 23:33