Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bad interpreter: Text file busy #813

Merged
merged 1 commit into from
Sep 21, 2022
Merged

Conversation

Yurunsoft
Copy link
Contributor

如果 PHP 文件本身就是可执行文件:

test.php

#!/usr/bin/env php
<?php
use Workerman\Worker;

require_once __DIR__ . '/vendor/autoload.php';

$worker = new Worker('http://0.0.0.0:8080');
// 运行worker
Worker::runAll();

执行:./test.php start 后给 test.php 加锁期间,如果又执行了 ./test.php 会提示:-bash: ./test.php: /usr/bin/env: bad interpreter: Text file busy

@walkor
Copy link
Owner

walkor commented Sep 21, 2022

在什么情况下会并发执行 ./test.php start

@Yurunsoft
Copy link
Contributor Author

imi 框架支持 Workerman 容器,然后有个 bin/imi-workerman 作为入口。

imi 支持通过命令行参数传启动哪几个 Server。

另外就是由于 fopen 打开一个可执行文件后,即便不加锁,这个可执行文件也没法运行,Workerman 里没有关闭这个锁文件,也是个问题。

就连 ./test.php stop 也没法执行了。

@walkor walkor merged commit d356c61 into walkor:4.1 Sep 21, 2022
@walkor
Copy link
Owner

walkor commented Sep 21, 2022

已合并

walkor added a commit that referenced this pull request Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants