I've recently upgraded to OS X 10.6 Snow Leopard and I was quite happy to know that it came with recent versions of Apache, PHP and Python. The first thing I did was enable PHP in Apache by editing http.conf
and then I uncommented the PHP line by changing
Next, I checked out my company's source code and browsed to the website at http://localhost/~mwilliamson/website and tried to login. Unfortunately, I came across this lovely error:
So I Googled around and saw various people with the same issue where none was able to be fixed. I checked to see if the MySQL database was using old passwords-- it wasn't. I changed the password on the database user. No dice. Then I decided to recompile PHP without mysqlnd and woo! It worked! Naturally, I'm making it sound much quicker than it really was. This took several days.
Here's the commands to recompile PHP and restart Apache.
We can't make and install yet. There's a bug in the PHP sources which messes up iconv. We'll need to change line 186 in ext/iconv/iconv.c:
change:
Save, then run:
Calling `Make` at this point will yield the following error:
We'll need to change the Makefile first. Add "-lresolv" to the EXTRA_LIBS line on line 102 like so:
to
Then we can build and install:
Hope it helps!
If you want to get your manager to try out Erlang, but they are hesitant (probably an understatement) you might be able to get some leverage if you use a relational database rather than mnesia. So, here's a quick sample of how to connect to and query a MySQL database.
First, you'll need to install the MySQL ODBC driver if you haven't already. You can find it at http://dev.mysql.com/downloads/connector/odbc/5.1.html. Then you'll need a database to connect to and a table to query. Here's the SQL script I used to create my test database:
And here's the code to connect and query in erlang:
This is what my interactive session looks like:
It's that simple. Post a comment if you want more samples or description.
Erlang docs: http://www.erlang.org/doc/apps/odbc/index.html