Naviga Web
Docs Home
  • Introduction
  • Release notes
  • Starter kit
    • Introduction
    • Environment Variables
    • Makefile
    • Changelog
    • API
  • Feature: Advanced Search
    • User guide
    • Search Help
    • How to Setup
    • Technical Details
  • Developer documentation
    • Developer prerequisites
      • Developer hardware suggestions
      • Setup on Windows
      • Setup on Linux/Ubuntu
    • Getting started with development
      • Composer package management
      • Gulp and asset building (optional)
      • Git
      • Hosts file
      • Certificate
      • Initiate Naviga Web
      • Start Naviga Web
      • Bin scripts
      • Create theme
      • Environments
      • Deployment
      • Onboarding tasks
        • #0 - New site
        • #1 - Configuration
        • #2 - Front page
        • #3 - Content presentation
        • #4 - OC List
        • #5 - Content containers
        • #6 - Teaser template
        • #7 - Single article
        • #8 - Widget
        • #9 - Custom task
        • #10 - Feedback
    • Architecture
    • Paywall and authentication
      • CloudFront Paywall
      • Engage paywall
      • Lua Paywall (deprecated)
    • Project management: A typical project
    • Database dump
    • Debugging
    • Keep your project up-to-date
    • Gulp and Sass
    • Domain mapping
    • Widgets overview
  • Starter kit packages
    • Base package
      • Changelog
    • Boards plugin (EveryBoard)
      • Installation
      • Setup
      • Board Widgets
        • Linked board
        • Template board
        • Embed widget
        • OC List item
        • Content container
      • Teaser templates
      • Actions and filters
      • Export - import
      • Changelog
    • ContentSync plugin
      • Usage
      • Changelog
    • Drop In Plugins package
      • Changelog
    • Everyware plugin
      • Installation
      • Setup
      • Actions and filters
      • Fetching lists and their content
      • Sorting
      • Widgets
      • Changelog
    • Imengine package
      • Helper class: Imengine
      • Changelog
    • NewsML package
      • Idf Parser
      • Changelog
      • Usage
    • NGINX conf package
      • API
      • Changelog
      • Usage
    • Presentation Preview plugin
      • API
      • Changelog
      • Usage
    • Support package
      • Changelog
    • Theme EU resources package*
      • Changelog
    • Theme US resources package
      • Changelog
    • Twig package
      • Development
        • Filters
          • class_string
          • spacey
          • trim_array
        • Functions
          • php_function
          • php_method
          • render_classes
          • render_partial
        • Operators
          • contains
      • Helper classes
        • View
        • ViewSetup
      • Changelog
  • Widgets and component packages
    • Article List widget
      • Installation
      • Using Article List
      • Changelog
    • Menu handler
      • Usage
      • Changelog
    • Section Header widget
      • Changelog
    • Social media icons widget
      • Installation
      • Changelog
    • Google Analytics plugin
      • Set up Google Analytics
      • Most read widget
      • Changelog
    • Redirect Original URLs plugin
      • Installation
      • Changelog
    • Settings Parameters plugin
      • Installation
      • Usage
      • Changelog
  • Design and theme packages
    • Base theme 1
      • Changelog
    • Base theme 2
      • Colors
      • Fonts
      • Header
      • Menus
      • Pages with Board
      • Sidebars
      • Teaser layouts
      • Article page (text)
      • Article page (embeds)
      • Changelog
    • Example theme
      • Changelog
  • MU Plugins
    • Project Plugin
      • Installation
      • Changelog
    • Starter Package Catalyst
    • Concepts
      • Admin Pages
        • All Concepts
        • Add New Concept
        • Types
        • Errors
        • Concept duplicates
      • API
      • Console
      • Changelog
    • Network
      • Changelog
    • Cache Invalidator
      • Getting Started & WP admin
      • Implementation of Lua endpoint
      • Filters
      • Changelog
    • RSS Feeds
      • Setup
      • Administration pages
      • Changelog
  • Services
    • Imengine
    • Imengine documentation
    • Open Content
    • Writer Bookmarklet
Powered by GitBook
On this page
  • Log files
  • Xdebug
  • Adding and volume-linking the .ini file
  • Configuring PhpStorm
  • Running Xdebug
  • Xdebug and Postman

Was this helpful?

  1. Developer documentation

Debugging

How to check logs and configure Xdebug

Log files

Log files are automatically created in the project folder in the subfolder "log".

  • access.log (nginx access log)

  • error.log (nginx error log)

  • php-fpm-error.log (php-fpm error log)

Follow logs with

tail -f log/error.log

Xdebug

To setup Xdebug in your local environment you need to do the following (some parts of the following are mainly for PhpStorm and chrome, and might need to be changed if using a different IDE):

Adding and volume-linking the .ini file

For Xdebug to run properly it needs to have an xdebug.ini file. In your Docker environment this needs to be mounted into the docker container. To do this, you need to create an xdebug.ini file and place it in the root of the project. The .ini file should contain the following:

xdebug.ini
zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_host=host.docker.internal
xdebug.remote_port=9000
xdebug.idekey=PHPSTORM
xdebug.remote_log=/tmp/xdebug.log

For using different IDEs the xdebug.idekey might need to be changed.

Once this file is in place, you want to have it mounted into the php-fpm Docker container on container start. This can be accomplished by making sure the following is present in your docker-compose.yml

docker-compose.yml
php-fpm:
    volumes:
        - ./xdebug.ini:/etc/php7/conf.d/xdebug.ini

Configuring PhpStorm

You now need to configure PhpStorm to use Xdebug. To do this, go to Run -> Edit configurations.... Now click the + and select Php Remote Debug. You may give this configuration a name, but leaving it blank works as well. Once that is in place you need to configure the mapping towards your local webserver.

Go to Preferences -> Languages & Frameworks -> PHP -> Servers, add a new configuration with + and use the following settings:

Name:_
Host:_
Port: 8081
Debugger: Xdebug
Use path mappings: checked

In the left column, select your project's www directory, then in the right column on the same row enter /var/www.

All that is left now is to add the Xdebug extension to chrome.

Running Xdebug

With the browser extension in place, all you need to do is add a breakpoint to your php code, go to Run -> Run in PhpStorm and select your debug configuration, and finally select Debug in your browser extension and reload the page you want to debug.

Xdebug and Postman

If you wish to debug a request sent by Postman, all you need to do is add XDEBUG_SESSION_START=PHPSTORM as a key-value pair to the request body and start the debug config as you would when debugging via Chrome.

PreviousDatabase dumpNextKeep your project up-to-date

Last updated 3 years ago

Was this helpful?