Re: system() Question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Dec 28, 2008 at 12:40 PM, Ryan O'Sullivan <rjo@xxxxxxxxx> wrote:

> Hello all,
>
> I am using system to convert some files using a binary in linux.  My code
> looks like this:
>     $response = system('gpsbabel -p "" -r -t -i gpx -f "test.gpx" -o kml -F "test2.kml"', $retval);
>     echo "<p>Response: ", $response, "</p><p>Return Value: ", $retval;
>
> The $retval is returning code 127 - Any ideas on why this?

You overlooked the ampersand in front of $retval. The syntax for
'system' is:

string system  ( string $command  [, int &$return_var  ] )

You have to pass a pointer to the variable, not the variable itself.

-- 
"Paper has a genius for multiplication that cannot be equaled anywhere
 else in nature." -- Hugh Keenleyside
    Rick Pasotto    rick@xxxxxxxx    http://www.niof.net

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux