A collection of WebRTC examples with PHP-based signaling backends.
- PHP 8.4 or higher
- Linux environment (required for manual setup)
- Modern web browser with WebRTC support (Chrome, Firefox, Edge, Safari)
- HTTPS connection (required by WebRTC for secure contexts)
A preconfigured Docker setup is provided for easy local development with HTTPS support.
# Build and start the Docker container
docker-compose up -d
Once running, access the examples at:
👉 https://localhost
The Docker environment automatically generates a self-signed certificate for HTTPS access.
⚠️ Manual setup is currently supported only on Linux systems.
git clone https://github.com/PHP-WebRTC/examples.git
# Make the installer executable and run it
cd examples
chmod +x install_deps.sh
./scripts/install_deps.sh
you may need to run as root if you don't have permission to install deps sudo ./scripts/install_deps.sh
cd examples/[example_directory] # e.g. cd examples/echo
# Install PHP dependencies using Composer
composer install
php server.php
php -S localhost:8000
Now, open your browser and go to:
👉 https://localhost:8000
- WebRTC requires a secure (HTTPS) context. You may need to accept your browser's warning about self-signed certificates during local development.
- Be sure to grant access to your camera and microphone when prompted.
- If something isn't working, check the browser console for errors or permission issues.
-
Amin Yazdanpanah
- Website: aminyazdanpanah.com
- Email: github@aminyazdanpanah.com
-
Sana Moniri
- GtiHub: sanamoniri
Found a bug? Please report it on our issues.
BSD 3-Clause License. See LICENSE for details.