Herself's Webtools

Scripts, HowTos, Templates, Plugins, Widgets, Tips and Useful Information

How to set up Wordpress on Leopard

with 4 comments

Gad, it is just as miserable and painful as it was under Panther.

1) Install MySQL 4.1 or 5.x

2) Turn on PHP in Apache

3) Fix broken socket

4) Download and install WordPress

Step 1 MySQL:

- Download MySQL 4.1
Unpack it and install and tell it to start on startup.

- Turn on SU account. Open up a Terminal Window and type:
sudo passwd root
Give it a good password. You’ll need su to edit files in a bit

- Configure MySQL
cd /usr/local/mysql/bin
./mysqladmin -u root password
[Give it a good password, if it refuses to connect reboot your computer. Also check in your System Preferences MySQL that MySQL is running and told to turn on at boot. ]

- Once you have the root user set up on MySQL set up an account for yourself
./mysql -u root -pYOURPASSWORD

- You should now see a sql> prompt
GRANT ALL PRIVILEGES ON *.* TO username@localhost IDENTIFIED BY ‘userPassword’ WITH GRANT OPTION;
exit;

- Make sure it worked
mysql -u username -puserPassword
Did you get a sql> prompt? If so you’re cool, if not reboot, I’m finding that helps and if not try again. You need to get MySQL running to use Wordpress.

- Life is much easier if you set up a link in your path to mysql

as su

cd /usr/bin

ln -s /usr/local/mysql/bin mysql

Now you should be able to access mysql from any where on the computer.


Step 2: Turn on PHP in Apache

- Turn on WebSharing in System Preferences Sharing

cd /etc/apache2

- Edit httpd.conf , you need to uncomment the line
LoadModule php5_module libexec/apache2/libphp5.so
Thanks and more info here if you are stuck

Step 3 Fix broken socket
- cd/etc/
- copy php.ini.default to php.ini
- edit php.ini
Change the line
mysql.default.socket =
to
mysql.default.socket = /tmp/mysql.sock
Thanks and more help here if you need it for this step

Step 4 Wordpress:

- Download and unpack your favorite version to /Library/WebServer/Documents

- Edit config.php to use the password, and user name and database you created in step 1. If you didn’t create a database do so now.

- type 127.0.0.1/wordpress/ in your browser window and you should see the familiar WP set up screen.
If you do not see the set up screen try this: create this test.php file and it should tell you what is your problem:
if ( $cn = mysql_connect ( “localhost”, “username”, “password” )){
echo “connected”;
}else{
echo “not connected – ” .mysql_error();
}

Use the username and password you set up in mysql.

NOTES:

If you decide to wipe and re-install everything on your computer, you must get PHP/Apache/MySQL up and running BEFORE you do the 10.5.1 update.

If after installing MySQL you are unable to create a database ( errno 13 ) then log on to a terminal as root and change the owner / group of everything in the mysql directories to mysql/mysql.

> chgrp -R mysql *

> chown -R mysql *

You must also create a var and run directory in your /usr/local/mysql directory and make sure they are owned and in the group mysql.

Written by timestocome

October 26th, 2007 at 5:18 pm

Posted in how to, osx, wordpress

4 Responses to 'How to set up Wordpress on Leopard'

Subscribe to comments with RSS or TrackBack to 'How to set up Wordpress on Leopard'.

  1. [...] to herself for solving this one, I got it working with some tweaks such as an equals instead of a dash). cd [...]

  2. You just ended several hours of frustration for me. Thank you so much.

    bryanjswift

    23 Dec 07 at 8:50 pm

  3. You’re very welcome!

    admin

    24 Dec 07 at 8:26 am

  4. This was emailed to me – it is likely useful to those of you following these instructions for installing WP on OSX

    Linda,

    I’ve been going through the OSX wordpress installation (preconfiguration) for 10.5.5 with php 5.2.6 and MySQL 5.0.67 and
    have a couple of revisions for the installation process. Don’t know if these are of any use, but here goes…

    A few updates for the installation process.
    ——————————————————–

    Database installation instructions seem to work as is with the DMG file for 5.0.67
    I did install the preference pane though and start the application that way. Dropped the pref-pane file mysql.prefpane
    into {user}/Library/PreferencePanes

    Configuring php5 (specifically 5.2.6 on OSX 10.5.5)
    ————————
    1. /etc/httpd is now empty — content has been moved to /etc/apache2.
    2. edit /etc/apache2/httpd.conf, uncomment the line with php5
    — (the other lines are now living in another file called php5.conf in another directory and don’t need to be uncommented)
    3. killall -9 httpd (i had to use the killall -9 to get it to die also)
    4. httpd -k start (i had to use the -k to get it to work)

    Set up Word Press
    ————————–
    The default database name is not already called wordpress it’s called ‘putyourdbnamehere’. So we just have to change to
    wordpress.

    Also I *did* have to change from localhost to ‘127.0.0.1′ in the hostname.

    Cheers,

    ljmacphee

    28 Sep 08 at 9:05 pm

Leave a Reply

You must be logged in to post a comment.