CuBoulder/express_local

Name: express_local

Owner: University of Colorado Boulder

Description: Vagrant and Ansible based local development environment for Web Express at the University of Colorado Boulder.

Created: 2015-10-09 17:25:25.0

Updated: 2017-08-22 21:43:00.0

Pushed: 2017-12-06 17:13:32.0

Homepage:

Size: 501

Language: HTML

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

If you don't care how it works, you just want it to work now; checkout the short version

Express Local

A local development environment for Cu Boulder's Web Express Platform. The playbooks require a vault password file to run properly.

You will need

Installation

Ubuntu Installations
OSX
All operating systems
Installation Troubleshooting

Logging (Commented out for now)

XDebug via PHPStorm

  1. Once you have PHPStorm installed, go to PHPStorm > Preferences > PHP and click on the ellipsis in the “Interpreter” section.
  2. This will bring up another screen where your PHP interpreters are listed. You want to click the “+” icon to add a “remote” interpreter.
  3. On the next screen, you'll have the option of configuring via SSH or Vagrant, and you'll want to choose Vagrant.
  4. Now you have to add the “Vagrant Instance Folder”. The location where be where you setup your vm, for me it was “~/vms/express_local”.
  5. If you see the “vagrant host URL” line populate with an address, then you've successfully setup the remote PHP interpreter.
  6. If you get an error message saying that the “VboxManage binary” can't be found and needs adding to the PATH variable, then you need to debug that, and there are several ways you could fix your issue. For me, I just had to create a symbolic link to fix the issue.
     ln -s /usr/local/bin/VBoxManage /usr/bin/VBoxManage
    so may need to use this line while SSHing into your VM
    t VBOX_INSTALL_PATH=%VBOX_MSI_INSTALL_PATH%
    
  7. Now that PHPStorm is connected to your VM, you need to setup XDebug. The Xdebug extension is already loaded on your machine, but you need to add it to the php.ini settings in order for Apache to load it. To find out where your extension is, you can type the following into your terminal:
     / -name 'xdebug.so' 2> /dev/null
    
  8. You will now need to add the extension to your php.ini settings. On a local Drupal installation, you can go to “/admin/reports/status/php” to see where the php.ini file is being loaded. You should also see a section for other .ini files being parsed and loaded. Look for “xdbug.ini” and open that file in a text editor.
  9. Your file will have options already declared in it, but you need to add a line to the top of where your Xdebug extension is located. My xdebug.ini file looks like this:
    _extension=/usr/lib64/php/modules/xdebug.so
    ug.remote_enable=1
    ug.remote_port=9000
    ug.remote_handler="dbgp"
    ug.remote_connect_back = 1
    
    ug.profiler_enable=0
    ug.profiler_output_dir=/tmp/xdebug_profiles
    ug.profiler_enable_trigger=1
    ug.profiler_output_name=cachegrind.out.%p
    
    ug.max_nesting_level=200
    
  10. Once you change that file, you'll need to restart Apache “sudo apachectl restart”, and you should see Xdebug now on “/admin/reports/status/php”.
  11. The last thing to do is to map the folders on your machine to the paths on your VM, PHPStorm > Preferences > PHP > Servers. Because of the symbolic links used in DSLM, the paths will reside in the “dslm_base” and “packages_base” folders. your root level project folder should map to a Drupal core, e.g. “/data/code/dslm_base/cores/drupal-7.41”, and the profile path to whichever profile you are using, e.g. “/data/code/dslm_base/profiles/express”
  12. Once your path mapping is setup, you should be able to turn on debugging in PHPStorm, Run > Start Listening for PHP Connections, set a breakpoint, and use XDebug from within PHPStorm.

To Dos:

Notes


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.