Adrian
Adrian

Reputation: 20068

Gettin error when running simple php script

I'm trying to run this simple script:

<?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');

?>

But I always get this Windows messagebox error:

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

Searching on google I also find this thread about this error, but the meassures are I litlle drastic I guess.
So the problem its in my code ? Or there can be something else wrong ?

Thanks.

Upvotes: 0

Views: 65

Answers (1)

imbaer
imbaer

Reputation: 554

You need to escape the whitespaces in $PHP_PATH = "c:\Program Files (x86)\PHP\\";!

Upvotes: 1

Related Questions