History of religious texts
The oldest known religious texts are Pyramid texts of Ancient Egypt that date to 2400-2300 BCE. The earliest form of the Phoenician alphabet found to date is the inscription on the sarcophagus of King Ahiram of Byblos . ( The Sumerian Temple Hymns  ). The Epic of Gilgamesh from Sumeria is also one of the earliest literary works dating to 2150-2000 BCE, that includes various mythological figures. The Rigveda of Hinduism is proposed to have been composed between 1700–1100 BCE  making it possibly the world's oldest religious text still in use. The oldest portions of the ZoroastrianAvesta are believed to have been transmitted orally for centuries before they found written form, and although widely differing dates for Gathic Avestan (the language of the oldest texts) have been proposed, scholarly consensus floats at around 1000 BCE. 
The majority of scholars agree that the Torah 's composition took place over centuries.  From the late 19th century there was a general consensus around the documentary hypothesis , which suggests that the five books were created c.450 BCE by combining four originally independent sources, known as the Jahwist , or J (about 900 BCE), the Elohist , or E (about 800 BCE), the Deuteronomist , or D, (about 600 BCE), and the Priestly source , or P (about 500 BC). 
The first scripture printed for wide distribution to the masses was The Diamond Sutra , a Buddhist scripture, and is the earliest recorded example of a dated printed text, bearing the Chinese calendar date for 11 May 868 CE.