Skip to content

Posts tagged ‘WordPress’

20
Aug

OS X Lion, MySQL and WordPress

Today I wanted to create a local copy of a remote WordPress blog / site and stumbled over some nasty business with PHP and MySQL. I am not sure how is at fault (probably Apple) but I am not 100% sure.

After exporting the site, installing MySQL and creating the wordpress user and DB schema I was ready to install WordPress. So I extracted wordpress, copied into /Library/Web/Data/Site/Default and opened http://localhost/wordpress on my Safari browser. After telling wordpress to create the configuration file I entered the necessary data (schema name, user name, password etc) and hit submit. But I got an error page that it could not connect to the DB. After triple checking the settings I started to google around. After some time I eventually hit this site: http://bustoutsolutions.com/blog/2011/07/29/wordpress-error-establishing-a-database-connection-after-upgrading-to-os-x-lion which told me to look into the /etc/php.ini file and make sure that the mysql.default_socket setting was correct. It was set to /var/mysql/mysql.sock but it turned out that wasn’t the case. So I checked again and found (as said in the blog entry) it under /tmp/mysql.sock. Changing that and creating the wp-config.php file by hand I was able to pass by the setup.

After installing the wordpress-importer plugin I was told it could not create the uploads directory under wp-content and after creating it and set the permission to 777 I was able to import the site.

Not sure what happened because I could install the blog you are reading now without any issues and without changing the php.ini file. Really strange.

– Andy

7
Aug

Order the WordPress Entries by Modified Date

Lately I write a continuing blog post about my endeavor to migrate my Snow Leopard Server to Lion. Because I am going to update it multiple times until I am done I want the post to appear on the top of the list after I updated it. It took some time to accomplish it but that is how you can do it:

  1. Open the index.php page of your theme in the Editor of your choice
  2. Look for the line with the function query_posts
  3. Add this text to the query orderly=modified and you might need to add an Ampersand if there are more arguments
  4. This was my original text: <?php query_posts($query_string.’order=DESC’);
  5. Now it looks like this: <?php query_posts($query_string.’orderby=modified&order=DESC’);
  6. Save the file
  7. Reload the page multiple time to make the cache to catch up (my main page remained all white in the first few requests)

Now you should have the post ordered by the modified date and whenever you do update a post it will be listed at the top. Just keep in mind any update no matter how small will do that.

– Andy

28
Dec

Welcome to our new Madplanet.com Blog

Once more we have a new blog. Before this we were using XWiki which was nice and had a lot of potential but the presentation was awkward and the support for remote Blog writing was limited to an unknown protocol which was not supported by any Blog Writing Client like Ecto3 or MarsEdit.

Eventually I learned that WordPress can be install and hosted outside of WordPress.com and so I gave it a shot and I had it up and running in a few hours. After I found a good design, checked that it supports images and source code WordPress was good to go to become our new blog software.

Cheers – Andy