Profiling PHP with Tideways under MacPorts


I wanted to try the Tideways profiler with my PHP 7 installed via MacPorts. Since Tiodeways can only be installed using Homebrew on a Mac, I went ahead and installed that:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)

Then I followed the installation routine as laid out in the Tideways documentation:

brew tap tideways/homebrew-profiler
brew install pcre
brew install php70-tideways --without-homebrew-php

This failed for me, saying Error: No available formula with the name "php70" after building the extension. So… I did this instead:

unzip ~/Library/Caches/Homebrew/php70-tideways-v4.0.5.zip
cd php-profiler-extension-4.0.5
phpize
./configure
make
sudo cp modules/tideways.so /opt/local/lib/php70/extensions/no-debug-non-zts-20151012

Now the next step is to:

brew install tideways-daemon

Start the stuff with:

sudo brew services start tideways/profiler/tideways-daemon

I needed to use sudo, otherwise I had this in /usr/local/var/tideways/daemon.log

2016/07/14 10:27:36 Listen Unix Socket: listen unix /usr/local/var/run/tidewaysd.sock: bind: permission denied

Now I needed to do some configuration, again followed the docs for that. Since I installed the extension manually, I added this as well:

extension="tideways.so"

Now php -m listed the tideways module and php -i showed details about it as well. Including a line saying "Tideways.php found: No". Aha, this needs another step: Tideways.php must be included to use the actual UI. The extension README.md explains this:

You also need the latest ``Tideways.php`` if you want to use the Profiler in combination with our daemon and UI. Download the file from Github. Put this file into your
extension directory. You can find the location by calling:

    $ php -r 'echo ini_get("extension_dir");'
    $ cp Tideways.php /path/to/php/lib

That should be it, now on to actually using it…

Note: For now, I do get measurements collected (according to the daemon log), but nothing appears in the tideways.io UI.


Leave a reply

Karsten Dambekalns

Creative Code Engineer

Contact / Impressum