Hi, I recently purchase a Raspberry PI(small pc running debian os). I am sending a serial message from the Raspberry Pi to an Arduino(microcontroller) via serial to light on a led .

I have 2 php files. Everything works fine when I start the script for LXTerminal. (ex php filename.php )

But when I put the file in var/www/folder (apache2 server ) and open it via the browser (localhost/folder/filename.php, it doesn't do what it is supposed to do. The led does't light. In the browser, a see : // filename.php.

$serial->confBaudRate(9600); //Baud rate: 9600 $serial->confParity("none"); //Parity (this is the "N" in "8-N-1") $serial->confCharacterLength(8); //Character length (this is the "8" in "8-N-1") $serial->confStopBits(1); //Stop bits (this is the "1" in "8-N-1") $serial->confFlowControl("none"); //Device does not support flow control of any kind, so set it to none.

//Now we "open" the serial port so we can write to it$serial->deviceOpen();

/** * Sets the length of a character. * * @param int $int length of a character (5 <= length <= 8) * @return bool */ function confCharacterLength ($int) { if ($this->_dState !== SERIAL_DEVICE_SET) { trigger_error("Unable to set length of a character : the device is either not set or opened", E_USER_WARNING); return false; }

/** * Sets the length of stop bits. * * @param float $length the length of a stop bit. It must be either 1, * 1.5 or 2. 1.5 is not supported under linux and on some computers. * @return bool */ function confStopBits ($length) { if ($this->_dState !== SERIAL_DEVICE_SET) { trigger_error("Unable to set the length of a stop bit : the device is either not set or opened", E_USER_WARNING); return false; }

/** * Reads the port until no new datas are availible, then return the content. * * @pararm int $count number of characters to be read (will stop before * if less characters are in the buffer) * @return string */ function readPort ($count = 0) { if ($this->_dState !== SERIAL_DEVICE_OPENED) { trigger_error("Device must be opened to read it", E_USER_WARNING); return false; }