Giter Site home page Giter Site logo

docker-php-dev's Introduction

PHP Development Docker Image

This image is aimed to help developers which need to develop and test their projects in different PHP versions (specially free or open source software developers). It comes with the latest supported PHP versions plus the latest 5.3 release.

The following PHP versions are available:

  • 5.6.6
  • 5.5.22
  • 5.4.38
  • 5.3.29

This container also ships with Nginx, which integrates to the right PHP-FPM version.

Usage

Start the container:

$ docker run -p 80:80 -v ~/your-app:/var/www/your-app -d "eriksencosta/php-dev:latest"

This will expose your application through port 80, which you can then access in your web browser with the address http://localhost (or an IP address if you're using Boot2Docker).

Starting your container in this way will run your application with the latest released PHP version and will output the Nginx access logs.

To get the real value of the image and switch between the different PHP versions, start the container in interactive mode:

$ docker run -t -i -p 80:80 -v ~/your-app:/var/www "eriksencosta/php-dev:latest" /bin/bash

Use the phpenv command to switch between the installed PHP versions:

# phpenv versions
  5.3
  5.3.29
  5.4
  5.4.35
  5.5
  5.5.19
  5.6
* 5.6.3 (set by /opt/phpenv/version)

5.6, 5.5, 5.4 and 5.3 are just shortcuts. phpenv let you define the global (system-wide) and local PHP version. To set it globally:

# phpenv global 5.5

To set a local version, use:

# phpenv local 5.4

To install additional PHP libraries globally with Composer:

# composer global require fabpot/php-cs-fixer:dev-master

You can start the Nginx and PHP-FPM services using the helper command webserver:

# webserver start
Starting PHP-FPM server.
Starting Nginx server.
Done.

The Zend OPCache is enabled by default. If you want to disable it, you can run the helper command opcache:

# opcache disable
The Zend OPCache was disabled.

You need to restart the webserver for the changes to take effect.
Execute: webserver restart

Note: check the Silex Docker Example application for further usage examples.

PHP Information

After starting the container, access http://localhost/info.php (or an IP address if you're using Boot2Docker).

PHP-FPM

PHP-FPM is installed for each PHP version. To start it with Nginx, use the helper command webserver. See the Usage section.

PHP Extensions

Each PHP version is built with the following extensions:

  • amqp
  • bcmath
  • Core
  • ctype
  • curl
  • date
  • dom
  • ereg
  • exif
  • fileinfo
  • filter
  • ftp
  • gd
  • hash
  • iconv
  • igbinary
  • intl
  • json
  • libxml
  • mbstring
  • mcrypt
  • memcached
  • mongo
  • mysql
  • mysqli
  • mysqlnd
  • openssl
  • pcntl
  • pcre
  • PDO
  • pdo_mysql
  • pdo_pgsql
  • pdo_sqlite
  • Phar
  • posix
  • readline
  • Reflection
  • redis
  • riak
  • session
  • shmop
  • SimpleXML
  • soap
  • sockets
  • SPL
  • sqlite3
  • standard
  • sysvsem
  • sysvshm
  • tidy
  • tokenizer
  • xdebug
  • xml
  • xmlreader
  • xmlrpc
  • xmlwriter
  • xsl
  • Zend OPcache
  • zip
  • zlib

From the previous list, the following extensions were installed using PECL:

Composer

Composer is also installed. The following libraries are installed globally:

Additional Information

The image is built using Ansible. The playbook used is the Ansible PHP Development.

License

Apache License 2.0

docker-php-dev's People

Contributors

eriksencosta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

docker-php-dev's Issues

Calendar extension

Hi, thank you for provide us the wonderful docker image!
My application required a calendar extension, would you kindly advise on how do I enable it?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.