返回:
fopen(/www/wwwroot/test.com/extend/workerman/workerman-4.1.4/../_www_wwwroot_test.com_test.php.pid.lock): Failed to open stream: Permission denied in file /www/wwwroot/test.com/extend/workerman/workerman-4.1.4/Worker.php on line 642
Workerman[test.php] stop
Workerman[test.php] is stopping ...
Workerman[test.php] stop success
cd "/www/wwwroot/test.com/" && php test.php start -d
返回:
fopen(/www/wwwroot/test.com/extend/workerman/workerman-4.1.4/../_www_wwwroot_test.com_test.php.pid.lock): Failed to open stream: Permission denied in file /www/wwwroot/test.com/extend/workerman/workerman-4.1.4/Worker.php on line 642
Workerman[test.php] start in DAEMON mode
fopen(/www/wwwroot/test.com/extend/workerman/workerman-4.1.4/../_www_wwwroot_test.com_test.php.pid.lock): Failed to open stream: Permission denied in file /www/wwwroot/test.com/extend/workerman/workerman-4.1.4/Worker.php on line 642
------------------------------------------- WORKERMAN --------------------------------------------
Workerman version:4.1.4 PHP version:8.0.22 Event-Loop:\Workerman\Events\Select
-------------------------------------------- WORKERS ---------------------------------------------
proto user worker listen processes status
tcp www OrderWorker text://0.0.0.0:12345 300 [OK]
Input "php test.php stop" to stop. Start success.
防止并发启动的锁文件,忽略即可
好的,谢谢
php中执行exec,几天里,陆陆续续的重复操作之后,会出现这种报错:
权限问题?很奇怪,就一直是exec自己的执行。
cd "/www/wwwroot/test.com/" && php test.php stop
返回:
fopen(/www/wwwroot/test.com/extend/workerman/workerman-4.1.4/../_www_wwwroot_test.com_test.php.pid.lock): Failed to open stream: Permission denied in file /www/wwwroot/test.com/extend/workerman/workerman-4.1.4/Worker.php on line 642
Workerman[test.php] stop
Workerman[test.php] is stopping ...
Workerman[test.php] stop success
cd "/www/wwwroot/test.com/" && php test.php start -d
返回:
fopen(/www/wwwroot/test.com/extend/workerman/workerman-4.1.4/../_www_wwwroot_test.com_test.php.pid.lock): Failed to open stream: Permission denied in file /www/wwwroot/test.com/extend/workerman/workerman-4.1.4/Worker.php on line 642
Workerman[test.php] start in DAEMON mode
fopen(/www/wwwroot/test.com/extend/workerman/workerman-4.1.4/../_www_wwwroot_test.com_test.php.pid.lock): Failed to open stream: Permission denied in file /www/wwwroot/test.com/extend/workerman/workerman-4.1.4/Worker.php on line 642
------------------------------------------- WORKERMAN --------------------------------------------
Workerman version:4.1.4 PHP version:8.0.22 Event-Loop:\Workerman\Events\Select
-------------------------------------------- WORKERS ---------------------------------------------
proto user worker listen processes status
tcp www OrderWorker text://0.0.0.0:12345 300 [OK]
Input "php test.php stop" to stop. Start success.
很明显,执行exec的进程无权限
可是,这个一直是在exec在操作,一开始是正常的,后面才出现这个权限的提示,不知道为什么。我想问的是,为什么要有lock文件,一开始这个lock文件是不存在的。
例如执行exec的是php-fpm进程,php-fpm用户一般是apache、www、www-data,权限很低。
如果你用exec执行的
php start.php start
,那么exec执行php start.php stop
没权限问题。但是如果你用root用户手动执行了
php start.php start
,进程权限是root,php-fpm里exec执行php start.php stop
就没有权限谢谢,你说的有道理。中间我用exec stop后,有root start,再root stop。在此之后,又exec start,估计这个过程中发生了什么权限上的问题。但不曾root start后用exec stop。谢谢。