PHP Music v1.8

A self-hosted, modern, simple and fast music platform inspired by YouTube Music.
Introduction
PHP Music is an open-source, web-based, self-hosted music platform. Enjoy your music library anywhere, with a beautiful dark UI and responsive design inspired by YouTube Music. Features include user accounts, uploads, playlists, favorites, PWA, admin tools, and moreโ€”all in a single PHP file!
Features
Music Management
Upload, edit, and delete your own songs. Organize by artist, album, or genre. Create favorites and playlists. Drag and drop to reorder lists.
User Accounts
Register as a user, manage your profile, set a profile picture, change your password, and upload music (with verification).
Uploads & Limits
Upload up to 10 songs per day (default, configurable). Supported: MP3, FLAC, M4A, OGG, WAV, and more. Admin must verify users for uploads.
YT Music Theme
Sleek, dark, mobile-first interface inspired by YouTube Music. Responsive design using Bootstrap 5.
Admin Panel
Manage users, verify/unverify accounts, and monitor uploads from a secure admin dashboard. Toggle user verification and see daily upload stats.
PWA Support
Add to Home Screen on your device for an app-like experience. Works offline (static assets, cached content, and player UI).
History & Recommendations
Tracks recent plays and suggests music based on your listening history and favorites. "For You" section with personalized shelves.
Installation
  1. Clone the repository:
    git clone https://github.com/HirotakaDango/PHP-Music-Player.git
  2. Install dependencies:
    • PHP 7.4+ (pdo_sqlite, gd)
    • Web server (Apache/Nginx) or PHP built-in server
    • getID3 library (included as getid3/ folder)
  3. Set permissions:
    chmod -R 755 uploads/
  4. Run the app:
    php -S localhost:8080
    Or deploy to your webserver's public directory.
  5. Visit: http://localhost:8080/
Security Tip: Change the ADMIN_PASSWORD in index.php before going public!
Usage
As a user you can:
  • Register with your email & artist name
  • Wait for admin verification to upload music
  • Upload music (MP3, FLAC, etc.), edit genres, and create playlists
  • Create, reorder (drag & drop), and share playlists
  • Mark favorites, search by title, artist, album, or genre
  • Set a profile picture (WebP processed)
Music Playback:
  • Click a song to play; use the player bar for controls (play/pause/skip/shuffle/repeat/volume)
  • Supports background playback (PWA + mobile)
  • Drag and drop to reorder favorites and playlists
  • Sharing: click to copy/share links for songs, albums, artists, or playlists
  • Stream, download, and view song metadata
For advanced usage and integrations, see the API endpoints below.
Admin Panel
Only admins (server owners) can verify users and manage accounts. User verification is required to upload music.
API Endpoints
Endpoint Method Description
?action=register POST (json) Register new user (email, artist, password)
?action=login POST (json) Login (email, password)
?action=get_session GET Get current session status and user info
?action=upload_song POST (form-data) Upload a song file (verified users only, MP3/FLAC/M4A/OGG/WAV, daily limit applies)
?action=delete_song POST (json) Delete a song (owner or admin only)
?action=get_songs GET List all songs (supports sort, page, artist, album, genre)
?action=toggle_favorite POST (json) Add or remove favorite song
?action=create_playlist POST (json) Create a new playlist
?action=get_user_playlists GET List your playlists
?action=get_playlist_songs&public_id=ID GET Get songs in a playlist
?action=get_stream&id=SONG_ID GET Stream audio file (with HTTP Range support)
?action=search&q=QUERY GET Search songs by title, artist, or album
?action=get_recommendations GET Get personalized recommendations ("For You")
All API endpoints return application/json unless streaming.
FAQ

Open the site in your browser (Chrome/Safari/Edge), tap the menu (โ‹ฎ) and select Add to Home Screen. The app installs as a PWA!

MP3, M4A, FLAC, OGG, WAV, and more (as supported by your browser via audio tag).

Register an account, then ask your site admin to verify your account for uploads. Admin can toggle verification from the admin panel.

Yes! Edit the :root variables in the CSS for your own color palette.

Use the "Scan All" button or visit ?action=full_scan to resync the database with your music folder using getID3.
Progressive Web App (PWA)
Tip: If you update the app, users may need to refresh for cache updates.
https://your-domain/index.php?pwa=manifest
https://your-domain/index.php?pwa=sw
License
MIT License โ€“ Free for personal and commercial use.
GitHub Repo →