Sign inSign up

felipegangrel/php

By felipegangrel

•Updated over 1 year ago

Base image for PHP

Image
Languages & frameworks
0

391

felipegangrel/php repository overview

⁠PHP Base image

PHP 8 + Apache + Xdebug + Composer

⁠Docker compose example

services:
  app:
    image: felipegangrel/php
    volumes:
      - .:/var/www/html
    ports:
      - 80:80
    environment:
      PHP_OPCACHE_VALIDATE_TIMESTAMPS: 1 # 0 for production (enables opcache)

⁠Debugging on VSCode

I recommend using the PHP Debug extension. Here is a sample configuration for the launch.json file:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Listen for Xdebug Docker",
            "type": "php",
            "request": "launch",
            "log": true,
            "hostname": "localhost",
            "port": 9003,
            "pathMappings": {
                "/var/www/html": "${workspaceFolder}"
            },
        }
    ]
}

⁠Environment variables

  • PHP_OPCACHE_VALIDATE_TIMESTAMPS: 1 for development, 0 for production (default: 0)
  • XDEBUG_MODE: (default: debug)
  • XDEBUG_CLIENT_HOST: Host where the IDE is running (default: host.docker.internal)
  • XDEBUG_CLIENT_PORT: Port where the IDE is listening (default: 9003)
  • XDEBUG_IDEKEY: IDE key (default: VSCODE)
  • XDEBUG_START_WITH_REQUEST: (default: yes)

For more information, see the Xdebug documentation⁠.

Tag summary

Content type

Image

Digest

sha256:f5212686f…

Size

336.3 MB

Last updated

over 1 year ago

docker pull felipegangrel/php