Go Down

Topic: PHP (Read 1 time) previous topic - next topic

berniekruger

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

Erni

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

Code: [Select]
p.runShellCommand("php-cli /usr/bin/test.php 3 2>&1");

berniekruger

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

Cheers

Erni

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

Go Up