If you’ve been here before, note the heavy edits in italics. Read it all before you start doing funky things!.
I needed the GD library for my installation of The Ultimate Family Tree (TUFaT). It’s also needed for OpenX to be able to display graphcs.. For once, I found an excellent step-by-step tutorial on how to do this in the Moodle Documentation. Seriously, this was one of the easiest things I’ve ever done, and I even upgraded my PHP installation in the process. All the files are in the right place!
Just a note, that php.ini-recommended needs to be copied out, edited, renamed as php.ini, and then moved back for the final step.
Important: This blog post is also excellent and easy. It worked out for me when things didn’t work out (see below). Make sure to read the comments for some problems people have had. Here is another site that I didn’t use (because the last one worked).
EDIT: Not so much. For some reason, after doing this none of the applications I have can access the MySQL databases (Error #1045 – Access denied for user ‘root’@’localhost’ (using password: NO) ). Luckily (after giving up on finding an answer today), you can switch back to the default Leopard PHP installation by switching the commenting on those two lines in /etc/apache2/httpd.conf:
To use new PHP installation (above link):
#LoadModule php5_module libexec/apache2/libphp5.so
LoadModule php5_module local/php5/libphp5.so
To use old PHP installation:
LoadModule php5_module libexec/apache2/libphp5.so
#LoadModule php5_module local/php5/libphp5.so
When I find an answer to my problem, I will try to post it. Right now I am attempting to see how much the GD libraries are necessary for TUFaT.
Update: The solution to my problem was with PHP not really knowing where MySQL was, even though MySQL was on and working beautifully from the command line. I’ll copy it here from the comments on ‘phil has a blog’ (thanks mauricio)! Looking at this comment, it was actually posted only 9 hours ago, so that explains why I didn’t find it earlier this week!.
After following all the steps described in the blog I had an issue making PHP & MySQL communicate.
After many trial an errors, lots of headaches, and many days with this machine down I found this post on another site. It solved my problem.
I had the same problem with MySQL getting no valid connection.
Warning: mysqli_connect() [function.mysqli-connect]: (28000/1045): Access denied for user ‘root’@’localhost’ (using password: YES) in
With my default MySQL and PHP installation in Mac OS X 10.5.2 there are no problems with the connection.
In my opinon it’s caused in this parameters from the compilation:
‘–with-mysql=shared,/usr/local/php5’ ‘–with-mysqli=shared,/usr/local/php5/bin/mysql_config’ ‘–with-pdo-mysql=shared,/usr/local/php5’
With those configurations PHP searches for the MySQL lib inside of the PHP5 path.
My solution was:
sudo mv mysql mysql.old
sudo ln -s /usr/local/mysql/lib mysql