PHP 编译问题 - 停留在“生成 phar.phar”处

PHP 编译问题 - 停留在“生成 phar.phar”处

我在一台“有点定制”的 Centos 6/cPanel 服务器上从源代码编译 PHP 时遇到了问题。过去它通常可以正常工作,但现在不行。在此机器上编译了许多不同的 PHP,没有出现更大的问题。目前,任何版本的 PHP 都卡在:

'Generating phar.phar'.

一些输出:

Prerequisite `/root/php-7.0.13/ext/phar/phar/phar.inc' is older than target         `ext/phar/phar/phar.inc'.
  No need to remake target `ext/phar/phar/phar.inc'.
  Pruning file `/root/php-7.0.13/ext/phar/phar/clicommand.inc'.
  Pruning file `/root/php-7.0.13/ext/phar/phar/directorygraphiterator.inc'.
  Pruning file `/root/php-7.0.13/ext/phar/phar/directorytreeiterator.inc'.
  Pruning file `/root/php-7.0.13/ext/phar/phar/invertedregexiterator.inc'.
  Pruning file `/root/php-7.0.13/ext/phar/phar/pharcommand.inc'.
  Pruning file `/root/php-7.0.13/ext/phar/phar/phar.inc'.
  Pruning file `/root/php-7.0.13/ext/phar/phar/phar.php'.
  Pruning file `sapi/cli/php'.
  Finished prerequisites of target file ext/phar/phar.phar'.
  Must remake target ext/phar/phar.phar'.
  Putting child 0x022ef310 (ext/phar/phar.phar) PID 22348 on the chain.
  Live child 0x022ef310 (ext/phar/phar.phar) PID 22348 
  Generating phar.phar
  Reaping winning child 0x022ef310 PID 22348 
  Live child 0x022ef310 (ext/phar/phar.phar) PID 22349 
  Reaping winning child 0x022ef310 PID 22349 
  Live child 0x022ef310 (ext/phar/phar.phar) PID 22350 
  Reaping winning child 0x022ef310 PID 22350 
  Live child 0x022ef310 (ext/phar/phar.phar) PID 22351

我尝试过只创建 1 个线程,但是没有帮助。

'清理'之后:

Considering target file `/root/php-7.0.13/ext/phar/phar/phar.inc'.
  File `/root/php-7.0.13/ext/phar/phar/phar.inc' was considered already.
  Considering target file `/root/php-7.0.13/ext/phar/phar/phar.php'.
  File `/root/php-7.0.13/ext/phar/phar/phar.php' was considered already.
  Considering target file `sapi/cli/php'.
  File `sapi/cli/php' was considered already.
 Finished prerequisites of target file `ext/phar/phar.phar'.
 Must remake target `ext/phar/phar.phar'.
 Need a job token; we don't have children
 Putting child 0x00d53610 (ext/phar/phar.phar) PID 17444 on the chain.
 Commands of `ext/phar/phar.phar' are being run.
 Finished prerequisites of target file `pharcmd'.
 The prerequisites of `pharcmd' are being made.
 Finished prerequisites of target file `all'.
 The prerequisites of `all' are being made.
 Live child 0x00d53610 (ext/phar/phar.phar) PID 17444 
 Generating phar.phar
 Reaping winning child 0x00d53610 PID 17444 
 Live child 0x00d53610 (ext/phar/phar.phar) PID 17445 
 Reaping winning child 0x00d53610 PID 17445 
 Live child 0x00d53610 (ext/phar/phar.phar) PID 17446 
Reaping winning child 0x00d53610 PID 17446 
Live child 0x00d53610 (ext/phar/phar.phar) PID 17447

我尝试使用 make-4.2 代替默认的 make-3.81,但是没有任何变化。

一些 strace 输出:

stat("/root/php-7.0.13/ext/phar/phar/phar.php", {st_mode=S_IFREG|0755,,st_size=992, ...}) = 0
stat("ext/phar/phar.phar", 0x7ffc5f1a4930) = -1 ENOENT (No such file or directory)
stat("ext/phar/phar/phar.inc", {st_mode=S_IFREG|0644, st_size=790, ...}) = 0
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 16875
rt_sigprocmask(SIG_BLOCK, [HUP INT QUIT TERM XCPU XFSZ], NULL, 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
stat("/root/php-7.0.13/ext/json/json_scanner.c", {st_mode=S_IFREG|0644,  st_size=29634, ...}) = 0
rt_sigprocmask(SIG_BLOCK, [HUP INT QUIT TERM XCPU XFSZ], NULL, 8) = 0
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
fcntl(4, F_SETFD, FD_CLOEXEC)           = 0
vfork()                                 = 16877
fcntl(3, F_GETFD)                       = 0x1 (flags FD_CLOEXEC)
fcntl(3, F_SETFD, 0)                    = 0
fcntl(4, F_GETFD)                       = 0x1 (flags FD_CLOEXEC)
fcntl(4, F_SETFD, 0)                    = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
wait4(-1, Generating phar.phar
[{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 16877
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=16877, si_status=0, si_utime=0, si_stime=0} ---
rt_sigreturn()                          = 16877
rt_sigprocmask(SIG_BLOCK, [HUP INT QUIT TERM XCPU XFSZ], NULL, 8) = 0
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
fcntl(4, F_SETFD, FD_CLOEXEC)           = 0
vfork()                                 = 16878
fcntl(3, F_GETFD)                       = 0x1 (flags FD_CLOEXEC)
fcntl(3, F_SETFD, 0)                    = 0
fcntl(4, F_GETFD)                       = 0x1 (flags FD_CLOEXEC)
fcntl(4, F_SETFD, 0)                    = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 16878
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=16878,si_status=0, si_utime=0, si_stime=0} ---
rt_sigreturn()                          = 16878
rt_sigprocmask(SIG_BLOCK, [HUP INT QUIT TERM XCPU XFSZ], NULL, 8) = 0
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
fcntl(4, F_SETFD, FD_CLOEXEC)           = 0
vfork()                                 = 16879
fcntl(3, F_GETFD)                       = 0x1 (flags FD_CLOEXEC)
fcntl(3, F_SETFD, 0)                    = 0
fcntl(4, F_GETFD)                       = 0x1 (flags FD_CLOEXEC)
fcntl(4, F_SETFD, 0)                    = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 16879
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=16879, si_status=0, si_utime=0, si_stime=0} ---
rt_sigreturn()                          = 16879
rt_sigprocmask(SIG_BLOCK, [HUP INT QUIT TERM XCPU XFSZ], NULL, 8) = 0
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
fcntl(4, F_SETFD, FD_CLOEXEC)           = 0
vfork()                                 = 16880
fcntl(3, F_GETFD)                       = 0x1 (flags FD_CLOEXEC)
fcntl(3, F_SETFD, 0)                    = 0
fcntl(4, F_GETFD)                       = 0x1 (flags FD_CLOEXEC)
fcntl(4, F_SETFD, 0)                    = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
wait4(-1, 

答案1

解决方案已找到,目前看来很简单,可惜我没早点发现。在 strace 子进程之后,它显示它正在使用另一个损坏的 PHP 构建的 phar 编写器 - 并且该子进程由于库依赖性错误而挂起,因此这就是有问题的进程在等待的原因。指向正确的二进制文件后,它就起作用了。

相关内容