If you want to use PHP purely, there is a simpler way.
Just put the following in glitch.json:
"start": "php -S 0.0.0.0:3000"
After that, add
keep in mind that PHP, Apache and MySQL are OS packages and their versions are out of date: