Serial communication with PHP

I'd be very systamatic trouble shooting the problem.

1). Can you get the arduino to do what you want using hyperterminal (or similar terminal application talking to the serial port) and is the expected response from the arduino received by hyperterminal? If not, then the arduino and its programming might be an issue.

2). Is PHP opening the serial port at the appropriate baud rate for the arduino?

3). Test your PHP program by connecting together the tx/rx lines supplying the arduino, then send a string and see if the PHP program returns the string. If this doesn't work, then there is a PHP issue with sending/receiving data, and possibly an issue with its interaction with apache.

4). If the issues can't be readily solved, then go ahead and set your webcam up the ol timey cgi way and work on the current issues as time permits.