无法在Linux上启动laravel开发服务器 [英] Unable to start laravel development server on linux

查看:266
本文介绍了无法在Linux上启动laravel开发服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为项目使用laravel 5,并且一切都工作正常,但是最近我遇到了这个问题,我确实理解了.

I am using laravel 5 for my project and everything has been working fine but recently I am facing this problem which I done understand.

devboy@devboy-hp ~/sonel_ims_project/ims_eneo $ php artisan serve
Laravel development server started on http://localhost:8000/
[Fri Nov 13 12:00:56 2015] Failed to listen on localhost:8000 (reason: Address already in use)

我已经尝试过devboy@devboy-hp ~ $ sudo netstat -plnt并获得

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 192.168.122.1:53        0.0.0.0:*               LISTEN      1840/dnsmasq    
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      1985/cupsd      
tcp        0      0 127.0.0.1:8888          0.0.0.0:*               LISTEN      7563/php-5.6.3  
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      1656/master     
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      6966/httpd      
tcp        0      0 0.0.0.0:445             0.0.0.0:*               LISTEN      740/smbd        
tcp        0      0 127.0.0.1:6942          0.0.0.0:*               LISTEN      7442/java       
tcp        0      0 127.0.0.1:8000          0.0.0.0:*               LISTEN      6931/php-5.6.3  
tcp        0      0 0.0.0.0:6667            0.0.0.0:*               LISTEN      1539/ircd       
tcp        0      0 0.0.0.0:139             0.0.0.0:*               LISTEN      740/smbd        
tcp        0      0 127.0.0.1:63342         0.0.0.0:*               LISTEN      7442/java       
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      6966/httpd      
tcp6       0      0 :::21                   :::*                    LISTEN      7337/proftpd: (acce
tcp6       0      0 ::1:631                 :::*                    LISTEN      1985/cupsd      
tcp6       0      0 :::3128                 :::*                    LISTEN      1416/squid3     
tcp6       0      0 :::25                   :::*                    LISTEN      1656/master     
tcp6       0      0 :::445                  :::*                    LISTEN      740/smbd        
tcp6       0      0 :::3306                 :::*                    LISTEN      7343/mysqld     
tcp6       0      0 :::139                  :::*                    LISTEN      740/smbd  

然后我像这样更改端口php artisan serve --port="8888" 但过一会儿,出现类似下面的错误:

Then I change port like so php artisan serve --port="8888" but get similar error like below after a while:

Laravel development server started on http://localhost:8888/
[Fri Nov 13 12:01:02 2015] Failed to listen on localhost:8888 (reason: Address already in use)

这是第一次,它是使用端口8000的Java,所以我终止了该进程并启动了服务器,它开始工作了.停止并重新启动后,出现相同的错误.可能是什么问题(我说过,除了现在,一切都很好,而且我还没有做任何重大更新)?

The first time it happened, it was java using port 8000, so I killed the process and started the server and it worked. Upon stopping and restarting, I get the same error. What could be the problem (as I said everything has been working fine except now and I have not done any major update)?

推荐答案

这正是我针对此问题所做的事情.

This is exactly what I did for the problem.

  1. 我退出PHPStorm
  2. sudo netstat -plnt
  3. kill 7563 (Process using port 8888)
  4. kill 6931 (Process using port 8000)
  5. sudo /opt/lampp/lampp restart(完全重新启动服务器)
  6. php artisan serve
  7. 启动PhpStorm
  1. I exit PHPStorm
  2. sudo netstat -plnt
  3. kill 7563 (Process using port 8888)
  4. kill 6931 (Process using port 8000)
  5. sudo /opt/lampp/lampp restart (Restart my server altogther)
  6. php artisan serve
  7. Launch PhpStorm

现在一切正常.反正是什么原因造成的?

Now everything is working fine. What caused the problem anyway?

这篇关于无法在Linux上启动laravel开发服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆