Simon tip: enable PHP for scripts

Simon is a very powerful server monitoring tool. One of the reasons for this power is the ability to create custom services, filters and notifiers using a variety of scripting languages.

While languages like AppleScript, Perl, Python, Ruby and shell scripts work out of the box, many people are more comfortable with PHP, commonly used server-side for web pages. But that is not enabled by default in OS X.

It's not too difficult to make it available for Simon scripts, though... if you feel comfortable using Terminal.

Fire up Terminal and enter this command to edit the Apache configuration:

sudo nano /etc/apache2/httpd.conf

You'll be prompted for your password (for the sudo command), then presented with an editor screen.

Press Control-W to search for php. This will move the cursor to this line:

#LoadModule php5_module libexec/apache2/libphp5.so

Delete the leading # to uncomment this line.

Then press Control-O to save the change, then Control-X to exit the editor.

Finally, for good measure, tell the Apache web server to restart:

sudo apachectl restart

That's it! You should now be able to run PHP scripts in Simon.