Coder Social home page Coder Social logo

alexbaumgertner / docker-nginx-php-xdebug Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ionut-botizan/docker-nginx-php-xdebug

0.0 1.0 0.0 3 KB

A basic Docker setup, with zero initial configuration, for a development environment using Docker, Nginx, PHP-FPM, Xdebug.

License: MIT License

PHP 100.00%

docker-nginx-php-xdebug's Introduction

Intro

A basic Docker setup, with zero initial configuration, for a development environment using Docker, Nginx, PHP-FPM, Xdebug.

Quickstart

Place your code in the apps/default folder, then run docker-compose up and your app will be available on http://localhost, port 80.

Things to know:

  • The document root of the server is in the ./apps/default folder.
  • Configuration files are located in the ./config folder
  • Log files will be placed in the ./logs folder

Nginx

If you need to customize the Nginx configuration (and you most probably will), make sure that you include in your configuration the ./nginx/xdebug/remote.conf file. That sets the remote_host setting needed by Xdebug to be able to connect back to your IDE.

To add more hosts or edit existing ones, add/edit the files located in ./config/nginx/hosts.

Xdebug

The configuration file for Xdebug is located at ./config/php/xdebug.ini. By default, Xdebug is configured to use port 9000 and autostart is off. You can set it to on or you can use a browser extension such as Xdebug helper for Chrome to only enable debugging when necessary (for performance reasons).

xdebug.remote_connect_back is disabled and xdebug.remote_host is automatically set by Nginx to one of the special hostnames provided by Docker (docker.for.win.localhost or docker.for.mac.localhost) after sniffing the client's operating system. (see ./config/nginx/xdebug/remote.conf)

To see the debug log, un-comment the xdebug.remote_log setting in the config file.

Other

Sample debug configuration for VS Code (using the default settings):

{
	"version": "0.2.0",
	"configurations": [
		{
			"name": "Listen for XDebug",
			"type": "php",
			"request": "launch",
			"port": 9000,
			"pathMappings": {
				"/": "${workspaceFolder}/",
			}
		}
	]
}

docker-nginx-php-xdebug's People

Watchers

 avatar

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.