Skip to content

Provides basic php-cli docker image with installed Composer and configured xDebug along with PHPStorm IDE configuration manual. Use it as starting point to your custom PHP application based on whatever you want, like Symfony

Notifications You must be signed in to change notification settings

Crix4lis/docker-php-cli-xdebug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

author: Michał Powała
source repository: docker-php-cli-xdebug

docker-php-cli-xdebug

This repository contains running PHP CLI docker image with slightly extended official php imgage. It's extended with configured xDebug extension and installed Composer. The repostory is useful as basic image for any PHP application. Use Composer to download needed dependencies, libraries or PHP frameworks like Symfony.

HOW TO USE IT

  1. Install Docker: OFFICIAL INSTRUCTION
  2. Install Compose: OFFICIAL INSTRUCTION
  3. Change directory to dir you cloned the repo and type: docker-compose up -d
  4. Enter the container: docker-compose exec cli bash
  5. Turn on and turn off debugging mode with: xdebugstart and xdebugstop
  6. Run your script with: php your_script.php

HOW TO SET UP YOUR PHPSTORM IDE

  1. Go to options
  2. Go to Languages & Frameworks > PHP > Debug
  3. Scroll down to "Xdebug" section
  4. Make sure:
    • Debug port is set to: 9000
    • Can accept external connections is set to: checked
  5. Go to Languages & Frameworks > PHP > Servers and set up:
    • Name: docker-xdebug-server
    • Host: does not matter
    • Port: does not matter
    • Debugger: Xdebug
    • Use path mappings: checked
    • Absolute path on the server: /volume

DON'T FORGET: to start listening for PHP Debug connections in the IDE:
Start Listening for PHP Debug connections picture

HOW TO TURN ON AND TURN OFF XDEBUG SESSION

Inside docker container type (via bash):

  • To turn on: xdebugstart
  • To turn off: xdebugstop

About

Provides basic php-cli docker image with installed Composer and configured xDebug along with PHPStorm IDE configuration manual. Use it as starting point to your custom PHP application based on whatever you want, like Symfony

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published