Setup Phalcon
Setup Phalcon
This example creates a Phalcon 5 application inside Devilbox and links its public/ directory to the virtual host document root.
Overview
| Project name | Container path | Database | TLD_SUFFIX | Project URL |
|---|---|---|---|---|
my-phalcon | /shared/httpd/my-phalcon | optional | lvh.me | http://my-phalcon.lvh.me / https://my-phalcon.lvh.me |
Projects live in /shared/httpd/ inside the PHP container and in ./data/www/ on the host.
Prerequisites
- Devilbox with PHP 8.3 or PHP 8.4 available.
- A PHP container image or project setup that includes the Phalcon extension and Phalcon Developer Tools for Phalcon 5.
- HTTPD and Bind services.
Start the stack:
./dvl.sh up php httpd bindWalk through
It will be ready in seven steps:
- Enter the PHP container.
- Create a new virtual host directory.
- Check Phalcon tooling.
- Create the Phalcon project.
- Link
public/tohtdocs. - Verify DNS.
- Open the project.
1. Enter the PHP container
./dvl.sh shell php832. Create the vhost directory
mkdir -p /shared/httpd/my-phalconcd /shared/httpd/my-phalcon3. Check Phalcon tooling
php -m | grep -i phalconphalcon --versionInstall or enable the extension and developer tools if those checks fail.
4. Create the Phalcon project
phalcon project phalconphpExpected structure:
tree -L 1.└── phalconphp5. Link the webroot
ln -s phalconphp/public htdocs6. Verify DNS
my-phalcon.lvh.me resolves to localhost with the default suffix. For another suffix, add a hosts-file entry.
7. Open your browser
Visit http://my-phalcon.lvh.me or https://my-phalcon.lvh.me.
Nginx routing note
If routes fail under Nginx, create data/www/my-phalcon/.devilbox/nginx.yml from cfg/vhost-gen/nginx.yml-example-vhost and adapt the try_files rule for Phalcon:
try_files $uri $uri/ /index.php?_url=$uri&$args;Validate the YAML before restarting:
yamllint data/www/my-phalcon/.devilbox/nginx.ymlRestart with:
./dvl.sh restartNext steps
- Add MySQL or Redis only if the generated application needs them.
- Configure HTTPS trust for browser testing.
- Use
./dvl.sh exec "php -m"for quick extension checks.