Civilization is the root of religion. Before civilization, people moved and traveled, hunting and gathering. Their sole concern was survival. Once agriculture came about and people began staying in one place for extended periods of time, we began to see specialaized workers emerge- smiths, builders, merchants, etc. When survival was no longer the main concern, people began looking around them and seeing things that they couldn't explain- why the sun rose, why the river flooded, and so on. They began using gods to explain these things, hence, religion is born.
Religion shaped civilization in that it provided a basis for daily life. Many cities were based around a temple, and religious principles served as morals by which to live. For a long time, priests and religious leaders ruled societies. The pharohs of Egypt, for instance, were revered as gods. Religion also led to major world events, namely wars. It has constantly changed the map throughout history as well as society itself.
Ultimately, religion and civilization go hand in hand: where you find one, you are likely to find another.