Down for a couple days…

I upgraded this server from OS X Mountain Lion Server to OS X Mavericks Server two nights ago….. The server is remotely managed by Macstadium and they HOOKED me up when it didn’t return from the upgrade.  They rebuilt the upgrade from USB and  put it back where it needed to be!  Kudos to Phil @ … Continue Reading

Add SSH2 PHP Extension to Mountain Lion Server

If you’re running MAMP on Mountain Lion Server OS X you’ve probably noticed a few missing PHP extensions. Here’s a quick way to install the SSH2 extension: Download libssh2-1.4.2.tar.gz Download the latest SSH2 PECL from http://pecl.php.net/package/ssh2 Untar and gzip both packages in your download folder Compile libssh

Compile SSH2

Copy ssh2.so to your PHP extension_dir … Continue Reading

PHP Function to Pre-format and print and array

If you spend any time at all scripting in PHP, you probably setup arrays. When I’m coding and developing I always print the array so I know what I’m dealing with.  But to print an array in HTML, you have to preformat the text first.  When dealing with a lot of arrays, you end up … Continue Reading

PHP: How to print all $_SERVER Variables

If you don’t want to go through the PHP $_SERVER variables one by one to look for something, you can print them all at once with a simple PHP loop: The functions below print all of the PHP $_SERVER variables to the screen. <?php while (list($var,$value) = each ($_SERVER)) { echo “$var => $value”; } … Continue Reading

PHP: How to redirect based on requested page

I have several websites running, but they all are behind the same IP address. I don’t want to do funny things with ports or buy additional address space, so I came up with a “call forwarding” type page as my home page (that the user never sees). Based on the requested web host I will … Continue Reading