Local WordPress install for dev purposes

So back to my blog theme, I took some time to work out a new personalized theme.

Starting point is the default theme which I suppose supports all WordPress features.

For making things a bit smoother, I installed wordpress locally , so that it would be easier to experiment with the theme files.

Some words on this…

On my fileserver, I still have a MySQL database, so I didn’t have to install a new db on my local machine. I would be ok to have MySQL on the local machine but don’t like too many local server applications like databases, because I suppose this would slow down my desktop especially when starting up.

The fileserver with MySQL has an Apache with phpMyAdmin running on it. Through this interface I could create a new WordPress database, and create a user with access grants on that db.

My mistake was in creating the user with the necessary access rights. This is not something I do very often; so I copied this from a web page:

GRANT ALL ON <wordpressdb>.* TO '<wordpressUser>'@'localhost' IDENTIFIED BY '<password>';

Make sure the single quotes are realy single quotes and not other kind of quotes like `

Also like in my case when the db is on a remote machine, and you need to access the db from another host, set the grant like this:

GRANT ALL ON <wordpressdb>.* TO '<wordpressUser>'@'%' IDENTIFIED BY '<password>';

I checked the user with my local SQL client SQuirrelSQL, so created a db alias with URL: jdbc:mysql://<dbserver>/<wordpressdb>

Then I enabled php on my local machine, connecting with the mysql db.

  • In /etc/apache2/httd.conf, make sure “LoadModule php5_module        libexec/apache2/libphp5.so” is uncommented.
  • Copied /private/etc/php.ini.default to /private/etc/php.ini. This is quite optional I suppose; just increase the error log level:  error_reporting = E_ALL

Installing WordPress is all well explained in this guide; and goes smooth via an web base install script. Well almost, just needed to set the right permissions on the wordpress source files.

I copied all wordpress files to a location of my choice: /Users/<MyLogin!>/workspace/wordpress.

Configured apache so that it could locate the files via a new conf file under /private/etc/apache2/other: wordpress.conf, containing:

Alias /Wordpress /Users/<MyLogin!>/workspace/wordpress

<Directory “/Users/<MyLogin!>/workspace/wordpress/”>
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

The after extracting and copying wordpress sources, I needed set the right file permissions, that is all directories drwxr-xr-x via a “chmod -R og+rx */” in de wordpress directory (and for the wordpress directory itself) and all files “-rwxr–r–

Also copy the wp-config-sample.php to wp-config.php and set the database connection values in this file.

And concluding all of this via “http://localhost/Wordpress/wp-admin/install.php”, now returning:

Wordpress installed...

WordPress installed…

Tags: ,

Comments are closed.