PHP

Hi,

Apologies if this was asked before. I am still new to the YUN.

I am happy with installing PHP - enough info on the forums - thanks.

Can someone please direct me to information on how to call a PHP script from within a sketch and share values between a sketch and PHP?

Cheers

If you insatll php5-cli you can run your php scripts from the command line, and also call them from
your sketches.

Forexample use the runShellCommand

p.runShellCommand("php-cli /usr/bin/test.php 3 2>&1");

Tx for the reply. One last question, what is the "3 2>&1" options behind the script name?

Cheers

I made the test.php script so that it takes one argument, so test.php 3, is just the argument.

2>&1 is a redirection stderr to stdout, so that errors will show up in the serial monitor