Hi.
Personally we used the R CMD BATCH interface to R to achieve this. It's not very elegant, but essentially we have a user pasting data into a form which is passed to PhP which generates a .R file with something
x = c(1,2,3,4);
dev.off();
plot(x);
Then we get PhP to do an exec "R CMD BATCH "
In the directory you should then get Rplots.ps file which can be served to the client. Equally you can use the jpeg() function to return a jpeg picture of the graphic which can then be displayed on the web page PhP returns.
Not elegant at all, but it works for us.