macports

D8 - What to Do If You Have Macports and No Composer

I was listening to Webchick's presentation on Upgrading YOUR Module to Drupal 8 (https://www.youtube.com/watch?v=wKdU2Q1NIZQ), following along with my own contributed module (https://drupal.org/project/node_theme) and when she reached a seemingly innocuous step

  • Installation:
    • drush dl drupalmoduleupgrader
    • cd drupalmoduleupgrader
    • composer install

I received the following response in my Mac terminal window

Drupal 7 and MySQL sockets

I recently switched from a mysql.com implementation of MySQL to MacPorts on my local, and the Drupal sites would no longer load.

The MacPorts my.cnf file turns off networking, so that multiple versions of MySQL can be run. In doing so, one must then use socket files to access MySQL instead of TCP/IP. This requires a change to the database config in the settings.php file.

Simply add the path to your socket file as an additional line in the database config array, as follows:

'unix_socket' => '/<path>/mysqld.sock'

PhpStorm, OS X, Macports and the Hunt for php-cgi

I love PhpStorm, but even though I've been using it forever, much of it remains a mystery. The latest problem I had was getting it to work with xdebug in the browser (again) after upgrading to version 8.  This turned out not to be a PhpStorm issue (see content/phpstorm-and-xdebug-browser-missing-instruction), but the time and effort it took to resolve revealed again that, often, the PhpStorm help file is all but helpful. 

PhpStorm and xdebug in the browser - the missing instruction

I spent the usual two lifetimes getting xdebug working (again) after upgrading to a new major version of phpStorm. Finally, I could debug a standalone php script in the IDE, but all attempts to do so from the browser were fruitless.

It turns out that phpStorm and the browser were using different versions of php.

Things to do (note that I am using Macports):

Subscribe to macports