🎵 Music Library Database Generator

Generate song_db.js for your Claude Music Player

Debug Info: PHP Version: 7.4.27 | JSON Extension: Not Available (using fallback) | Current Directory: /var/www/html/my_music | Script: refresh_song_db.php | Time: 2026-03-14 16:12:07

📖 Instructions

  1. Make sure your music library follows this structure:
    library/
    ├── Playlist 1/
    │ ├── song1.mp3
    │ └── song2.mp3
    ├── Playlist 2/
    │ └── song3.mp3
  2. Enter the path to your library folder (relative to this PHP file)
  3. Specify the output filename for the generated database
  4. Click "Generate Database" to create your song_db.js file
  5. Include the generated file in your music player HTML

🔧 Troubleshooting

  • Permission denied: Ensure the web server has write permissions to the directory
  • Library not found: Check that the library path is correct relative to this PHP file
  • No songs found: Verify that your folders contain .mp3 files
  • File not generated: Check the debug information above for detailed error messages
  • JSON encode error: This version includes a fallback for systems without JSON extension

🆕 What's Fixed

  • JSON Extension Issue: Added custom fallback implementation for json_encode()
  • Compatibility: Works on PHP installations without JSON extension enabled
  • Detection: Automatically detects and reports which JSON method is being used
  • Error Handling: Better error messages for JSON-related issues