Mac as a web server revisited

Submitted by Richard Sheppard on Tue, 01/08/2006 - 07:35

To recap on the issue I had in my presentation re: "How to turn your Mac into a database-driven web server"

at the June meeting, I had got to the stage of installing mySQL and configuring it via the terminal, but I could get no PHP scripts to access the database do to a conflict with "old" password hashing and the "new-style" 4.1.x passwords that mySQL uses.

Even when specifying that you want to set a user's password in the old style, using OLD_PASSWORD('password'), it still wouldn't work properly with PHP scripts.

I haven't had much time to look at it until the past couple of days, and what I can see on my development system (G5) and my production Linux box (running Red Hat AS 4 on an AMD3200 - I think) is that they are both configured with "old_passwords=1". I can see on the Linux box that the file "/etc/my.cnf" has this configured in the mysqld block.

On the otherhand, on the Mac, it would be appear to be using this file for configuring the startup parameters first:


and in that file it says it will then load any information from /etc/my.cnf. This file isn't present on new installations of the Mac OS version of mySQL.

I hope you're still following...

On my normal development machine, I'm running mySQL 4.1.16-standard. I can't remember if I've upgraded from older versions, but I suspect I have. I've never had to sort any issue out with the OLD_PASSWORDS option. No "/etc/my.cnf" present.

On the new development drive I set up for the presentation, it's got mySQL 4.1.20-standard. It doesn't have an "/etc/my.cnf" file either. However, once I created one, with only these two lines:


It worked properly.

Because I want to complete this documentation properly and provide the best and easiest information to help people get to the next level, I'd like to have some advice and opinions on the following:

  1. Do we settle for the old_password option? The new password scheme is supposed to be more secure, but was the old scheme THAT insecure?
  2. Does anyone know if Apple will be updating PHP with the mysqli extension, which is required for the new password hashing? If not, shall I add "Compiling a version of PHP with mysqli" in the documentation?
  3. Did I leave the iron on?

Anonymous (not verified)

Thu, 24/08/2006 - 23:18

I am new to both PHP and MySQL and I am having a difficult time figuring out how to get them to interact. I have MySQL 5.0.24 and PHP 4.3.11. What do I do? I want to use mysqli.

Richard Sheppard

Wed, 30/08/2006 - 15:13


The only way I've been able to get PHP to connect to mySQL using the mysqli extension was to building my own version of PHP. I was trying that out last year on a laptop from a previous employer, but sadly had to give it back at the end of last year, so I've not revisited it.

I have, however, recently seen this package which looks promising:

I think it might have later versions than all the stuff you get in a standard install.



Anonymous (not verified)

Wed, 30/08/2006 - 20:13

In reply to by Richard Sheppard

Thank you very much! I have not tried it, since I ended up using old_passwords and mysql instead of the mysqli extension, but from all appearances MAMP is a godsend for anyone wrestling with the particular (and somewhat frustrating) problem of configuring Mac OS X, Apache, MySQL, and PHP. Thanks again, George

Add new comment

This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.