Our PHP service looks different because to connect PHP to the database using mysqli we need to install some mysqli stuff. That means we need to use a Dockerfile to customize our php7.4-apache image. So now we're using 'build' to use the contents of the current directory (the dot) and using our Dockerfile to create the image. This skeleton includes a Vagrantfile based on Ubuntu 14.04, and using the ondrej/php PPA to provide PHP 7.0. Start it up using: $ vagrant up. Once built, you can also run composer within the box. For example, the following will install dependencies: $ vagrant ssh -c 'composer install' While this will update them: $ vagrant ssh -c 'composer update'. Phpbrew update phpbrew install -j $(nproc) 7.4 +default Docker. Official PHP images can be found on Docker Hub. As of PHP 7.4's release date, the php:7.4 image hasn't been tagged yet; once it is, you can use that for your base images. Docker is also a great way to tinker with PHP 7.4 in a local interactive shell without installing it first! Install a 64 bits php version somewhere on your computer (let's say in C:/php64). Docker-compose -f.docker/docker-compose.yml exec php env COMPOSERMEMORYLIMIT.
If you want to use zend-mvc to build Model-View-Controller (MVC) applications, we recommend you start with our skeleton application.
The easiest way to create a new Zend Framework project is to use Composer. If you don't have it already installed, then please install it per their documentation.
To create your new Zend Framework project:
Once installed, you can test it out immediately using PHP's built-in web server:
This will start the PHP cli-server on port 8080, and bind it to all network interfaces.
Note: The built-in CLI server is for development only.
This skeleton includes a Vagrantfile based on Ubuntu 14.04, and using the ondrej/php PPA to provide PHP 7.0. Start it up using:
Once built, you can also run composer within the box. For example, the following will install dependencies:
While this will update them:
While running, Vagrant maps your host port 8080 to port 80 on the virtual machine; you can visit the site at http://localhost:8080/
The skeleton also provides a docker-compose.yml
for use with docker-compose; it uses the Dockerfile
provided as its base. Build and start the image using:
At this point, you can visit http://localhost:8080 to see the site running.
You can also run composer from the image. The container environment is named 'zf', so you will pass that value to docker-compose run
: