Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/248.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
运行简单php脚本时出错_Php - Fatal编程技术网

运行简单php脚本时出错

运行简单php脚本时出错,php,Php,我正在尝试运行以下简单脚本: <?php $PHP_PATH = "c:\Program Files (x86)\PHP\\"; $CLIENTPATH = dirname(__FILE__)."\Client.php"; $SERVER = "http://localhost:8080/mobile/Server"; $handle = popen("C:\WINDOWS\system32\cmd /C start ".$PHP_PATH." -f ".$CLIENTPATH." "

我正在尝试运行以下简单脚本:

<?php

$PHP_PATH = "c:\Program Files (x86)\PHP\\";
$CLIENTPATH = dirname(__FILE__)."\Client.php";
$SERVER = "http://localhost:8080/mobile/Server";

$handle = popen("C:\WINDOWS\system32\cmd /C start ".$PHP_PATH." -f ".$CLIENTPATH." ".$SERVER, 'r');

?>
在谷歌上搜索时,我也发现了这一错误,但我想问题不大。
那么问题出在我的代码里了?或者可能还有其他问题


谢谢。

您需要转义
$PHP_PATH=“c:\Program Files(x86)\PHP\\”中的空格

你能告诉我怎么做吗?我通常不会用php编程,thanks@vBx
addcslashes($path,”)
@Linus Kleen:我做了这个addcslashes($PHP_path,”);在PHP_路径之后,但仍然得到相同的错误OK。我把它拼出来了:
$PHP\u PATH=addcslashes($PHP\u PATH,”)
。或者,您可以将路径用引号括起来(即
popen(“C:\…”“$PHP\u path。”'-f…)
)。
Windows cannot find c:\program. Please make sure you typed the name correctly and then try again.