Skip to content

Instantly share code, notes, and snippets.

@ernestoliberio
Forked from ankurk91/xdebug-mac.md
Created July 1, 2021 18:19
Show Gist options
  • Select an option

  • Save ernestoliberio/afd38e65de83e992a7d8f1b29c255f37 to your computer and use it in GitHub Desktop.

Select an option

Save ernestoliberio/afd38e65de83e992a7d8f1b29c255f37 to your computer and use it in GitHub Desktop.

Revisions

  1. @ankurk91 ankurk91 revised this gist May 8, 2021. 2 changed files with 10 additions and 10 deletions.
    10 changes: 5 additions & 5 deletions xdebug-mac.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    ## :beetle: Install and Configure xDebug v3 on MacOS for PhpStorm :elephant:

    * Assuming that you have already installed php and apache via [Homebrew](https://brew.sh/) v1.6+
    * Assuming that you have already installed php and apache via [Homebrew](https://brew.sh/)

    * **Install [xDebug](https://xdebug.org/docs/install) php extension**
    ```
    @@ -42,8 +42,8 @@ sudo apachectl -k restart
    ```

    * **Configure phpStorm**
    * Go through - Settings >> Languages & Frameworks >> PHP >> Debug
    * Check that 'Debug port' is the same you have in your `ext-xdebug.ini`. In our case it was `9003`.
    * Go through - Settings >> PHP >> Debug
    * Ensure that 'Debug port' is the same as you have in your `ext-xdebug.ini`. In our case it was `9003`.
    * Save and close the Settings Dialog

    * **Start debugging**
    @@ -52,8 +52,8 @@ sudo apachectl -k restart
    * Start listener by clicking on the telephone :telephone_receiver: button on top toolbar
    * If you can't find telephone button; then go through menus - Run -> Start listening for PHP Debug Connections
    * Use [chrome extension](https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc?hl=en)
    * Configure the chrome extension

    * Configure this chrome extension and set IDE Key to `PHPSTORM`
    * Visit your website
    * You should see a popup window in PhpStorm , click **Accept** connection
    * Done, enjoy debugging !!!

    10 changes: 5 additions & 5 deletions xdebug-ubuntu.md
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    * Assuming that you have already installed php and apache
    * **Install [xDebug](https://xdebug.org/docs/install) php extension**
    ```
    sudo apt-get install php-xdebug
    sudo apt-get install php7.4-xdebug
    ```

    * **Edit your `xdebug.ini`**
    @@ -27,8 +27,8 @@ sudo service apache2 restart
    ```

    * **Configure phpStorm**
    * Go through - Settings >> Languages & Frameworks >> PHP >> Debug
    * Check that 'Debug port' is the same you have in your `xdebug.ini`. In our case it was `9003`.
    * Go through - Settings >> PHP >> Debug
    * Ensure that 'Debug port' is the same as you have in your `xdebug.ini`. In our case it was `9003`.
    * Save and close the Settings Dialog

    * **Start debugging**
    @@ -37,8 +37,8 @@ sudo service apache2 restart
    * Start listener by clicking on the telephone :telephone_receiver: button on top toolbar
    * If you can't find telephone button; then go through menus - Run -> Start listening for PHP Debug Connections
    * Use [chrome extension](https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc?hl=en)
    * Configure chrome extension

    * Configure this chrome extension and set IDE Key to `PHPSTORM`
    * Visit your website
    * You should see a popup window in PhpStorm , click **Accept** connection
    * Done, enjoy debugging !!!

  2. @ankurk91 ankurk91 revised this gist Apr 21, 2021. 3 changed files with 29 additions and 32 deletions.
    28 changes: 13 additions & 15 deletions xdebug-mac.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ## :beetle: Install and Configure xDebug on MacOS for PhpStorm :elephant:
    ## :beetle: Install and Configure xDebug v3 on MacOS for PhpStorm :elephant:

    * Assuming that you have already installed php and apache via [Homebrew](https://brew.sh/) v1.6+

    @@ -7,7 +7,7 @@
    pecl channel-update pecl.php.net
    pecl clear-cache
    pecl install xdebug-2.9.8
    pecl install xdebug
    # Optional command
    pecl clear-cache
    @@ -18,14 +18,16 @@ pecl clear-cache
    - `/usr/local/etc/php/7.4/conf.d/ext-xdebug.ini`
    * Add these lines by overwriting exiting
    ```
    # Configuration for Xdebug 3
    [Xdebug]
    ;zend_extension="/usr/local/Cellar/php@742/7.4.11/pecl/20170718/xdebug.so"
    zend_extension="xdebug.so"
    xdebug.remote_enable = 1
    xdebug.remote_port = 9000
    xdebug.idekey = PHPSTORM
    xdebug.show_error_trace = 1
    xdebug.remote_autostart = 0
    xdebug.file_link_format = phpstorm://open?%f:%l
    xdebug.mode=debug,develop
    xdebug.start_with_request=default
    xdebug.idekey=PHPSTORM
    xdebug.client_port=9003
    xdebug.file_link_format=phpstorm://open?%f:%l
    ```

    * **Update your `php.ini`**
    @@ -41,20 +43,16 @@ sudo apachectl -k restart

    * **Configure phpStorm**
    * Go through - Settings >> Languages & Frameworks >> PHP >> Debug
    * Check that 'Debug port' is the same you have in your `ext-xdebug.ini`. In our case it was `9000`.
    * Check that 'Debug port' is the same you have in your `ext-xdebug.ini`. In our case it was `9003`.
    * Save and close the Settings Dialog

    * **Start debugging**
    * Create some [breakpoints](https://www.jetbrains.com/help/phpstorm/breakpoints-2.html) in your project
    * Make sure those breakpoints gets executed when your visit your website in browser.
    * Start listener by clicking on the telephone :telephone_receiver: button on top toolbar
    * If you can't find telephone button; then go through menus - Run -> Start listening for PHP Debug Connections
    * In your browser access your project url like this
    ```
    http://localdomain.test/?XDEBUG_SESSION_START=1
    ```
    * OR use [bookmarks](https://www.jetbrains.com/phpstorm/marklets/)
    * OR use [chrome extension](https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc?hl=en)
    * Use [chrome extension](https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc?hl=en)
    * Configure the chrome extension

    * You should see a popup window in PhpStorm , click **Accept** connection
    * Done, enjoy debugging !!!
    31 changes: 15 additions & 16 deletions xdebug-ubuntu.md
    Original file line number Diff line number Diff line change
    @@ -1,22 +1,25 @@
    ## :beetle: Install and Configure xDebug on Ubuntu for PhpStorm :elephant:
    ## :beetle: Install and Configure xDebug v3 on Ubuntu for PhpStorm :elephant:

    * Assuming that you have already installed php and apache
    * **Install [xDebug](https://xdebug.org/docs/install) php extension**
    ```
    sudo apt-get install php7.4-xdebug
    sudo apt-get install php-xdebug
    ```

    * **Edit your `xdebug.ini`**
    * Your `xdebug.ini` file path should look like this
    - `/etc/php/7.4/mods-available/xdebug.ini`
    * Add these lines without modifying exiting
    ```
    xdebug.remote_enable = 1
    xdebug.remote_port = 9000
    xdebug.idekey = PHPSTORM
    xdebug.show_error_trace = 1
    xdebug.remote_autostart = 0
    xdebug.file_link_format = phpstorm://open?%f:%l
    # Configuration for Xdebug 3
    [Xdebug]
    zend_extension="xdebug.so"
    xdebug.mode=debug,develop
    xdebug.start_with_request=default
    xdebug.idekey=PHPSTORM
    xdebug.client_port=9003
    xdebug.file_link_format=phpstorm://open?%f:%l
    ```
    * Restart the apache server to reflect changes
    ```
    @@ -25,20 +28,16 @@ sudo service apache2 restart

    * **Configure phpStorm**
    * Go through - Settings >> Languages & Frameworks >> PHP >> Debug
    * Check that 'Debug port' is the same you have in your `xdebug.ini`. In our case it was `9000`.
    * Check that 'Debug port' is the same you have in your `xdebug.ini`. In our case it was `9003`.
    * Save and close the Settings Dialog

    * **Start debugging**
    * Create some [breakpoints](https://www.jetbrains.com/help/phpstorm/breakpoints-2.html) in your project
    * Make sure those breakpoints gets executed when your visit your website in browser.
    * Start listener by clicking on the telephone :telephone_receiver: button on top toolbar
    * If you can't find telephone button; then go through menus - Run -> Start listening for PHP Debug Connections
    * In your browser access your project url like this
    ```
    http://localdomain.test/?XDEBUG_SESSION_START=1
    ```
    * OR use [bookmarks](https://www.jetbrains.com/phpstorm/marklets/)
    * OR use [chrome extension](https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc?hl=en)
    * If you can't find telephone button; then go through menus - Run -> Start listening for PHP Debug Connections
    * Use [chrome extension](https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc?hl=en)
    * Configure chrome extension

    * You should see a popup window in PhpStorm , click **Accept** connection
    * Done, enjoy debugging !!!
    2 changes: 1 addition & 1 deletion xdebug-xtreme-resources.md
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@
    ### Troubleshooting
    * Try to change the port to something else, for example `18000`
    * Enable `Break at first line` in phpStorm php debug settings
    * Set `xdebug.remote_autostart` to `1` if you don't want to bother with browser extensions
    * Set `xdebug.start_with_request` to `yes` if you don't want to bother with browser extensions

    ### Resources
    * [Laravel News](https://laravel-news.com/xdebug-phpstorm-valet)
  3. @ankurk91 ankurk91 revised this gist Apr 9, 2021. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion xdebug-mac.md
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@
    pecl channel-update pecl.php.net
    pecl clear-cache
    pecl install xdebug
    pecl install xdebug-2.9.8
    # Optional command
    pecl clear-cache
    2 changes: 1 addition & 1 deletion xdebug-ubuntu.md
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    * Assuming that you have already installed php and apache
    * **Install [xDebug](https://xdebug.org/docs/install) php extension**
    ```
    sudo apt-get install php-xdebug
    sudo apt-get install php7.4-xdebug
    ```

    * **Edit your `xdebug.ini`**
  4. @ankurk91 ankurk91 revised this gist Nov 8, 2020. No changes.
  5. @ankurk91 ankurk91 revised this gist Nov 8, 2020. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions xdebug-mac.md
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,7 @@
    ## :beetle: Install and Configure xDebug on MacOS for PhpStorm :elephant:

    :warning: This guide only applies to [Homebrew](https://brew.sh/2018/04/09/homebrew-1.6.0/) v1.6+
    * Check your version `brew --version` before proceeding

    * Assuming that you have already installed php and apache via [Homebrew](https://brew.sh/) v1.6+

    * **Install [xDebug](https://xdebug.org/docs/install) php extension**
    ```
    pecl channel-update pecl.php.net
  6. @ankurk91 ankurk91 revised this gist Nov 8, 2020. 2 changed files with 4 additions and 12 deletions.
    10 changes: 3 additions & 7 deletions xdebug-mac.md
    Original file line number Diff line number Diff line change
    @@ -9,22 +9,18 @@
    pecl channel-update pecl.php.net
    pecl clear-cache
    # If you have php v7.x
    pecl install xdebug
    # If you have php v5.6
    # pecl install xdebug-2.5.5
    # Optional command
    pecl clear-cache
    ```

    * **Edit your `ext-xdebug.ini`**
    * Your `ext-xdebug.ini` file path should look like this (depends on php version installed)
    - `/usr/local/etc/php/7.2/conf.d/ext-xdebug.ini`
    - `/usr/local/etc/php/7.4/conf.d/ext-xdebug.ini`
    * Add these lines by overwriting exiting
    ```
    ;zend_extension="/usr/local/Cellar/php@7.2/7.2.13/pecl/20170718/xdebug.so"
    ;zend_extension="/usr/local/Cellar/php@742/7.4.11/pecl/20170718/xdebug.so"
    zend_extension="xdebug.so"
    xdebug.remote_enable = 1
    xdebug.remote_port = 9000
    @@ -37,7 +33,7 @@ xdebug.file_link_format = phpstorm://open?%f:%l
    * **Update your `php.ini`**
    * When installing xdebug extension using `pecl`, it also updates our `php.ini` file, but we don't need that.
    * Find your `php.ini` file, file path should look like this (depends on php version installed)
    - `/usr/local/etc/php/7.2/php.ini`
    - `/usr/local/etc/php/7.4/php.ini`
    * Remove any occurrence of `zend_extension="xdebug.so"` from this file

    * Restart the apache server to reflect changes
    6 changes: 1 addition & 5 deletions xdebug-ubuntu.md
    Original file line number Diff line number Diff line change
    @@ -3,16 +3,12 @@
    * Assuming that you have already installed php and apache
    * **Install [xDebug](https://xdebug.org/docs/install) php extension**
    ```
    # Ubuntu 16.04,18.04 php 7.x
    sudo apt-get install php-xdebug
    # Ubuntu 14.04, php 5.6
    sudo apt-get install php5-xdebug
    ```

    * **Edit your `xdebug.ini`**
    * Your `xdebug.ini` file path should look like this
    - `/etc/php/7.2/mods-available/xdebug.ini`
    - `/etc/php/7.4/mods-available/xdebug.ini`
    * Add these lines without modifying exiting
    ```
    xdebug.remote_enable = 1
  7. @ankurk91 ankurk91 revised this gist Aug 16, 2019. No changes.
  8. @ankurk91 ankurk91 revised this gist Jul 6, 2019. 2 changed files with 8 additions and 6 deletions.
    12 changes: 7 additions & 5 deletions xdebug-mac.md
    Original file line number Diff line number Diff line change
    @@ -9,20 +9,22 @@
    pecl channel-update pecl.php.net
    pecl clear-cache
    # If you have php v5.6
    pecl install xdebug-2.5.5
    # If you have php v7.x
    pecl install xdebug
    # If you have php v5.6
    # pecl install xdebug-2.5.5
    # Optional command
    pecl clear-cache
    ```

    * **Edit your `ext-xdebug.ini`**
    * Your `ext-xdebug.ini` file path should look like this (depends on php version installed)
    - `/usr/local/etc/php/7.1/conf.d/ext-xdebug.ini`
    - `/usr/local/etc/php/7.2/conf.d/ext-xdebug.ini`
    * Add these lines by overwriting exiting
    ```
    ;zend_extension="/usr/local/Cellar/php@7.1/7.1.21/pecl/20160303/xdebug.so"
    ;zend_extension="/usr/local/Cellar/php@7.2/7.2.13/pecl/20170718/xdebug.so"
    zend_extension="xdebug.so"
    xdebug.remote_enable = 1
    xdebug.remote_port = 9000
    @@ -35,7 +37,7 @@ xdebug.file_link_format = phpstorm://open?%f:%l
    * **Update your `php.ini`**
    * When installing xdebug extension using `pecl`, it also updates our `php.ini` file, but we don't need that.
    * Find your `php.ini` file, file path should look like this (depends on php version installed)
    - `/usr/local/etc/php/7.1/php.ini`
    - `/usr/local/etc/php/7.2/php.ini`
    * Remove any occurrence of `zend_extension="xdebug.so"` from this file

    * Restart the apache server to reflect changes
    2 changes: 1 addition & 1 deletion xdebug-ubuntu.md
    Original file line number Diff line number Diff line change
    @@ -12,7 +12,7 @@ sudo apt-get install php5-xdebug

    * **Edit your `xdebug.ini`**
    * Your `xdebug.ini` file path should look like this
    - `/etc/php/7.1/mods-available/xdebug.ini`
    - `/etc/php/7.2/mods-available/xdebug.ini`
    * Add these lines without modifying exiting
    ```
    xdebug.remote_enable = 1
  9. @ankurk91 ankurk91 revised this gist Dec 30, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion xdebug-mac.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ## :beetle: Install and Configure xDebug on Mac for PhpStorm :elephant:
    ## :beetle: Install and Configure xDebug on MacOS for PhpStorm :elephant:

    :warning: This guide only applies to [Homebrew](https://brew.sh/2018/04/09/homebrew-1.6.0/) v1.6+
    * Check your version `brew --version` before proceeding
  10. @ankurk91 ankurk91 revised this gist Nov 4, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion xdebug-mac.md
    Original file line number Diff line number Diff line change
    @@ -22,7 +22,7 @@ pecl clear-cache
    - `/usr/local/etc/php/7.1/conf.d/ext-xdebug.ini`
    * Add these lines by overwriting exiting
    ```
    ;zend_extension="/usr/local/Cellar/[email protected]/7.1.19/pecl/20160303/xdebug.so"
    ;zend_extension="/usr/local/Cellar/[email protected]/7.1.21/pecl/20160303/xdebug.so"
    zend_extension="xdebug.so"
    xdebug.remote_enable = 1
    xdebug.remote_port = 9000
  11. @ankurk91 ankurk91 revised this gist Aug 7, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion xdebug-mac.md
    Original file line number Diff line number Diff line change
    @@ -12,7 +12,7 @@ pecl clear-cache
    # If you have php v5.6
    pecl install xdebug-2.5.5
    # If you have php v7.x
    pecl install php-xdebug
    pecl install xdebug
    pecl clear-cache
    ```
  12. @ankurk91 ankurk91 revised this gist Jul 10, 2018. 3 changed files with 9 additions and 10 deletions.
    15 changes: 7 additions & 8 deletions xdebug-mac.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ## :beetle: Install and Configure xDebug on Mac and PhpStorm :elephant:
    ## :beetle: Install and Configure xDebug on Mac for PhpStorm :elephant:

    :warning: This guide only applies to [Homebrew](https://brew.sh/2018/04/09/homebrew-1.6.0/) v1.6+
    * Check your version `brew --version` before proceeding
    @@ -9,16 +9,16 @@
    pecl channel-update pecl.php.net
    pecl clear-cache
    # Example for php v5.6
    # If you have php v5.6
    pecl install xdebug-2.5.5
    # Example for php v7.x
    # If you have php v7.x
    pecl install php-xdebug
    pecl clear-cache
    ```

    * **Edit your `ext-xdebug.ini`**
    * Your `ext-xdebug.ini` file path should look like this
    * Your `ext-xdebug.ini` file path should look like this (depends on php version installed)
    - `/usr/local/etc/php/7.1/conf.d/ext-xdebug.ini`
    * Add these lines by overwriting exiting
    ```
    @@ -34,24 +34,23 @@ xdebug.file_link_format = phpstorm://open?%f:%l

    * **Update your `php.ini`**
    * When installing xdebug extension using `pecl`, it also updates our `php.ini` file, but we don't need that.
    * Find your `php.ini` file, file path should look like this
    * Find your `php.ini` file, file path should look like this (depends on php version installed)
    - `/usr/local/etc/php/7.1/php.ini`
    * Remove any occurrence of `zend_extension="xdebug.so"` from this file

    * Above configs are bare minimum, read all options [here](https://xdebug.org/docs/all_settings)
    * Restart the apache server to reflect changes
    ```
    sudo apachectl -k restart
    ```

    * **Configure phpStorm**
    * Go through - Settings >> Languages & Frameworks >> PHP >> Debug
    * Check that 'Debug port' is the same you have in your `xdebug.ini`. In our case it was `9000`.
    * Check that 'Debug port' is the same you have in your `ext-xdebug.ini`. In our case it was `9000`.
    * Save and close the Settings Dialog

    * **Start debugging**
    * Create some [breakpoints](https://www.jetbrains.com/help/phpstorm/breakpoints-2.html) in your project
    * Make sure those breakpoints gets executed when your visit your virtual host in browser.
    * Make sure those breakpoints gets executed when your visit your website in browser.
    * Start listener by clicking on the telephone :telephone_receiver: button on top toolbar
    * If you can't find telephone button; then go through menus - Run -> Start listening for PHP Debug Connections
    * In your browser access your project url like this
    4 changes: 2 additions & 2 deletions xdebug-ubuntu.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ## :beetle: Install and Configure xDebug on Ubuntu and PhpStorm :elephant:
    ## :beetle: Install and Configure xDebug on Ubuntu for PhpStorm :elephant:

    * Assuming that you have already installed php and apache
    * **Install [xDebug](https://xdebug.org/docs/install) php extension**
    @@ -34,7 +34,7 @@ sudo service apache2 restart

    * **Start debugging**
    * Create some [breakpoints](https://www.jetbrains.com/help/phpstorm/breakpoints-2.html) in your project
    * Make sure those breakpoints gets executed when your visit your virtual host in browser.
    * Make sure those breakpoints gets executed when your visit your website in browser.
    * Start listener by clicking on the telephone :telephone_receiver: button on top toolbar
    * If you can't find telephone button; then go through menus - Run -> Start listening for PHP Debug Connections
    * In your browser access your project url like this
    File renamed without changes.
  13. @ankurk91 ankurk91 revised this gist Jul 10, 2018. 4 changed files with 149 additions and 96 deletions.
    66 changes: 66 additions & 0 deletions xdebug-mac.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,66 @@
    ## :beetle: Install and Configure xDebug on Mac and PhpStorm :elephant:

    :warning: This guide only applies to [Homebrew](https://brew.sh/2018/04/09/homebrew-1.6.0/) v1.6+
    * Check your version `brew --version` before proceeding

    * Assuming that you have already installed php and apache via [Homebrew](https://brew.sh/) v1.6+
    * **Install [xDebug](https://xdebug.org/docs/install) php extension**
    ```
    pecl channel-update pecl.php.net
    pecl clear-cache
    # Example for php v5.6
    pecl install xdebug-2.5.5
    # Example for php v7.x
    pecl install php-xdebug
    pecl clear-cache
    ```

    * **Edit your `ext-xdebug.ini`**
    * Your `ext-xdebug.ini` file path should look like this
    - `/usr/local/etc/php/7.1/conf.d/ext-xdebug.ini`
    * Add these lines by overwriting exiting
    ```
    ;zend_extension="/usr/local/Cellar/[email protected]/7.1.19/pecl/20160303/xdebug.so"
    zend_extension="xdebug.so"
    xdebug.remote_enable = 1
    xdebug.remote_port = 9000
    xdebug.idekey = PHPSTORM
    xdebug.show_error_trace = 1
    xdebug.remote_autostart = 0
    xdebug.file_link_format = phpstorm://open?%f:%l
    ```

    * **Update your `php.ini`**
    * When installing xdebug extension using `pecl`, it also updates our `php.ini` file, but we don't need that.
    * Find your `php.ini` file, file path should look like this
    - `/usr/local/etc/php/7.1/php.ini`
    * Remove any occurrence of `zend_extension="xdebug.so"` from this file

    * Above configs are bare minimum, read all options [here](https://xdebug.org/docs/all_settings)
    * Restart the apache server to reflect changes
    ```
    sudo apachectl -k restart
    ```

    * **Configure phpStorm**
    * Go through - Settings >> Languages & Frameworks >> PHP >> Debug
    * Check that 'Debug port' is the same you have in your `xdebug.ini`. In our case it was `9000`.
    * Save and close the Settings Dialog

    * **Start debugging**
    * Create some [breakpoints](https://www.jetbrains.com/help/phpstorm/breakpoints-2.html) in your project
    * Make sure those breakpoints gets executed when your visit your virtual host in browser.
    * Start listener by clicking on the telephone :telephone_receiver: button on top toolbar
    * If you can't find telephone button; then go through menus - Run -> Start listening for PHP Debug Connections
    * In your browser access your project url like this
    ```
    http://localdomain.test/?XDEBUG_SESSION_START=1
    ```
    * OR use [bookmarks](https://www.jetbrains.com/phpstorm/marklets/)
    * OR use [chrome extension](https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc?hl=en)

    * You should see a popup window in PhpStorm , click **Accept** connection
    * Done, enjoy debugging !!!

    96 changes: 0 additions & 96 deletions xdebug-php.md
    Original file line number Diff line number Diff line change
    @@ -1,96 +0,0 @@
    ## :beetle: Install and Configure xDebug on Ubuntu/Mac and PhpStorm :elephant:

    * Assuming that you have already installed php and apache
    * **Install [xDebug](https://xdebug.org/docs/install) php extension**
    ```
    # Ubuntu 16.04, php 7.0
    sudo apt-get install php-xdebug
    # Ubuntu 14.04, php 5.6
    sudo apt-get install php5-xdebug
    # Mac OS with Homebrew
    # brew install php<version>-xdebug
    # Example for php v7.2
    brew install php72-xdebug
    ```

    :warning: [Homebrew](https://brew.sh/2018/04/09/homebrew-1.6.0/) v1.6 has changed the way to install php extensions. This tutorial does not cover this yet.

    * **Edit your `xdebug.ini`**
    * Your `xdebug.ini` paths should look like this
    - Ubuntu `/etc/php/7.1/mods-available/xdebug.ini`
    - macOS `/usr/local/etc/php/7.1/conf.d/ext-xdebug.ini`
    * You can run ``locate *xdebug.ini`` to find `xdebug.ini` file location
    * Add these lines without modifying exiting lines
    ```
    xdebug.remote_enable = 1
    xdebug.remote_port = 9000
    xdebug.idekey = PHPSTORM
    xdebug.show_error_trace = 1
    xdebug.remote_autostart = 0
    xdebug.file_link_format = phpstorm://open?%f:%l
    ```

    * Above configs are bare minimum, read all options [here](https://xdebug.org/docs/all_settings)
    * Restart the apache server to reflect changes
    ```
    # Ubuntu
    sudo service apache2 restart
    # MacOS
    sudo apachectl restart
    ```

    * **Configure phpStorm**
    * Go through - Settings >> Languages & Frameworks >> PHP >> Debug
    * Check that 'Debug port' is the same you have in your `xdebug.ini`. In our case it was `9000`.
    * Save and close the Settings Dialog

    * **Start debugging**
    * Create some [breakpoints](https://www.jetbrains.com/help/phpstorm/breakpoints-2.html) in your project
    * Make sure those breakpoints gets executed when your visit your virtual host in browser.
    * Start listener by clicking on the telephone :telephone_receiver: button on top toolbar
    * If you can't find telephone button; then go through menus - Run -> Start listening for PHP Debug Connections
    * In your browser access your project url like this
    ```
    http://localdomain.test/?XDEBUG_SESSION_START=1
    ```
    * OR use [bookmarks](https://www.jetbrains.com/phpstorm/marklets/)
    * OR use [this](https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc?hl=en) chrome extension

    * You should see a popup window in PhpStorm , click **Accept** connection
    * Done, enjoy debugging !!!

    -----

    ### Disable xdebug (Ubuntu)
    ```
    sudo phpdismod xdebug
    ```
    ### Enable xdebug back (Ubuntu)
    ```
    sudo phpenmod xdebug
    ```
    ### Disable xdebug for commandline only (Ubuntu)
    ```
    sudo phpdismod -s cli xdebug
    ```

    ### Troubleshooting
    * Try to change the port to something else, for example `18000`
    * Enable `Break at first line` in phpStorm php debug settings
    * Set `xdebug.remote_autostart` to `1` if you don't want to bother with browser extensions

    ### Resources
    * [Laravel News](https://laravel-news.com/xdebug-phpstorm-valet)
    * [jetBrains](https://www.jetbrains.com/help/phpstorm/configuring-xdebug.html)
    * [Laracasts](https://laracasts.com/series/how-to-be-awesome-in-phpstorm/episodes/20)
    * [xDebug in phpStorm with Screenshots](https://confluence.jetbrains.com/display/PhpStorm/Zero-configuration+Web+Application+Debugging+with+Xdebug+and+PhpStorm)
    * [Laravel Valet](https://pixelfear.com/blog/xdebug-laravel-valet-phpstorm-composer)
    * [getGrav Tutorial](https://getgrav.org/blog/macos-sierra-apache-mysql-vhost-apc)

    #### Not a big fan of phpStorm?
    * [Sublime Text 3](https://packagecontrol.io/packages/Xdebug%20Client)
    * [Visual Studio Code](https://github.com/felixfbecker/vscode-php-debug)

    18 changes: 18 additions & 0 deletions xdebug-resources.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@

    ### Troubleshooting
    * Try to change the port to something else, for example `18000`
    * Enable `Break at first line` in phpStorm php debug settings
    * Set `xdebug.remote_autostart` to `1` if you don't want to bother with browser extensions

    ### Resources
    * [Laravel News](https://laravel-news.com/xdebug-phpstorm-valet)
    * [jetBrains](https://www.jetbrains.com/help/phpstorm/configuring-xdebug.html)
    * [Laracasts](https://laracasts.com/series/how-to-be-awesome-in-phpstorm/episodes/20)
    * [xDebug in phpStorm with Screenshots](https://confluence.jetbrains.com/display/PhpStorm/Zero-configuration+Web+Application+Debugging+with+Xdebug+and+PhpStorm)
    * [Laravel Valet](https://pixelfear.com/blog/xdebug-laravel-valet-phpstorm-composer)
    * [getGrav Tutorial](https://getgrav.org/blog/macos-sierra-apache-mysql-vhost-apc)
    * [xDebug options](https://xdebug.org/docs/all_settings)

    #### Not a big fan of phpStorm?
    * [Sublime Text 3](https://packagecontrol.io/packages/Xdebug%20Client)
    * [Visual Studio Code](https://github.com/felixfbecker/vscode-php-debug)
    65 changes: 65 additions & 0 deletions xdebug-ubuntu.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,65 @@
    ## :beetle: Install and Configure xDebug on Ubuntu and PhpStorm :elephant:

    * Assuming that you have already installed php and apache
    * **Install [xDebug](https://xdebug.org/docs/install) php extension**
    ```
    # Ubuntu 16.04,18.04 php 7.x
    sudo apt-get install php-xdebug
    # Ubuntu 14.04, php 5.6
    sudo apt-get install php5-xdebug
    ```

    * **Edit your `xdebug.ini`**
    * Your `xdebug.ini` file path should look like this
    - `/etc/php/7.1/mods-available/xdebug.ini`
    * Add these lines without modifying exiting
    ```
    xdebug.remote_enable = 1
    xdebug.remote_port = 9000
    xdebug.idekey = PHPSTORM
    xdebug.show_error_trace = 1
    xdebug.remote_autostart = 0
    xdebug.file_link_format = phpstorm://open?%f:%l
    ```
    * Restart the apache server to reflect changes
    ```
    sudo service apache2 restart
    ```

    * **Configure phpStorm**
    * Go through - Settings >> Languages & Frameworks >> PHP >> Debug
    * Check that 'Debug port' is the same you have in your `xdebug.ini`. In our case it was `9000`.
    * Save and close the Settings Dialog

    * **Start debugging**
    * Create some [breakpoints](https://www.jetbrains.com/help/phpstorm/breakpoints-2.html) in your project
    * Make sure those breakpoints gets executed when your visit your virtual host in browser.
    * Start listener by clicking on the telephone :telephone_receiver: button on top toolbar
    * If you can't find telephone button; then go through menus - Run -> Start listening for PHP Debug Connections
    * In your browser access your project url like this
    ```
    http://localdomain.test/?XDEBUG_SESSION_START=1
    ```
    * OR use [bookmarks](https://www.jetbrains.com/phpstorm/marklets/)
    * OR use [chrome extension](https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc?hl=en)

    * You should see a popup window in PhpStorm , click **Accept** connection
    * Done, enjoy debugging !!!

    -----

    ### Disable xdebug
    ```
    sudo phpdismod xdebug
    ```
    ### Enable xdebug back
    ```
    sudo phpenmod xdebug
    ```
    ### Disable xdebug for commandline only
    ```
    sudo phpdismod -s cli xdebug
    ```


  14. @ankurk91 ankurk91 revised this gist Apr 28, 2018. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions xdebug-php.md
    Original file line number Diff line number Diff line change
    @@ -15,6 +15,8 @@ sudo apt-get install php5-xdebug
    brew install php72-xdebug
    ```

    :warning: [Homebrew](https://brew.sh/2018/04/09/homebrew-1.6.0/) v1.6 has changed the way to install php extensions. This tutorial does not cover this yet.

    * **Edit your `xdebug.ini`**
    * Your `xdebug.ini` paths should look like this
    - Ubuntu `/etc/php/7.1/mods-available/xdebug.ini`
  15. @ankurk91 ankurk91 revised this gist Apr 17, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion xdebug-php.md
    Original file line number Diff line number Diff line change
    @@ -86,7 +86,7 @@ sudo phpdismod -s cli xdebug
    * [Laracasts](https://laracasts.com/series/how-to-be-awesome-in-phpstorm/episodes/20)
    * [xDebug in phpStorm with Screenshots](https://confluence.jetbrains.com/display/PhpStorm/Zero-configuration+Web+Application+Debugging+with+Xdebug+and+PhpStorm)
    * [Laravel Valet](https://pixelfear.com/blog/xdebug-laravel-valet-phpstorm-composer)

    * [getGrav Tutorial](https://getgrav.org/blog/macos-sierra-apache-mysql-vhost-apc)

    #### Not a big fan of phpStorm?
    * [Sublime Text 3](https://packagecontrol.io/packages/Xdebug%20Client)
  16. @ankurk91 ankurk91 revised this gist Feb 24, 2018. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion xdebug-php.md
    Original file line number Diff line number Diff line change
    @@ -78,13 +78,14 @@ sudo phpdismod -s cli xdebug
    ### Troubleshooting
    * Try to change the port to something else, for example `18000`
    * Enable `Break at first line` in phpStorm php debug settings
    * Set `xdebug.remote_autostart` to `1` if you don't want bother with browser extensions
    * Set `xdebug.remote_autostart` to `1` if you don't want to bother with browser extensions

    ### Resources
    * [Laravel News](https://laravel-news.com/xdebug-phpstorm-valet)
    * [jetBrains](https://www.jetbrains.com/help/phpstorm/configuring-xdebug.html)
    * [Laracasts](https://laracasts.com/series/how-to-be-awesome-in-phpstorm/episodes/20)
    * [xDebug in phpStorm with Screenshots](https://confluence.jetbrains.com/display/PhpStorm/Zero-configuration+Web+Application+Debugging+with+Xdebug+and+PhpStorm)
    * [Laravel Valet](https://pixelfear.com/blog/xdebug-laravel-valet-phpstorm-composer)


    #### Not a big fan of phpStorm?
  17. @ankurk91 ankurk91 revised this gist Feb 24, 2018. 1 changed file with 8 additions and 5 deletions.
    13 changes: 8 additions & 5 deletions xdebug-php.md
    Original file line number Diff line number Diff line change
    @@ -75,10 +75,6 @@ sudo phpenmod xdebug
    sudo phpdismod -s cli xdebug
    ```

    #### Not a big fan of phpStorm?
    * [Sublime Text 3](https://packagecontrol.io/packages/Xdebug%20Client)
    * [Visual Studio Code](https://github.com/felixfbecker/vscode-php-debug)

    ### Troubleshooting
    * Try to change the port to something else, for example `18000`
    * Enable `Break at first line` in phpStorm php debug settings
    @@ -87,4 +83,11 @@ sudo phpdismod -s cli xdebug
    ### Resources
    * [Laravel News](https://laravel-news.com/xdebug-phpstorm-valet)
    * [jetBrains](https://www.jetbrains.com/help/phpstorm/configuring-xdebug.html)
    * [Laracasts](https://laracasts.com/series/how-to-be-awesome-in-phpstorm/episodes/20)
    * [Laracasts](https://laracasts.com/series/how-to-be-awesome-in-phpstorm/episodes/20)
    * [xDebug in phpStorm with Screenshots](https://confluence.jetbrains.com/display/PhpStorm/Zero-configuration+Web+Application+Debugging+with+Xdebug+and+PhpStorm)


    #### Not a big fan of phpStorm?
    * [Sublime Text 3](https://packagecontrol.io/packages/Xdebug%20Client)
    * [Visual Studio Code](https://github.com/felixfbecker/vscode-php-debug)

  18. @ankurk91 ankurk91 revised this gist Feb 23, 2018. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions xdebug-php.md
    Original file line number Diff line number Diff line change
    @@ -81,8 +81,8 @@ sudo phpdismod -s cli xdebug

    ### Troubleshooting
    * Try to change the port to something else, for example `18000`
    * Enable `Break at first line` in phpStorm
    * Set `xdebug.remote_autostart` to `1` if you want bother with browser extensions
    * Enable `Break at first line` in phpStorm php debug settings
    * Set `xdebug.remote_autostart` to `1` if you don't want bother with browser extensions

    ### Resources
    * [Laravel News](https://laravel-news.com/xdebug-phpstorm-valet)
  19. @ankurk91 ankurk91 revised this gist Feb 23, 2018. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions xdebug-php.md
    Original file line number Diff line number Diff line change
    @@ -26,6 +26,7 @@ xdebug.remote_enable = 1
    xdebug.remote_port = 9000
    xdebug.idekey = PHPSTORM
    xdebug.show_error_trace = 1
    xdebug.remote_autostart = 0
    xdebug.file_link_format = phpstorm://open?%f:%l
    ```

    @@ -81,6 +82,7 @@ sudo phpdismod -s cli xdebug
    ### Troubleshooting
    * Try to change the port to something else, for example `18000`
    * Enable `Break at first line` in phpStorm
    * Set `xdebug.remote_autostart` to `1` if you want bother with browser extensions

    ### Resources
    * [Laravel News](https://laravel-news.com/xdebug-phpstorm-valet)
  20. @ankurk91 ankurk91 revised this gist Feb 23, 2018. 1 changed file with 15 additions and 12 deletions.
    27 changes: 15 additions & 12 deletions xdebug-php.md
    Original file line number Diff line number Diff line change
    @@ -11,27 +11,26 @@ sudo apt-get install php5-xdebug
    # Mac OS with Homebrew
    # brew install php<version>-xdebug
    # Example for php v7.1
    brew install php71-xdebug
    # Example for php v7.2
    brew install php72-xdebug
    ```

    * **Edit your `xdebug.ini`**
    * Your `xdebug.ini` paths should look like this
    - Ubuntu `/etc/php/7.1/mods-available/xdebug.ini`
    - macOS `/usr/local/etc/php/7.1/conf.d/ext-xdebug.ini`
    * You can run ``locate *xdebug.ini`` to find `xdebug.ini` file location
    * Add these lines without modifying exiting
    * Add these lines without modifying exiting lines
    ```
    xdebug.remote_enable = 1
    xdebug.show_error_trace = 1
    xdebug.remote_port = 9001
    xdebug.remote_port = 9000
    xdebug.idekey = PHPSTORM
    xdebug.max_nesting_level = 512
    xdebug.show_error_trace = 1
    xdebug.file_link_format = phpstorm://open?%f:%l
    ```

    * Above configs are bare minimum, read all options [here](https://xdebug.org/docs/all_settings)
    * Restart apache server to reflect changes
    * Restart the apache server to reflect changes
    ```
    # Ubuntu
    sudo service apache2 restart
    @@ -42,15 +41,15 @@ sudo apachectl restart

    * **Configure phpStorm**
    * Go through - Settings >> Languages & Frameworks >> PHP >> Debug
    * Check that 'Debug port' is the same you have in your `xdebug.ini`. In our case it was `9001`.
    * Check that 'Debug port' is the same you have in your `xdebug.ini`. In our case it was `9000`.
    * Save and close the Settings Dialog

    * **Start debugging**
    * In PhpStorm create some [breakpoints](https://www.jetbrains.com/help/phpstorm/breakpoints-2.html) in your project
    * Make sure breakpoints gets executed when your visit your virtual host.
    * Create some [breakpoints](https://www.jetbrains.com/help/phpstorm/breakpoints-2.html) in your project
    * Make sure those breakpoints gets executed when your visit your virtual host in browser.
    * Start listener by clicking on the telephone :telephone_receiver: button on top toolbar
    * If you can't find telephone button; then go through menus - Run >> Start listening for PHP Debug connections
    * In your browser access your project like this
    * If you can't find telephone button; then go through menus - Run -> Start listening for PHP Debug Connections
    * In your browser access your project url like this
    ```
    http://localdomain.test/?XDEBUG_SESSION_START=1
    ```
    @@ -79,6 +78,10 @@ sudo phpdismod -s cli xdebug
    * [Sublime Text 3](https://packagecontrol.io/packages/Xdebug%20Client)
    * [Visual Studio Code](https://github.com/felixfbecker/vscode-php-debug)

    ### Troubleshooting
    * Try to change the port to something else, for example `18000`
    * Enable `Break at first line` in phpStorm

    ### Resources
    * [Laravel News](https://laravel-news.com/xdebug-phpstorm-valet)
    * [jetBrains](https://www.jetbrains.com/help/phpstorm/configuring-xdebug.html)
  21. @ankurk91 ankurk91 revised this gist Feb 18, 2018. 1 changed file with 19 additions and 36 deletions.
    55 changes: 19 additions & 36 deletions xdebug-php.md
    Original file line number Diff line number Diff line change
    @@ -15,65 +15,48 @@ sudo apt-get install php5-xdebug
    brew install php71-xdebug
    ```

    * Now edit your ```php.ini``` (for me it was ```/etc/php/7.1/apache2/php.ini```) and add these lines at last
    * You can run ``locate php.ini`` to find `php.ini` file location
    * **Edit your `xdebug.ini`**
    * Your `xdebug.ini` paths should look like this
    - Ubuntu `/etc/php/7.1/mods-available/xdebug.ini`
    - macOS `/usr/local/etc/php/7.1/conf.d/ext-xdebug.ini`
    * You can run ``locate *xdebug.ini`` to find `xdebug.ini` file location
    * Add these lines without modifying exiting
    ```
    [Xdebug]
    zend_extension="/usr/lib/php/20160303/xdebug.so"
    xdebug.remote_enable = 1
    xdebug.remote_port = 9000
    xdebug.show_error_trace = 1
    xdebug.remote_port = 9001
    xdebug.idekey = PHPSTORM
    xdebug.max_nesting_level = 512
    xdebug.file_link_format = phpstorm://open?%f:%l
    ```
    * Above config is bare minimum, read all options [here](https://xdebug.org/docs/all_settings)
    * Make sure **xdebug.so** path is correct in above configuration
    * To find the **xdebug.so** file path; run this command
    ```
    locate xdebug.so
    ```
    * Above command will return the correct path to `xdebug.so` file

    * Now check php version
    ```
    php --version
    ```
    * Above command should return like this
    ```
    PHP 7.1.12-3+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Dec 14 2017 15:37:13) ( NTS )
    Copyright (c) 1997-2017 The PHP Group
    Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.1.12-3+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2017, by Zend Technologies
    with Xdebug v2.5.5, Copyright (c) 2002-2017, by Derick Rethans
    ```
    * Notice the Xdebug version in last line
    * Above configs are bare minimum, read all options [here](https://xdebug.org/docs/all_settings)
    * Restart apache server to reflect changes
    ```
    # Ubuntu
    sudo service apache2 restart
    # Mac OS
    # MacOS
    sudo apachectl restart
    ```

    * **Configure phpStorm**
    * Go through - Settings >> Languages & Frameworks >> PHP
    * Lets set php Interpreter, to do so; click on three dots [...] button
    * On the new window; click on plus [+] button and select ```/usr/bin/php``` from suggestion popup
    * Save and close this window
    * Now, on the Settings window; select the Interpreter you just created
    * Go through - Settings >> Languages & Frameworks >> PHP >> Debug
    * Check that 'Debug port' is the same you have in your php.ini. In our case it is `9000`.
    * Check that 'Debug port' is the same you have in your `xdebug.ini`. In our case it was `9001`.
    * Save and close the Settings Dialog

    * **Start debuging**
    * **Start debugging**
    * In PhpStorm create some [breakpoints](https://www.jetbrains.com/help/phpstorm/breakpoints-2.html) in your project
    * Make sure breakpoints gets executed when your browser your website.
    * Make sure breakpoints gets executed when your visit your virtual host.
    * Start listener by clicking on the telephone :telephone_receiver: button on top toolbar
    * If you can't find telephone button; then go through menus - Run >> Start listening for PHP Debug connections
    * In your browser access your project like this, OR use [bookmarks](https://www.jetbrains.com/phpstorm/marklets/) OR use [this](https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc?hl=en) chrome extension
    * In your browser access your project like this
    ```
    http://localdomain.dev/?XDEBUG_SESSION_START=1
    http://localdomain.test/?XDEBUG_SESSION_START=1
    ```
    * OR use [bookmarks](https://www.jetbrains.com/phpstorm/marklets/)
    * OR use [this](https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc?hl=en) chrome extension

    * You should see a popup window in PhpStorm , click **Accept** connection
    * Done, enjoy debugging !!!

  22. @ankurk91 ankurk91 revised this gist Jan 21, 2018. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions xdebug-php.md
    Original file line number Diff line number Diff line change
    @@ -15,11 +15,11 @@ sudo apt-get install php5-xdebug
    brew install php71-xdebug
    ```

    * Now edit your ```php.ini``` (for me it was ```/etc/php/7.0/apache2/php.ini```) and add these lines at last
    * Now edit your ```php.ini``` (for me it was ```/etc/php/7.1/apache2/php.ini```) and add these lines at last
    * You can run ``locate php.ini`` to find `php.ini` file location
    ```
    [Xdebug]
    zend_extension="/usr/lib/php/20151012/xdebug.so"
    zend_extension="/usr/lib/php/20160303/xdebug.so"
    xdebug.remote_enable = 1
    xdebug.remote_port = 9000
    xdebug.idekey = PHPSTORM
  23. @ankurk91 ankurk91 revised this gist Jan 20, 2018. 1 changed file with 11 additions and 10 deletions.
    21 changes: 11 additions & 10 deletions xdebug-php.md
    Original file line number Diff line number Diff line change
    @@ -11,8 +11,8 @@ sudo apt-get install php5-xdebug
    # Mac OS with Homebrew
    # brew install php<version>-xdebug
    # Example for php v5.6
    brew install php56-xdebug
    # Example for php v7.1
    brew install php71-xdebug
    ```

    * Now edit your ```php.ini``` (for me it was ```/etc/php/7.0/apache2/php.ini```) and add these lines at last
    @@ -40,11 +40,11 @@ php --version
    ```
    * Above command should return like this
    ```
    PHP 7.0.15-0ubuntu0.16.04.4 (cli) ( NTS )
    PHP 7.1.12-3+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Dec 14 2017 15:37:13) ( NTS )
    Copyright (c) 1997-2017 The PHP Group
    Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.15-0ubuntu0.16.04.4, Copyright (c) 1999-2017, by Zend Technologies
    with Xdebug v2.4.0, Copyright (c) 2002-2016, by Derick Rethans
    Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.1.12-3+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2017, by Zend Technologies
    with Xdebug v2.5.5, Copyright (c) 2002-2017, by Derick Rethans
    ```
    * Notice the Xdebug version in last line
    * Restart apache server to reflect changes
    @@ -62,7 +62,7 @@ sudo apachectl restart
    * Save and close this window
    * Now, on the Settings window; select the Interpreter you just created
    * Go through - Settings >> Languages & Frameworks >> PHP >> Debug
    * Check that Debug port is the same you have in your php.ini. In our case it is `9000`.
    * Check that 'Debug port' is the same you have in your php.ini. In our case it is `9000`.
    * Save and close the Settings Dialog

    * **Start debuging**
    @@ -87,13 +87,14 @@ sudo phpdismod xdebug
    ```
    sudo phpenmod xdebug
    ```
    ### Disable xdebug for commandline only
    ### Disable xdebug for commandline only (Ubuntu)
    ```
    sudo phpdismod -s cli xdebug
    ```

    #### Sublime Text 3 user ?
    * Try this [package](https://packagecontrol.io/packages/Xdebug%20Client)
    #### Not a big fan of phpStorm?
    * [Sublime Text 3](https://packagecontrol.io/packages/Xdebug%20Client)
    * [Visual Studio Code](https://github.com/felixfbecker/vscode-php-debug)

    ### Resources
    * [Laravel News](https://laravel-news.com/xdebug-phpstorm-valet)
  24. @ankurk91 ankurk91 revised this gist Jan 19, 2018. 1 changed file with 5 additions and 2 deletions.
    7 changes: 5 additions & 2 deletions xdebug-php.md
    Original file line number Diff line number Diff line change
    @@ -60,11 +60,14 @@ sudo apachectl restart
    * Lets set php Interpreter, to do so; click on three dots [...] button
    * On the new window; click on plus [+] button and select ```/usr/bin/php``` from suggestion popup
    * Save and close this window
    * Now, on the Settings window; select the Interpreter you just created then save and close

    * Now, on the Settings window; select the Interpreter you just created
    * Go through - Settings >> Languages & Frameworks >> PHP >> Debug
    * Check that Debug port is the same you have in your php.ini. In our case it is `9000`.
    * Save and close the Settings Dialog

    * **Start debuging**
    * In PhpStorm create some [breakpoints](https://www.jetbrains.com/help/phpstorm/breakpoints-2.html) in your project
    * Make sure breakpoints gets executed when your browser your website.
    * Start listener by clicking on the telephone :telephone_receiver: button on top toolbar
    * If you can't find telephone button; then go through menus - Run >> Start listening for PHP Debug connections
    * In your browser access your project like this, OR use [bookmarks](https://www.jetbrains.com/phpstorm/marklets/) OR use [this](https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc?hl=en) chrome extension
  25. @ankurk91 ankurk91 revised this gist Nov 18, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion xdebug-php.md
    Original file line number Diff line number Diff line change
    @@ -84,7 +84,7 @@ sudo phpdismod xdebug
    ```
    sudo phpenmod xdebug
    ```
    ### Disable xdebug fro commandline only
    ### Disable xdebug for commandline only
    ```
    sudo phpdismod -s cli xdebug
    ```
  26. @ankurk91 ankurk91 revised this gist Nov 11, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion xdebug-php.md
    Original file line number Diff line number Diff line change
    @@ -84,7 +84,7 @@ sudo phpdismod xdebug
    ```
    sudo phpenmod xdebug
    ```
    ### Disable xdebug from commandline only
    ### Disable xdebug fro commandline only
    ```
    sudo phpdismod -s cli xdebug
    ```
  27. @ankurk91 ankurk91 revised this gist Oct 5, 2017. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions xdebug-php.md
    Original file line number Diff line number Diff line change
    @@ -84,6 +84,10 @@ sudo phpdismod xdebug
    ```
    sudo phpenmod xdebug
    ```
    ### Disable xdebug from commandline only
    ```
    sudo phpdismod -s cli xdebug
    ```

    #### Sublime Text 3 user ?
    * Try this [package](https://packagecontrol.io/packages/Xdebug%20Client)
  28. @ankurk91 ankurk91 revised this gist Aug 12, 2017. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions xdebug-php.md
    Original file line number Diff line number Diff line change
    @@ -88,3 +88,7 @@ sudo phpenmod xdebug
    #### Sublime Text 3 user ?
    * Try this [package](https://packagecontrol.io/packages/Xdebug%20Client)

    ### Resources
    * [Laravel News](https://laravel-news.com/xdebug-phpstorm-valet)
    * [jetBrains](https://www.jetbrains.com/help/phpstorm/configuring-xdebug.html)
    * [Laracasts](https://laracasts.com/series/how-to-be-awesome-in-phpstorm/episodes/20)
  29. @ankurk91 ankurk91 renamed this gist Aug 3, 2017. 1 changed file with 7 additions and 6 deletions.
    13 changes: 7 additions & 6 deletions xdebug.md → xdebug-php.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ## :beetle: Install and Configure xDebug on Ubuntu and PhpStorm :elephant:
    ## :beetle: Install and Configure xDebug on Ubuntu/Mac and PhpStorm :elephant:

    * Assuming that you have already installed php and apache
    * **Install [xDebug](https://xdebug.org/docs/install) php extension**
    @@ -11,12 +11,12 @@ sudo apt-get install php5-xdebug
    # Mac OS with Homebrew
    # brew install php<version>-xdebug
    # Example
    # Example for php v5.6
    brew install php56-xdebug
    ```

    * Now edit your ```php.ini``` (for me it was ```/etc/php/7.0/apache2/php.ini```) and add these lines at last
    * You can run ``locate php.ini`` to find its location
    * You can run ``locate php.ini`` to find `php.ini` file location
    ```
    [Xdebug]
    zend_extension="/usr/lib/php/20151012/xdebug.so"
    @@ -32,7 +32,7 @@ xdebug.file_link_format = phpstorm://open?%f:%l
    ```
    locate xdebug.so
    ```
    * Above command will return the correct path to xdebug.so file
    * Above command will return the correct path to `xdebug.so` file

    * Now check php version
    ```
    @@ -66,6 +66,7 @@ sudo apachectl restart
    * **Start debuging**
    * In PhpStorm create some [breakpoints](https://www.jetbrains.com/help/phpstorm/breakpoints-2.html) in your project
    * Start listener by clicking on the telephone :telephone_receiver: button on top toolbar
    * If you can't find telephone button; then go through menus - Run >> Start listening for PHP Debug connections
    * In your browser access your project like this, OR use [bookmarks](https://www.jetbrains.com/phpstorm/marklets/) OR use [this](https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc?hl=en) chrome extension
    ```
    http://localdomain.dev/?XDEBUG_SESSION_START=1
    @@ -75,11 +76,11 @@ http://localdomain.dev/?XDEBUG_SESSION_START=1

    -----

    ### Disable xdebug
    ### Disable xdebug (Ubuntu)
    ```
    sudo phpdismod xdebug
    ```
    ### Enable xdebug back
    ### Enable xdebug back (Ubuntu)
    ```
    sudo phpenmod xdebug
    ```
  30. @ankurk91 ankurk91 revised this gist Jul 22, 2017. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion xdebug.md
    Original file line number Diff line number Diff line change
    @@ -87,4 +87,3 @@ sudo phpenmod xdebug
    #### Sublime Text 3 user ?
    * Try this [package](https://packagecontrol.io/packages/Xdebug%20Client)

    _Ubuntu 16.04, php 7.*, phpStorm 2016,2017_