Basic PHP project structure for a PHP 8.1+ application. Pre-configured with an example namespace, PHPUnit test suite, web-accessible front controller, and command-line application.
Install Composer package manager.
Create project skeleton:
$ composer create-project johnkary/php-skeleton your-new-project-dir $ cd !$ $ git initStart PHP's built-in web server:
$ php -S 127.0.0.1:8000 -t wwwOpen http://127.0.0.1:8000 to access
www/index.phpRun
php bin/consoleto access command-line scripts
Optionally copy and configure
phpunit.xml.distfor your project's environment:$ cp phpunit.xml.dist phpunit.xml $ vi phpunit.xmlRun the test suite:
$ ./vendor/bin/phpunit