Reading serial port through PHP on linux

For some strange reason PHP serial class is not working in my ubuntu installation.

The serial class does something. You want it to do something. Clearly, those two somethings are not the same thing, or you would not have posted. But, what those two somethings are you have not explained.

We can't help if you don't.

But the fread function doesn't seem to work

Pity. I'm sure that the author of the function thought differently before releasing it.

The fread function does something. You want it to do something. Clearly, those two somethings are not the same thing, or you would not have posted. But, what those two somethings are you have not explained.

We can't help if you don't.

By the way, if you ave not modified your Arduino, opening the serial port resets the Arduino. You are not allowing any time for the Arduino to reset before writing/reading. Closing the serial port resets the Arduino, too.