PHP Casino Script

Install locally

Start the MIT-licensed PHP example on your computer and run a smoke test.

Start the sample server

  1. Install PHP 8.2 or later and check it with php -v.
  2. Download the source ZIP and extract all files, including the hidden .php-casino-script directory.
  3. Open a terminal in the extracted directory with the public folder and start the loopback server.
php -S 127.0.0.1:8080 -t public

Open http://127.0.0.1:8080/ to play a round. If port 8080 is already in use, pick another port and use it in the URL.

Check the catalog and one round

curl http://127.0.0.1:8080/developer-app/api.php
curl -H "Content-Type: application/json" \
     --data '{"game":"dice","pick":"seven","stake":10}' \
     http://127.0.0.1:8080/developer-app/api.php

Run these multiline commands in a POSIX shell or join the lines on Windows and use curl.exe. Check that the catalog lists three games and the round reports net = returned - stake.

Serve only the public folder

For hosted use, set the document root to public, keep the engine outside it, and use HTTPS and server-side rate limits appropriate for your deployment. Use PHP’s loopback server for local development.