trulyao / php-starter
A PHP starter project
Installs: 11
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Type:template
Requires
- ext-pdo: *
- trulyao/php-router: ^2.0
- vlucas/phpdotenv: ^5.4
README
This is a PHP starter project. It allows you to quickly set up a dockerized PHP project loaded with the bare minimum you
need. It also includes a good routing package suitable for APIs and static sites; the .htaccess
file has been written
to match this. It has also been tested in production on Render (using docker) and Heroku (using the Heroku PHP
buildpack with Apache2).
Create a new project
composer create-project trulyao/php-starter hello-world
Requirements
- PHP 7.1+
- Docker and Docker Compose
Includes
Setup
Run the following command to run it in detached mode:
$ docker-compose up -d
To force-rebuild the images, use the included Setup.sh
script.
You can also edit the api.conf
file to change your Apache configuration. The installed router depends on
your .htaccess
file, be careful with that. Some headers will not come through depending on your Apache configuration,
you would need to enable them in your configuration file.
Access
- Web (API or Application):
http://localhost:8085
- PHPMyAdmin:
http://localhost:8085/v1/phpmyadmin
or directlyhttp://localhost:2083/
- MySQL is on port 3307 outside the container and can be accessed directly using TablePlus, MySQL WorkBench etc