September 27th, 2009 § § permalink
Just a quick tip on how to use the “Remote Disc” capabilities on any Mac that isn’t an Air. For some reason Apple will let you share a drive but not read it over the network unless you’re on an Air. Yet another quirk from Cupertino. In any case, the solution is easy.
Open up Terminal and run these two commands to update your settings. If you’re afraid of Terminal, just copy and paste these. Trust me, they’re harmless.
defaults write com.apple.NetworkBrowser EnableODiskBrowsing -bool true
defaults write com.apple.NetworkBrowser ODSSupported -bool true
Then open up Activity Monitor and force quit Finder. It will automatically restart. Open up a Finder window and marvel at the glory of sharing an OS X install disc over the network. Particularly handy when your MacBook Pro won’t read a disc.
I’m off to install Snow Leopard on my home/studio MacBook Pro. Over the wireless. Why does this sound like a bad idea? Hmm….
September 24th, 2009 § § permalink
It has been a while since I originally posted this article and somethings have changed. Marc Liyanage has posted his custom PHP 5.3.0 build and, as noted by a comment from Sam, a simple flag would have helped a lot. So…carry on.
As of writing the standard 5.2.x Entropy package from Marc Liyanage does not work with 10.6. This means either a custom compile of PHP 5.2.x and the required extensions or piggybacking the default 5.3.0 install. After spending a few days attempting trying to modify the existing Entropy install, trying to build new plug-ins against it and many other techniques it became clear that the quickest path back to development was to used the 5.3.0 install and provide the missing plug-ins.
What’s missing with the 5.3.0 install
The default Apple install provides many nice plug-ins but thus far there have been a few critical ones noted as missing which require building on your own machine and installing into your PHP’s extension directory. The process is the same for each of these but will be tackled on a one-by-one basis.
Preparaing your environment to build extensions
Compiling PHP extensions is easy, requiring only the PHP source from php.net. Download the PHP source using your browser, cURL or another available method as Snow Leopard lacks
wget. Extract the code to a temporary directory, such as
~/source_files/php. Although 10.6 is a 64-bit environment these will be four way builds, just in case Apache, PHP or any other environment calls for 32-bit compiles.
Set up your arguments environment with this command:
CFLAGS='-O3 -fno-common -arch i386 -arch x86_64 -arch ppc7400 -arch ppc64'
LDFLAGS='-O3 -arch i386 -arch x86_64 -arch ppc7400 -arch ppc64'
CXXFLAGS='-O3 -fno-common -arch i386 -arch x86_64 -arch ppc7400 -arch ppc64'
Download the latest version of libmcrypt from SourceForge and unpack into
~/source_files/libmcrypt. Execute the build with these commands:
./configure --disable-posix-threads --disable-shared
sudo make install
With libmcrypt properly built and installed in the system all that’s left is building the code provided in the PHP source.
sudo make install
sudo make install
I have not yet attempted an MSSQL extension compilation but I can already assume you’ll need to download FreeTDS before starting. Anybody who gets this done should do us all a favor and post something in the comments.
September 2nd, 2009 § § permalink
Update: 2009-09-24: Still waiting on an Entropy package for Snow Leopard? You have two choices if you need to get work done and can’t be bothered to wait: Downgrade back to Leopard (OS X 10.5) or start compiling PHP extensions until you have enough to get things done. I’ve created a new post on how to get some basic things working and helpful links to other common issues (segmentation faults anybody?)
Just a quick note to any Mac users who update from Leopard (10.5) to Snow Leopard (10.6) and use Marc Liyanage’s PHP package, entropy: Snow Leopard will hose your custom PHP setup. This isn’t really a fault of 10.6 and I’m not complaining about the upgrade. Actually, all things considered the upgrade was fairly seamless and without hiccup. It’s just that Apple let the installer get a little greedy and overwrite some existing configs.
Snow Leopard’s default PHP install uses 5.3.0 and includes what should be default extensions, such as GD, but does not include others like mcrypt. Our IT department is waiting for at least 5.3.2 to migrate so I still have a need to develop and test on 5.2.x, which means I either need to recompile an older version of PHP or use an existing package. Because this is the 21st century and I have better ways to spend my time I choose to go with an existing package. Unfortunately, OS X still does not have a unified package manager so I can’t just “yum php5.2.9” or something like that.
I’m still in the process of getting my environment working so I’ll list a few of the issues I’ve experienced and update this post as I resolve them.
- httpd-vhosts.conf is overwritten and you lose your custom vhosts. Oddly, /etc/hosts is left alone.
- Apache initializes but only serves up white pages. Error logs spit out “[notice] child pid xxxx exit signal Segmentation fault (11)”. No help from the tubes on this one.
- Trying to lipo out the x86_64 architecture from libphp5.so to force 64-bit mode did not help.
- Disabling all extensions listed in /usr/local/php5/php.d/ had no effect.
If you have any suggestions or have successfully installed a 5.2.9 entropy package on an upgraded 10.6, please leave a comment so I can get this mamma jamma working. I’ve created a new post describing my steps to get the 10.6 PHP install of 5.3.0 working with some basic extensions. All all comments should be directed toward that post.