• Tech

    How to replace PHP on OS X Server 5.x with PHP via Homebrew

    The version of  PHP on OS X Server 5.x is v.5.3.x. As of this writing, the current distro of PHP on Homebrew is v.7.4.12. You will lose the ability to control PHP loading from the GUI.

    To prep, you should have prepared a phpinfo.php file on your website in an orphan directory so you can check all the modules that load with PHP. It is simply a text file with the name phpinfo.php and the content is:


    Don’t worry if PHP is currently running.

    Install PHP via Homebrew:

    brew install php
  • Uncategorized

    Re: Security Update 2006-001, SquirrelMail 1.4.5 and PHP 4.4.1 [by celiawessen]


    *** Update 3/15/2006***

    OK, so here comes Apple’s Security Update 2006-002. It contains the PHP 4.4.1 and SM 1.4.5 update again.

    I installed the security patch, then reinstalled the Japanese patch for SM 1.4.5, and uploaded the precompiled ja_JP locale files available from SquirrelMail.JP. It all looked good until I noticed that if I sent a message with a Japanese subject and no Japanese characters in the body, the message gets encoded in 8bit. This creates a problem for strict e-mail client software like Mail.app.

    I didn’t notice this at first because the subject line looked fine in SM. But after retrieving the same messages from the IMAP server using Mail.app, I found that the subject line had mojibake.

    This problem does not occur if there are Japanese characters in the subject line and the body of the message. In that case, the message gets encoded into 7bit.

    It is rare that anybody would send a message with a Japanese subject line and no Japanese characters in the body… but it does happen.

    So, I downgraded PHP to 4.3.11 from my trusty backup.


    cp libphp4.so libphp4.4.1.so

    cp libphp4.3.11.so libphp4.so

    apachectl restart

    Now the same 7/8bit problem still occurs. But for some reason, the subject lines started looking fine in Mail.app… what the fcuk is happening? I think it has something to do with the mbstr.mimeheaderencoding in PHP 4.4.1 that can only be patched pre-compilation.

    Because Mac OS X Server does not ship with many of the libraries necessary to recompile PHP, I just gave up. It is a hassle to collect them all unless you’re going to compile other stuff too.