"启动"命令不工作?为什么? [英] "start" command not working ?? Why?

查看:200
本文介绍了"启动"命令不工作?为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用这个code和当我运行本地主机上的PHP脚本它的正常工作

I used this code and it's works fine when I run php script on local host

<?php
echo system('dir');
?>

但是,当我取代命令,因为这

But when I replace the command as this

<?php
 system('start');
?> 

它不为我工作。但是,当我通过CMD执行这个脚本自身也能正常工作。我想知道我可以在系统上运行的CMD当我运行本地主机上的PHP脚本。 请解释这里有什么问题,是否有任何系统的安全问题就在这里。

其他信息

我将它保存在foo.php文件。它的工作,当我运行C:\\ apache的\\ htdocs中\\测试\\ PHP foo.php [ENTER KEY]它是开放的新窗口。但在服务器上运行相同的脚本中。我遇到了问题。在服务器上如果我运行dir命令。我能够呼应所有的DIR present那里。

IMP POINT

服务器我的系统上运行。任何服务器设置更改要求,请您帮助和建议。

It doesn't work for me. But when I executed this script through cmd its also works fine. I want to know how can i run the cmd on the system when i run php script on local host. Please explain what is wrong here and is there any system security problem is here.

Additional Info

i save it on foo.php file. It's working when i running c:\apache\htdocs\test\php foo.php [ENTER KEY] it's open the new window. But during running the same script on server .. I met with problem. While on the server If i running the dir command. I am able to echo all the dir present there.

IMP POINT

Server is running on my system. Any server setting changes required then please help and suggest.

推荐答案

有两个原因:


  1. 启动命令不执行PHP脚本的用户的路径。

  2. 执行PHP脚本的用户不具有执行访问权的启动命令。

  1. The start command is not in the path for the user executing the PHP script.
  2. The user executing the PHP script does not have access right to execute the start command.

有关第一个,你可以给的完整路径启动在你的脚本。

For the first one, you can give the full path to start in your script.

对于第二部分,则需要与服务器管理员联系,要求为正常运行PHP脚本的用户执行权限。

For the second part, you need to contact the server administrator to request execute permissions for the user that normally runs PHP scripts.

如果您从浏览器中运行脚本,用户通常是运行您的Web服务器相同的过程(虽然有些服务器的其他用户的)。请与您的服务器管理员或主机。

If you are running the script from a browser, the user is usually the same process that is running your webserver (although on some servers its a different user). Check with your server admin or host.

这篇关于&QUOT;启动&QUOT;命令不工作?为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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