Apache服务的PHP的exec不工作 [英] apache service php exec not working

查看:403
本文介绍了Apache服务的PHP的exec不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我抬起头,所有与此相关的其他问题,但他们并没有帮助,所以:

I looked up all other questions regarding this, but they didn't help, so:

我运行Windows Server 2003的计算机上的XAMPP(精简版)域里面,Apache是​​作为服务安装。现在的问题是:PHP函数的exec,系统,中继等什么也不做,没有错误消息(日志的Apache级调试,PHP的error_reporting E_ALL是),不执行程序,什么都没有,它充当如果函数调用WASN ŧ有

I'm running xampp(lite) on a Windows Server 2003 machine inside a domain, apache is installed as a service. The problem is: the PHP functions exec, system, passthru, etc. do nothing, no error messages (log level of apache is debug, php error_reporting is E_ALL), no program execution, nothing, it acts as if the function call wasn't there

我尝试不同的方法: EXEC,系统,..; proc_open WScript.Shell COM 对象,毫无效果。我尝试使用绝对路径,给权限的用户,尝试做不同的东西吨不同的.exe的,没有什么工作,什么每一个被执行。

I tried different approaches: exec, system, ..; proc_open and the WScript.Shell COM object, nothing worked. I tried using the absolute path, gave permissions to the user, tried tons of different .exe's doing different stuff, nothing worked, nothing every was executed.

我给Apache服务的我的用户名;确定了它的自己的apache用户;给它的系统用户,并选中允许与桌面交互

I gave the Apache service my username; gave it its own apache user; gave it the system user and ticked "Allow interaction with desktop".

PHP safe_mode设置为关闭,也没有功能被禁止。

php safe_mode is off, also no functions are disabled.

在运行的Apache并不如服务,一切完美的作品。

When running apache NOT as as service, everything works perfectly.

任何想法可能是错误的?

Any idea what could be wrong?

TIA

推荐答案

如果您尝试从Vista中的一个服务启动GUI应用程序,你就会有很多麻烦。作为一项安全功能,Vista的调解服务的交互使用互动服务检测桌面。

If you try to launch GUI apps from a service in Vista, you'll have lots of trouble. As a security feature, Vista mediates the interaction of services with the desktop using 'Interactive Services Detection'.

这意味着,如果你运行PHP作为Apache服务的模块,您将无法启动GUI应用使用任何方法。这种事情是不会工作:

That means, if you are running PHP as a module of an Apache service, you won't be able to launch GUI apps using any method. This kind of thing just won't work:

$ =的WshShell新的COM(WScript.Shell);
$ oExec = $ WshShell->运行(NOTEPAD.EXE,7,FALSE);

$WshShell = new COM("WScript.Shell"); $oExec = $WshShell->Run("notepad.exe", 7, false);

所以,如果你想使用Apache / PHP作为发动GUI应用代理,你需要运行Apache作为控制台应用程序。

So, if you want to use Apache/PHP as a proxy for launching GUI apps, you'll need to run Apache as a console application.

首先,如果Apache已经作为服务安装,你需要设置其启动类型为手动使用服务管理单元。 (%SYSTEMROOT%\\ SYSTEM32 \\ Services.msc)中搜索服务在开始菜单的搜索框。

First, if Apache is already installed as a service, you'll need to set it's startup type to "manual" using the services snap-in. (%SystemRoot%\system32\services.msc) Search for Services in the start menu search box.

然后一个快捷方式添加到C:\\ apache的\\斌\\ httpd.exe(或任何已安装的Apache),以启动文件夹,并设置快捷方式启动最小化。您可以使用一个应用程序像TrayIt!中强制Apache下到系统托盘中。

Then add a shortcut to C:\apache\bin\httpd.exe (or wherever Apache is installed) to your Startup folder, and set that shortcut to start minimized. You can use an app like TrayIt! to force Apache down into the system tray.

然后使用任何列出的PHP网站上的方法,你将能够从PHP打开一个Windows应用程序,看看它的图形用户界面。

Then use any of the methods outlined on the PHP website and you will be able to open a Windows application from PHP and see it's GUI.

这篇关于Apache服务的PHP的exec不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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