开发者

What does "Ambiguous output redirect" mean?

开发者 https://www.devze.com 2023-03-25 19:51 出处:网络
I have a PHP script that I want to call on some form action. This command works fine: /usr/local/bin/php -q 开发者_如何学JAVAscript.php > /dev/null 2>&1 &

I have a PHP script that I want to call on some form action.

This command works fine:

/usr/local/bin/php -q 开发者_如何学JAVAscript.php > /dev/null 2>&1 &

But it all go wrong when I add arguments in the command:

/usr/local/bin/php -q script.php --var=value > /dev/null 2>&1 &

it returns "Ambiguous output redirect".

I have read this http://www.xaprb.com/blog/2006/06/06/what-does-devnull-21-mean/ article too, and have tried almost everything possible as far as I can understand, and still have no idea how to fix it.

Please help me.


I assume you're using csh or one of its variants, use:

... >&/dev/null


You should try this :

/usr/local/bin/php -q script.php --var=value > &1 &

And let us know the consequences of running this command.

Do you get output properly redirected?

I believe that this error is somehow related to user rights on the OS. I ran your exact same command on a test environment running AiX using root user and it worked OK but once I tried as some other user , I get the 'Ambiguous Redirect error'.

Either the user does not have access to the STDERR,STDOUT pointer or access permissions restrict redirect chaining in some way.

Hope this helps. EDIT: Maybe this link can help: http://www.faqs.org/faqs/unix-faq/faq/part2/section-9.html


Does the following work for you:

/usr/local/bin/php -q script.php --var=value > /dev/null 2>/dev/null & 
0

精彩评论

暂无评论...
验证码 换一张
取 消