Just another blog.

Posts filtered by tag: PowerPC

Updating PHP (and Apache) on PowerPC Macs

Maybe you know the problem, you want to test your new website locally before uploading it to somewhere where it's publicly accessible.

On PowerPC Macs the latest PHP you can get on Leopard is 5.2.x and on Tiger it's even 4.x...
You want the latest and (probably) greatest? Here you go:

Installing Apache and PHP from MacPorts should be done in less than half an hour on an Intel Mac as most of the packages are precompiled already.
On a PowerPC Mac though there are no precompiled packages, and your Mac has to compile them all locally which will take quite some time.
If you want to build 64-bit binaries on a G5, this will lead to errors. Be aware that not all of them are easy to fix.
If you can't get them fixed it's a good idea to ask for help in MacPorts' IRC channel. The guys there are very friendly and they've helped me quite a few times so far.

First you need MacPorts:

  1. If you haven't already, install Xcode (you can find it on your OSX Install Disc)
  2. If you haven't already, install MacPorts

After you have MacPorts installed, open a new Terminal window and run the following commands:

First, let's update the MacPorts port tree so we have access to the latest packages.

sudo port selfupdate

Install PHP (this command installs the latest version of PHP 5.6)

sudo port install php56

...get yourself a cup of coffee...

Set up a basic php.ini
(if you want to use this installation for production, replace "development" with "production")

sudo cp /opt/local/etc/php56/php.ini-development /opt/local/etc/php56/php.ini

Check what version you have installed. If this fails your installation is broken. (optional)

php56 --version

Now let's install Apache

sudo port install apache2

...get yourself another cup of coffee...
Do not run sudo port load apache2 after it finished!

sudo port install php56-apache2handler

...maybe you want one more cup of coffee?
After the installation, enter the following commands like the script tell you to:

cd /opt/local/apache2/modules  
sudo /opt/local/apache2/bin/apxs -a -e -n php5

OK. A base-installation of Apache and PHP is now installed, but how do you run them?
Wouldn't it be nice if you could start and stop them by clicking the checkbox inside your System Preferences?
Of course it would, so let's do that!
The procedure is dependant on which operating system you're using.

On Leopard (or higher)

Make sure Web Sharing is turned off in System Preferences!

For n3rds (or interested people):

If you toggle the checkbox, this enables or disables a LaunchDaemon which takes care of keeping Apache running.
How does it do that you wonder? It runs /usr/sbin/httpd -D FOREGROUND and keeps it running until the LaunchDaemon is killed (when you shut down e.g.)

So let's edit that LaunchDaemon (to take care of our Apache installation):

nano /System/Library/LaunchDaemons/org.apache.httpd.plist

Replace the first entry of the ProgramArguments array (which should be: usr/sbin/httpd) with /opt/local/apache2/bin/apachectl

It should then look like this:


Press Ctrl+O to save and Ctrl+X to leave nano.
You can now turn on Web Sharing again (and it should work).

On Tiger (or lower)

Make sure you have Personal Web Sharing turned off in System Preferences!

For n3rds (or interested people):

If you toggle the checkbox, it only sets the -WEBSERVER- entry in /etc/hostconfig and launches the "/System/Library/StartupItems/Apache/Apache" script with start or stop parameters.
You can also run it yourself if you want:
sudo sh /System/Library/StartupItems/Apache/Apache [start|stop]

First let's adjust the path to apachectl:

sudo mv /usr/sbin/apachectl /usr/sbin/apachectl-13  
sudo ln -s /opt/local/apache2/bin/apachectl /usr/sbin/apachectl

And then adjust httpd.conf

sudo nano /opt/local/apache2/conf/httpd.conf

Append the following line (I've put it after ServerRoot)

PidFile "/private/var/run/"

Press Ctrl+O to save and Ctrl+X to leave nano.
You can now turn on Personal Web Sharing again in System Preferences (and it should work).


You can now enable Web Sharing test your new installation.
If PHP is not working, please check that

For every change you do to the httpd.conf or any other Apache conf, you have to restart Apache to apply them. You can do this by simply unchecking and then checking again the checkbox in System Preferences.

written by: Takashi Yoshi
Tags: PowerPC, HowTo

The history of x86 and why I'd like to stick with my G5.

I often get looked askanced and involved in always the same discussion when I start talking about my G5 or laugh at people that are using x86 ;)
And usually I always have to explain the same things over and over and over again which gets kinda annoying by time.
So I decided to write this blog post and provide a little FAQ on PowerPC.

Q1: PowerPC is dead!
A: Nope, it isn't at all. IBM just released the PowerPC A2 and is already working on the Power8.
Freescale's in the process of releasing their e6500 core.

Just because Apple switched to Intel it doesn't mean that the whole architecture is dead.
The only thing that happened because of this switch is that PowerPC lost almost the complete desktop/workstation market, except for the Amiga's of course.
IBM stopped the production of their PowerStations shortly after, too.

Q2: PowerPC is slow.
A: The feel of speed usually is very subjective, but if PowerPC (which is only an architecture) was slow by design, I don't think that the PPCA2 powered 4 of the 10 fastest super computers in the world (2 of them placed in top 3).
All three major gaming consoles (namely Sony's PlayStation 3, Microsoft's Xbox 360 and Nintendo's Wii U) are based on PowerPC processors, too.

Q3: If speed wasn't the reason, why did Apple switch to Intel then?
A: Nobody knows. The only thing I can do is to guess.
Probably they did it because of the price and lazyness.
If Apple chose Intel they could just use the same processors as the whole industry does and they don't have to to do hardly any developpment anymore.
Steve said in 2005 that they've been building all major OSX versions for Intel so I assume that Steve wanted to migrate Apple to Intel from the day he went back to Apple.
He, maybe, hasn't seen any advantage for the consumer by buying a better processor.

Nope, it's not been because of speed or notebooks.
If Apple wanted they could have used a dual-core PowerPC processor from Freescale for their PowerBooks.
Fitting the G5 into a notebook was an impossible project I think and they must've known it.
They don't use Xeon processors for MacBooks, either.

Q4: Why is PowerPC so much better than x86?
A: Because it's a much more modern architecture which has been build from the earlier beginnings for 64-bit.
The development of PowerPC has begun in the late 80s while x86 is based on designs from the early 70s.
IBM's goal with POWER's always been to achieve the best possible performance while Intel's goal was to sell as much as possible.

Just a bit of Intel history:
So there's been the Intel 8086, a 16-bit processor with 16-bit data bus and everything else needed.
But no one wanted it because it was not possible to connect legacy 8-bit peripherals to it.
So Intel built the 8088, the little brother of the 8086. It's a 16-bit processor, too, but it only features an 8-bit data bus etc. - 8-bit? GREAT! And it sold like crazy.
Even IBM built the IBM PC on top of the 8088 (whose design was partly based on the 8080's; 8080, you remember? The chip inside of the Altair in the 70s).
And there we are. Microsoft had their BASIC running on the Altair and they were now working together with IBM to get their products onto the IBM PC.
You can now imagine how the history advanced.
Microsoft continued building for IBM, on the x86 series in the future, met Apple who wanted an office suite for their 32-bit Macintosh, they wanted a graphical office suite, too, so they built Windows to place it on top of DOS, suspended competition, got market leader and now everyone uses x86 because, well, Windows runs on it.

Sorry if I have to disappoint you but x86 is not 99% market leader because it's so great, rather because it's so bad and cheap.
I hope I have not destroyed too many worlds ;-)

Just one more fact:
For accomplishing the 16-bit to 32-bit and 32-bit to 64-bit transition, Intel just extended the width of the registers and gave them a new name so that longer memory addresses fit into them.

Q5: If you don't like Intel, just take an AMD.
A: Well, basically AMD is the same stuff as Intel. AMD just licensed the designs from Intel so that if Intel went bankrupt or had production problems AMD survived.

Q6: But don't we have a monopoly then?
A: In my opinion we have, yes, or we at least have a duopoly. Both of them are not good for the market.

Q7: PowerPC's consume much too much power.
A: I think 65W for a 17-core 2.3GHz processor is quite good.

To conclude:
There are basically 3 reasons for me to stay with my PowerPC as long as possible:

  1. To be different.
  2. Not to support the survival of the cheapest.
  3. It does what I want it for, I don?t see any reason to buy a new computer as long as this one has enough performance.

written by: Takashi Yoshi
Tags: PowerPC, FAQ
Tutorials, reviews, experiments, and, of course, my opinion on things…
Subscribe our feed:
RSS2.0, RSS1.0, Atom
blog powered by EF Blog