2011-06-24 38 views
0

我試圖運行這個簡單的腳本:剛開錯誤運行時,簡單的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." ".$SERVER, 'r'); 

?> 

但我總是得到這個消息框的Windows錯誤:

Windows cannot find c:\program. Please make sure you typed the name correctly and then try again. 

搜索在谷歌我也覺得這thread關於這個錯誤,但我猜測我是litlle激烈的meassures。
所以這個問題在我的代碼?或者可能有其他問題?

謝謝。

回答

1

您需要跳過$PHP_PATH = "c:\Program Files (x86)\PHP\\";中的空格!

+0

你能告訴我怎麼樣嗎?我通常不用PHP程序,謝謝 – Kobe

+1

@vBx'addcslashes($ path,'')' –

+0

@Linus Kleen:我做了這些addcslashes($ PHP_PATH,''); PHP_PATH後,但仍然得到相同的錯誤 – Kobe