视窗相当于#!的/ usr / bin中/ PHP [英] Windows equivalent to #!/usr/bin/php

查看:173
本文介绍了视窗相当于#!的/ usr / bin中/ PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图执行从SOS柏林的jobscheduler的PHP文件。我的操作系统是Windows 7,我的文档以下

http://www.sos-berlin.com/mediawiki/index.php/How_to_execute_a_PHP_script_with_JS

 #!的/ usr / bin中/ PHP< PHP 回声你好;?>

但是,当我执行我收到错误的脚本

 '#!'不被识别为内部或外部的命令,可操作的程序或批处理文件。

我才明白,#!的/ usr / bin中/ PHP是一个linux命令。我应该在这里给等效的批处理命令。我用Google搜索,但没有发现任何有用的结果。请任何一个可以帮助我...

先谢谢了。


解决方案

  1. 转到您的桌面。

  2. 右键单击桌面我的电脑快捷方式。

  3. 单击属性。

  4. 您应该看到控制面板的一个部分 - 控制面板\\系统和安全\\系统

  5. 单击高级系统设置在左侧菜单中。

  6. 单击Enviornment变量对窗口的底部。

  7. 在用户变量列表
  8. 选择路径。

  9. 附加你的PHP路径(C:\\ MyFolder文件\\ PHP)到PATH环境变量,由分号从已经存在的字符串分隔

  10. 单击确定

  11. 打开你的CMD

  12. 键入PATH,preSS输入

  13. 确保你看到的名单当中你的PHP文件夹中。

这应该工作。

I am trying to execute a php file from sos-berlin jobscheduler. My OS is windows 7. I am following the documentation

http://www.sos-berlin.com/mediawiki/index.php/How_to_execute_a_PHP_script_with_JS

#!/usr/bin/php

<?php 

 echo "hello";

?>

But when I executed the script I am getting the error that

'#!' is not recognized as an internal or external command, operable program or batch file.

I came to understand that #!/usr/bin/php is a linux command. I should give here equivalent batch command. I googled, but didn't find any useful result. Please any one help me...

Thanks in advance.

解决方案

  1. Go to your desktop.
  2. Right click My Computer shortcut in the desktop.
  3. Click Properties.
  4. You should see a section of control Panel - Control Panel\System and Security\System.
  5. Click Advanced System Settings on the Left menu.
  6. Click Enviornment Variables towards the bottom of the window.
  7. Select PATH in the user variables list.
  8. Append your PHP Path (C:\myfolder\php) to your PATH variable, separated from the already existing string by a semi colon.
  9. Click OK
  10. Open your "cmd"
  11. Type PATH, press enter
  12. Make sure that you see your PHP folder among the list.

That should work.

这篇关于视窗相当于#!的/ usr / bin中/ PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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