exec返回-1 [英] exec returns -1

查看:126
本文介绍了exec返回-1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经将代码缩小到linux上的php / iplanet问题。当我从
命令行运行以下代码时,$ status返回为

" 0"正如它应该。但是当我用浏览器点击它时,状态为-1。

我猜测它与iplanet调用的方式有关

php,或者如何php已编译。奇怪的是,我使用php 4& 5在Windows上运行相同的设置

并且它总是返回0。幸运的我

我想......有谁知道如何解决这个问题?它是否像使用其他选项重新编译一样简单?


您可以在此处查看我的结果: http://www.69camaro.us/test/go.php


操作系统:fedora C4

PHP:4.4.2

Iplanet:6.1 sp5


<?php


$ command =''echo" hello world"'';

$ results = array();

$ Output = exec($命令,$ results,$ status);


print"输出:$输出< br>< br>" ;;

打印"命令:$ command< br>" ;;

打印"结果:$结果< br>" ;;

print"状态:$ status< br>" ;;


?>

解决方案

状态"返回为

" 0"正如它应该。但是当我用浏览器点击它时,状态为-1。

我猜测它与iplanet调用的方式有关

php,或者如何php已编译。奇怪的是,我使用php 4& 5在Windows上运行相同的设置

并且它总是返回0。幸运的我

我想......有谁知道如何解决这个问题?它是否像使用其他选项重新编译一样简单?


您可以在此处查看我的结果: http://www.69camaro.us/test/go.php


操作系统:fedora C4

PHP:4.4.2

Iplanet:6.1 sp5


<?php


command =''echo" hello world"'';


results = array();

I''ve narrowed the code to a problem with php/iplanet on linux. When I
run the following code from the command line "$status" comes back as
"0" as it should. However when I hit it with a browser, status is "-1".
Im guessing it has something to do with the way iplanet is invoking
php, or how php was compiled. Oddly enough I have the same setup
running on windows with php 4&5 and it always returns "0". Lucky for me
I suppose... Anyone know how to fix this? Is it as simple as
recompiling with additional options?

You can view my results here: http://www.69camaro.us/test/go.php

OS: fedora C4
PHP: 4.4.2
Iplanet: 6.1 sp5

<?php

$command=''echo "hello world"'';
$results = array();
$Output = exec($command, $results, $status);

print " Output: $Output<br><br>";
print "command: $command <br>";
print "results: $results <br>";
print " status: $status <br>";

?>

解决方案

status" comes back as
"0" as it should. However when I hit it with a browser, status is "-1".
Im guessing it has something to do with the way iplanet is invoking
php, or how php was compiled. Oddly enough I have the same setup
running on windows with php 4&5 and it always returns "0". Lucky for me
I suppose... Anyone know how to fix this? Is it as simple as
recompiling with additional options?

You can view my results here: http://www.69camaro.us/test/go.php

OS: fedora C4
PHP: 4.4.2
Iplanet: 6.1 sp5

<?php


command=''echo "hello world"'';


results = array();


这篇关于exec返回-1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆