Skip to content

Instantly share code, notes, and snippets.

@philbirnie
Last active June 2, 2017 19:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philbirnie/162f8146821b58de739115be1a6ed2df to your computer and use it in GitHub Desktop.
Save philbirnie/162f8146821b58de739115be1a6ed2df to your computer and use it in GitHub Desktop.
xDebug Setup Cheat Sheet (NGINX + PHP-FPM)

Xdebug Setup Instruction

Basic overview of how to set up Xdebug on an nginx + fpm server (building from source)

  1. Go to X-debug and download the appropriate version (wget works well) for your PHP version.

  2. Untar (tar vxfz FILENAME)

  3. cd into untarred directory

  4. phpize and inspect versions. a) You may need to install php-devel package appropriate for your PHP build (e.g. yum install php-devel)

  5. Make sure that phpize numbers match Zend extension when viewing either phpinfo() or via php -i

  6. Compile via ./configure --enable-xdebug a) You may need a C Compiler (e.g. yum install gcc)

  7. Create an xdebug.ini file or add the following to your php.ini file (depending upon settings):

    [xdebug]
    zend_extension=/usr/lib64/php/modules/xdebug.so
    xdebug.remote_enable=1
    xdebug.profiler_enable=1
    xdebug.remote_connect_back=1
    xdebug.idekey=vagrant
  1. Restart php-fpm service php-fpm restart or similar.

  2. View phpinfo() output to verify successful installation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment