I use Ubuntu. I can upload some code to arduino and it usually works. If i just do : Serial.println("OK"); it works to ... the problem is in the serial ...
Have a look at the examples in Serial Input Basics - simple reliable ways to receive data.
Make your PC program correspond with one of them - the 3rd example will be most reliable.
This Python - Arduino demo may also be of interest (I don't use PHP - but I do use Linux)
It is important to ensure your PC program keeps the serial connection open until it is completely finished with the Arduino. The Arduino resets every time the PC program opens the serial port.
cellules49:
I have read your example but it don't works ...
That does not tell me enough so that I can help you. Which example? if you have incorporated my ideas into your program then you need to post your program so I can see what you did.
Is my deviceSet is well : /dev/ttyAMC0 ? I think so ...
That will need to be set to whatever is appropriate on your PC.
An other question : is it a good solution to try to use PHP for web application with arduino ? Probably java is a best solution ?
The Arduino will neither know nor care what programming language is used on the PC.