This example shows how to build a simple application using Apache, PHP, and PostgreSQL. It uses Devbox Plugins for all 3 packages to simplify configuration.
The following steps may be done inside or outside a devbox shell.
- Initialize a database by running
devbox run init_db. - Create the database and load the test data by using
devbox run create_db. - Start Apache, PHP-FPM, and Postgres in the background by run
devbox services start. - You can now test the app using
localhost:8080to hit the Apache Server. If you want Apache to listen on a different port, you can change theHTTPD_PORTenvironment variable in the Devbox init_hook.
-
Create a new project with:
devbox create --template lapp-stack devbox install
-
Update
devbox.d/apache/httpd.confto point to the directory with your PHP files. You'll need to update theDocumentRootandDirectorydirectives. -
Follow the instructions above in the How to Run section to initialize your project.


