is there any other way to communicate to serial port other thanphp class
Sure. Plenty of other choices. Although, in this case, I think you will learn a lot about the Arduino and serial communication if you work through the problem, whatever it is, that you are having.
What is the problem?