请通过php系统和exec帮助推出程序 [英] please help lauching programs through php system and exec

查看:62
本文介绍了请通过php系统和exec帮助推出程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尊重我已经使用php启动了一个应用程序。比如nmapfe或ethreal,但系统和exec等基本功能并不起作用...安全模式也关闭..请告诉我使用超链接或按钮来实现这些控制台应用程序......

其他etst返回系统命令就像ls ...但是控制台没有打开

解决方案

你是双重发布! 请在发布前阅读 发布指南 这个论坛!。双线程被移除。


关于你的问题。由于您在安全模式下运行,因此必须采取一些预防措施。


如果在安全模式下使用PHP,则system()和执行系统程序的其他函数拒绝启动不在此目录中的程序。您必须在包括Windows在内的所有环境中使用/作为目录分隔符。


注意:启用安全模式后,您只能在safe_mode_exec_dir中执行可执行文件。出于实际原因,目前不允许在可执行文件的路径中包含..组件。


启用安全模式后,命令字符串将使用escapeshellcmd()进行转义。因此,回显y | echo x变为echo y \ |回声x。



您是否从与脚本相同的目录中启动了这些应用程序?


Ronald:很酷:


抱歉双重发布。

并且我已经说过我的安全模式ooption没有开启......因为这可能导致混乱。现在怎么能像nmapfe

或ethreal这样的应用程序启动它作为控制台。其他命令如ls和echo也是一样的。

例子

system(ethereal); //这不起作用



system(" ls")://但这样可以显示结果... text
<这是什么问题。

是不是可以这样做..在php

thankyou。

再次抱歉双重发布


您需要检查您的Web服务运行的用户。

视环境而定对于该用户,您尝试调用的程序可能不存在于

中指定的文件夹中

respected i have launch a application using the php . like nmapfe or ethreal but the basic functions like system and exec is not workiking ... the safe mode is also off .. please tell me the way to lauch these kind of console application using hyperlinks or buttons ...
other etst return system commands work like ls ... but console is not opening

解决方案

You are double posting! Please read the Posting Guidelines before you post in this forum!. The double thread is removed.

As to your question. Since you are running in safe mode, you must take some precautions.

If PHP is used in safe mode, system() and the other functions executing system programs refuse to start programs that are not in this directory. You have to use / as directory separator on all environments including Windows.

Note: When safe mode is enabled, you can only execute executables within the safe_mode_exec_dir. For practical reasons it is currently not allowed to have .. components in the path to the executable.

With safe mode enabled, the command string is escaped with escapeshellcmd(). Thus, echo y | echo x becomes echo y \| echo x.

Are you starting these applications of yours from the same directory as your script?

Ronald :cool:


sorry for double posting .
and as i have said that my safe mode ooption is off not on ...as one possible confusion occurs due to that . now how can lauch the application like nmapfe
or ethreal which opens as a console . the other commands like ls and echo are working the same .
example
system("ethereal"); // this is not working
but
system("ls "): // but this is working showing the results ... text



so what is the problem .
is it not possilble to do that .. in php
thankyou .
sorry again for double posting


You will need to check what user your web service is running as.
Depending on the environment for that user, the programs you are trying to call may not exist in the folders specified in the


这篇关于请通过php系统和exec帮助推出程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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