2

I'am using Symfony and Laravel on same machine. I'am on developement, and I have no webserver, I use the local server of each of them.

For Symfony, that works :

$ cd /var/www/symfony
$ php bin/console server:start

 [OK] Server listening on http://127.0.0.1:8000   

For Laravel, that does not work :

$ cd /var/www/laravel
$ php artisan serve
Laravel development server started: <http://127.0.0.1:8000>
[Thu Oct 12 21:46:21 2017] Failed to listen on 127.0.0.1:8000 

When I stop the Symfony, then the Laravel works. There is a conflict between the 2 tools.

I am obliged to have the 2 working, because there is a REST-API on my Lavavel site and my symfony site is a client of this API.

How can I run the 2 sites with local development server, without installing a webserver ?

Charlotte
  • 46
  • 2
  • check this answer https://stackoverflow.com/questions/17990820/set-port-for-php-artisan-php-serve – Giacomo M Oct 12 '17 at 20:01
  • Possible duplicate of [Set port for php artisan.php serve](https://stackoverflow.com/questions/17990820/set-port-for-php-artisan-php-serve) – Webdesigner Oct 12 '17 at 20:08
  • You can't run both on the same port. Change one of them e.g. `php artisan serve --port=8080` – Webdesigner Oct 12 '17 at 20:10

2 Answers2

1

Your problem is that you can not share the same port on the same host.

I don't know Laravel, but I know Symfony. With Symfony you can change the port of the local server with this command :

php bin/console server:stop
php bin/console server:start 127.0.0.1:8080

After this command, you can try to restart your Laravel server, and you will have :

Arno
  • 1,309
  • 14
  • 20
0

Use below command for run laravel project.

php artisan serve --port=8888

Using this command you can run laravel project in a different port.

Sujal Patel
  • 2,444
  • 1
  • 19
  • 38