I don't think that there is that kind of engine you are looking for.
Also imo the best way of doing stuff is to just try it out yourself.
I would start off planning the layout of the game and the game mechanics on a piece of paper.
Then code the layout with HTML.
Don't forget to make some graphics + placeholders

Then code the php generating the sites (this could be the worst part^^)
When making the game logic in php, you could start of by creating easy things like just "town places" which can be visited without greater complexity. Then you could make the battles.....
I don't know what kind of RPG you want to make - what mechanics etc. but I wish you good luck. If you need help, ask anytime!