使用函数 Exec、passthru、System 时出现问题

发布于 2024-11-19 08:34:03 字数 715 浏览 10 评论 0原文

大家好,亲爱的朋友和老师们……心

在我当前项目的设计阶段我错了,我尝试了游戏,不幸的是我错过了一个积极的结果。 呵呵 我一直在使用 AutoHotKey Autoit 或更准确地说,编程语言中的项目,并将源文件转换为 exe。 (每个用户的文件)使用Windows,我是主机或PSP!...

当我通过php函数在这种情况下,(Exec,passthru,System)执行Wine并且文件将运行编译器,函数不起作用!函数passthru,System因为它们的输出,它们的输出是127,这被打掉了。我刚刚订购了一些Linux我想运行PHP,我仍然要处理输出127。

也许我得到了通常的功能,这些功能已经被禁用,但是当我看到我的php.ini文件时,里面的disabled_fuctions有没有任何功能!

不过,我必须说,PHP 不能运行与 SSH 文件和 exe 可以正常运行的命令相同的命令。两者均已生产。很困惑

有遇到过这种情况的朋友请帮忙...

<?php
passthru('/usr/bin/wine /home/adslgpfo/public_html/iwe/Ahk2Exe.exe "/in a.ahk" ', $p);
print_r($p);

echo " - ";

system('wine /home/adslgpfo/public_html/iwe/Ahk2Exe.exe /in b.ahk ', $s);
print_r($s);
?>

Hi all dear friends and teachers ... Heart

In the design phase of my current project I'm wrong and I tried Game, unfortunately I missed a positive result.
HuhHuh
Project in the programming language I've been using AutoHotKey Autoit or better to say, and convert source files to exe. (File for each user) to use Windows, I'm the Host or the PSP!...

When I had her by the php functions in this case, (Exec, passthru, System) implementation of the Wine and the file will run the compiler, the functions do not work! Functions passthru, System because their output, their output is 127, which was beaten off with that. I just ordered some of Linux I want to run PHP, which I still have to deal with the output 127.

Maybe I got the usual functions, these functions have been disabled, but when I saw my php.ini file, inside the disabled_fuctions There was no function!

However, I must say that PHP can not run the same command can be run properly by the SSH files and exe. Both are produced. Confused

The friends that I have experienced this please help ...

<?php
passthru('/usr/bin/wine /home/adslgpfo/public_html/iwe/Ahk2Exe.exe "/in a.ahk" ', $p);
print_r($p);

echo " - ";

system('wine /home/adslgpfo/public_html/iwe/Ahk2Exe.exe /in b.ahk ', $s);
print_r($s);
?>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

自由如风 2024-11-26 08:34:03

如果启用 PHP safe_mode,则隐式禁用 exec 函数:

http://php.net/manual/features.safe-mode.functions.php

你必须禁用它,或者做一些使用 safe_mode_exec_dir 进行繁琐的解决方法,以允许执行 wine

If the PHP safe_mode is enabled, then the exec functions are disabled implicitly:

http://php.net/manual/features.safe-mode.functions.php

You will have to disabled that, or do some cumbersome workarounds with the safe_mode_exec_dir to allow wine to be executed.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文