This is the software I use to share my iTunes songs.
First, download index.php and put it in a folder on your web site.
Then, copy your ~/Music/iTunes/iTunes Media/Music/
in the same folder.
(The Music/
folder and the index.php
file should be next to each other)
Everything should then work.
Unfortunately, when Apple renamed iTunes to Music in 2019, they dropped support for the XML file.
If you are still using iTunes, first enable the Share iTunes Library XML with other applications
settings in the preferences.
Then copy the ~/Music/iTunes/iTunes Music Library.xml
file next to the index.php
file.
This will make the times and dates visible in the web page.