Linux云服务器运行php artisan serve提示Operation not permitted求助
无法在无root权限的Linux云服务器上运行
php artisan serve 已将本地运行正常的Laravel项目上传至通过SSH连接的Linux云服务器,尝试执行php artisan serve启动开发服务器时失败,返回如下错误输出:
Starting Laravel development server: http://127.0.0.1:8000 [Tue Oct 31 ... 2023] Failed to listen on 127.0.0.1:8000 (reason: Operation not permitted) Starting Laravel development server: http://127.0.0.1:8001 [Tue Oct ... 2023] Failed to listen on 127.0.0.1:8001 (reason: Operation not permitted) Starting Laravel development server: http://127.0.0.1:8002 [Tue Oct ... 2023] Failed to listen on 127.0.0.1:8002 (reason: Operation not permitted) Starting Laravel development server: http://127.0.0.1:8003 [Tue Oct ... 2023] Failed to listen on 127.0.0.1:8003 (reason: Operation not permitted) Starting Laravel development server: http://127.0.0.1:8004 [Tue Oct 31 ... 2023] Failed to listen on 127.0.0.1:8004 (reason: Operation not permitted) ...
已尝试以下解决方案,但均无效:
- 重启
php artisan serve进程:服务器上无该进程运行 - 检查端口可用性:执行端口检查命令返回错误
netstat: lnt: unknown or uninstrumented protocol,尝试8000上下数十个端口均无法启动服务,排除端口占用问题 - 修改php.ini文件:调整variables_order、扩展等多项配置,无效果
- 更新Composer:因无服务器root权限,执行更新时提示权限拒绝:
Composer update failed: "/usr/local/bin/composer.phar" could not be written. rename(/usr/local/bin/composer.phar): Failed to open stream: Permission denied
谷歌搜索未找到针对该"reason: Operation not permitted"错误的有效解决方案,请问还有其他可行方案吗?是否必须拥有root权限,或者需要更换主机?
环境信息
- Composer版本:1.10.26
- PHP版本:8.1.21
- Laravel框架:8.83.27(
php artisan -V输出结果)
内容的提问来源于stack exchange,提问作者Felix
相关产品推荐
相关产品推荐

