2

我正在尝试使用 PHPexec在 windows running 上运行来自 git 的拉取请求XAmppexec当使用or运行下面的脚本system并尝试访问该文件时,页面永远不会停止加载。我检查了目录的文件权限,它们都是 0777。git status运行正常。不确定是什么问题。

<?php
ignore_user_abort(true);
set_time_limit(15);
exec('git pull origin master', $o);
echo implode("\n", $o);
?>

更新帐户上没有密码:

C:\xampp\htdocs>git pull origin master
From github.com:************
 * branch            master     -> FETCH_HEAD
Already up-to-date.

C:\xampp\htdocs>

从终端运行我得到:

C:\xampp\htdocs>php -f update.php
PHP Warning:  PHP Startup: ming: Unable to initialize module
Module compiled with build ID=API20090626,TS,VC6
PHP    compiled with build ID=API20090626,TS,VC9
These options need to match
 in Unknown on line 0

Warning: PHP Startup: ming: Unable to initialize module
Module compiled with build ID=API20090626,TS,VC6
PHP    compiled with build ID=API20090626,TS,VC9
These options need to match
 in Unknown on line 0
From github.com:*********
 * branch            master     -> FETCH_HEAD
Already up-to-date.
C:\xampp\htdocs>
4

1 回答 1

0

Instead of using exec, which waits until the process is finished, use passthru and make sure you disabled output buffering. This way you'll immediately see what the problem is.

于 2012-05-25T20:24:50.413 回答