Your problem is probably that the pebbles are moving to much when walking on them. Try to put underneath a foundation made of sand. That stabilizes the path.
You dig your path to the depth desired then apply edging of lumber or plastic. Fill about half way with gravel/sand for a base. Pack down. Lay pebbles on top.