Written by Mike Young on December 31, 2008 at 7:04 am

So, you've just managed to get everything working with the latest version of phpMyAdmin and MySQL 5.1.30, but then you get this annoying message at the bottom of your admin screen:
Your PHP MySQL library version 5.0.67 differs from your MySQL server version 5.1.30. This may cause unpredictable behavior.
What do you do?
Well, don't fret. This is more of an annoyance than anything else. We can go down the path of updating various libraries, which could lead to other problems, we can ignore the warning, or we can disable the warning message. In my case, I've opted to disable the warning in phpMyAdmin/main.php (lines 295 through 311).
PHP:
-
/**
-
* Warning about different MySQL library and server version
-
* (a difference on the third digit does not count).
-
* If someday there is a constant that we can check about mysqlnd, we can use it instead
-
* of strpos().
-
* If no default server is set, PMA_DBI_get_client_info() is not defined yet.
-
*/
-
//comment added to ignore the library mismatch
-
/*
-
if (function_exists('PMA_DBI_get_client_info')) {
-
$_client_info = PMA_DBI_get_client_info();
-
if ($server> 0 && strpos($_client_info, 'mysqlnd') === false && substr(PMA_MYSQL_CLIENT_API, 0, 3) != substr(PMA_MYSQL_INT_VERSION, 0, 3)) {
-
trigger_error(PMA_sanitize(sprintf($strMysqlLibDiffersServerVersion,
-
$_client_info,
-
substr(PMA_MYSQL_STR_VERSION, 0, strpos(PMA_MYSQL_STR_VERSION . '-', '-')))),
-
E_USER_NOTICE);
-
}
-
unset($_client_info);
-
}
-
*/ //ending comment to ignore the mismatch
This simple little change will get rid of the annoyance and things will continue to work fine. You'll have a nice clean interface without the worry of having mucked up something on your system. Of course you could simply do things via the CLI and avoid phpMyAdmin. That's another option.
Category: Techy Stuff
Written by Mike Young on December 30, 2008 at 7:03 pm
Now, we can certainly all tough things out and do things at the command-line. And who doesn't just love to use vi? But believe it or not there are people out there who prefer to use more of a point and click method for doing things. And one of the most unanswered things out there is how to actually get up and running with phpMyAdmin for configuring your MySQL databases.
To begin with, I don't think it really matters what version of phpMyAdmin you might be trying to use. I am currently using 2.11.7, but will switch to the latest version, 3.1.1, for the purposes of this article. When you first decompress the archive into your /Library/WebServer/Documents/ folder, it will have a long name that includes the version. You'll normally want to shorten this to the following /Library/WebServer/Documents/phpMyAdmin/. Again, I'm going to leave mine long for illustration sake.
When you unpack the folder into your document root, you'll be greeted by a not so warm message.

The reason for this message #1045 is quite simple, nothing is really configured yet. For example, let's take a look at the configuration file for phpMyAdmin, config.inc.php. You'll have to 'cp config.sample.inc.php config.inc.php' to make things work right.
PHP:
-
$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
-
-
/*
-
* Servers configuration
-
*/
-
$i = 0;
-
-
/*
-
* First server
-
*/
-
$i++;
-
/* Authentication type */
-
$cfg['Servers'][$i]['auth_type'] = 'cookie';
-
/* Server parameters */
-
$cfg['Servers'][$i]['host'] = 'localhost';
-
$cfg['Servers'][$i]['connect_type'] = 'tcp';
-
$cfg['Servers'][$i]['compress'] = false;
-
/* Select mysqli if your server has it */
-
$cfg['Servers'][$i]['extension'] = 'mysql';
-
-
/* rajk - for blobstreaming */
-
$cfg['Servers'][$i]['bs_garbage_threshold'] = 50;
-
$cfg['Servers'][$i]['bs_repository_threshold'] = '32M';
-
$cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600;
-
$cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M';
-
-
/* User for advanced features */
-
// $cfg['Servers'][$i]['controluser'] = 'pma';
-
// $cfg['Servers'][$i]['controlpass'] = 'pmapass';
-
/* Advanced phpMyAdmin features */
-
// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
-
// $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
-
// $cfg['Servers'][$i]['relation'] = 'pma_relation';
-
// $cfg['Servers'][$i]['table_info'] = 'pma_table_info';
-
// $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
-
// $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
-
// $cfg['Servers'][$i]['column_info'] = 'pma_column_info';
-
// $cfg['Servers'][$i]['history'] = 'pma_history';
-
// $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
-
/* Contrib / Swekey authentication */
-
// $cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey-pma.conf';
In the configuration file, you'll see a couple of things. First of all, there is an entry for a blowfish-secret. This setting corresponds to the following line:
PHP:
-
$cfg['Servers'][$i]['auth_type'] = 'cookie';
By setting the permissions for cookie based operation, we'll be prompted with a username and password each time we log in. You'll need to populate the blowfish-security value with some value for things to work, e.g., 0123456789. If you prefer to avoid doing this and simply want to go directly into the admin panel, you can make the following changes:
PHP:
-
$cfg['Servers'][$i]['auth_type'] = 'cookie'; //change this to
-
$cfg['Servers'][$i]['auth_type'] = 'config';
-
$cfg['Servers'][$i]['user'] = 'root'; // add this line for root user
-
$cfg['Servers'][$i]['password'] = 'root password for mysql'; // add this password line for root user
Once you've done this, you're going to need to add the proper passwords for MySQL's root user. I've discussed this in my last article, but for simplicity, here it is again (you'll have to enter the interactive mysql shell by typing 'mysql -u root'):
MySQL:
-
SET password for root@localhost = password('yourpassword');
-
SET password for root@127.0.0.1 = password('yourpassword');
-
SET password for 'root'@'hostname.local' = password('yourpassword');
-
quit
Try to make sure your root password for MySQL actually matches your root password in your config.inc.php, otherwise things won't work-- duh! That's pretty much it. Go ahead and test things out, but it should work fine now.
Category: Techy Stuff
Written by Mike Young on December 30, 2008 at 1:33 pm
If you happen to do a lot of Wordpress development and your tool of choice is a Mac, then setting up a local test environment can be a bit challenging, but necessary. Nothing can be more time-consuming and frustrating than having to upload changes, test online, back out changes, etc. The best part is when you're developing new access-control-lists for your blog and everything looks good to you. This happened to me a few days ago and when I viewed my site via another browser, I realized there were no pics. They were blocked. Yea!
Anyway, local development and testing is a great thing. But sometimes it's more hassle than it seems worth it. After all, I'm sure there are many out there who are perfectly comfortable editing files in TextEdit
So, this should get you up and running with the latest elements in a matter of minutes:
- Download the latest version of wordpress. In my case, I'm using version 2.7.
- Regardless of whether the file is in zip or tarball, you'll need to extract the contents to where your Mac is configured for serving its web direcories. By default, this is in /Library/WebServer/Documents. The file will decompress as wordpress, so the full path will be /Library/WebServer/wordpress. You can always change the name of your wordpress directory to the name of the site.
- You'll need to copy the wp-config-sample.php file to wp-config.php.
- Of course you'll need to modify the resulting wp-config.php file to point to the proper database. There are essentially three changes to be made. For example:
PHP:
-
<?php
-
// ** MySQL settings ** //
-
define('DB_NAME',
'db_name');
// The name of the database
-
define('DB_USER',
'db_username');
// Your MySQL username
-
define('DB_PASSWORD',
'db_password');
// ...and password
-
define('DB_HOST',
'localhost');
- You can use whatever editor you'd like.
- Download the latest version MySQL. I'm using the 5.1.3 package format for x86_64 (Intel Macs). Once you decompress the package, simply run the package installer. It will do the bulk of the work.
- Download the fixed version of the MySQL control pane. You'll need to unzip it. Then simply double click to actually install it in your Preferences. After it's installed, you'll need to startup MySQL.
- Modify your /etc/apache2/httpd.conf file to remove the comment in front of LoadModule php5_module. You can do this easily by simply opening a Terminal and then typing 'sudo vi /etc/apache2/httpd.conf'. To quickly get to the line you're looking to change, just type ':' to go into command mode. You'll have a cursor right after the colon. Then type the following '%s/#LoadModule php5_module/LoadModule php5_module/g'. This will look get rid of the comment. Simply hit :wq to save the file. This enables the php5 support in Apache.
- In your Preferences=>Sharing=>Web Sharing, click on the check box to enable the Web Server.
- You're going to need to set your root password for MySQL. There are three interfaces we're going to do this for and then we're going to create our first database. To do this, you'll have to go into mysql's interface by typing 'mysql -u root':
MySQL:
-
SET password for root@localhost = password('yourpassword');
-
SET password for root@127.0.0.1 = password('yourpassword');
-
SET password for 'root'@'hostname.local' = password('yourpassword');
-
CREATE DATABASE dbname;
-
GRANT all PRIVILEGES on dbname.* to db_username@localhost identified BY 'you';
-
SET password for db_username@localhost = old_password('db_password');
-
quit
- If you haven't figured it out, I've made the MySQL entries correspond to the entries in your wordpress configuration file.
- That's pretty much it. You should simply have to point your browser to http://localhost/sitename/ to see things actually running. Wordpress will take care of setting up the various tables for itself.
Enjoy!
Category: Techy Stuff
Written by Mike Young on December 30, 2008 at 9:21 am
Okay, if I seem a bit cranky today, it's only because I didn't sleep well last night. It's one of the side effects of feeling as if you might be blown off the face of this planet. Seriously!
Every now and then, we get these wind storms where we live. Think of them as tornadoes without the swirliness. Well, they must have been gusting up over 100mph. When I got up this morning, our huge trash dumpster was on its way down our driveway. That sucker is pretty heavy. They typically have to be towed around with a truck to get into their intended location. Nope. Not this time. Trying to push it back up and into place was a bit challenging when the gusts would hit-- 5 steps forward, pick your butt back off the ground-- that kind of thing.
Anyway, the winds have been blowing pretty hard the last few days, but this is an exception. These are the kinds of winds that make me wonder if we're going to wake up to a gaping hole in the roof. I tell ya that if I'm going to have to endure this, I want the ruby red slippers too. You can keep the dog. I've got that covered.
wind, dorothy, wizard of oz
Category: Misc. Rants
Written by Mike Young on December 27, 2008 at 9:10 am

I've just added some more fun to my site via Grouptivity. Basically, Grouptivity allows you to bookmark articles on the web that you find interesting. You can opt to email the articles directly from the site or bookmark them on your Facebook and other social networking sites. And, it's yet another way of making some advertising revenue.
Now, while it clearly has some cool potential, I think a lot of its potential will depend on other bloggers adding support to their sites. So, I'm going to spend a little time describing how to do this.
- You'll need to download the Share+ plugin and add it to your plugins directory on your server (~/public_html/wp-content/plugins).
- You'll need to enable the widget in the appearance section of your dashboard. Typically, this is also where you would select your theme as well.
- You'll need a publisher's ID and you can get one here. Please bare in mind that you have two accounts to sign up for: the publisher one and the reader one.
- If you're like many Wordpress bloggers, you're probably using some 3rd party theme. And that will likely mean that you're not widget enabled. Unfortunately, this has to be fixed if you're going to have the support on your site. I'm going to explain how to fix this with a couple of lines of PHP code to your sidebar.php file. Open up your sidebar.php and decide where you want to place it. For many, this can be near the top where your first div tag is located. You're essentially going to add a loop here that says if you have widgets, place them in this location, otherwise... just add these other items. The good news is that by placing this in your sidebar, you can control search, posts, pages, categories, archives, etc. in your sidebar by simply going to your widgets page. You don't have to modify code any more. Anyway, these are the lines you need:
PHP:
-
<?php /* Widgetized sidebar, if you have the plugin installed. */
-
-
<?php get_links_list(); ?>
-
<?php endif; ?>
-
- You'll also have to add a new file called functions.php. This file will be located in the root directory of your theme (~/public_html/wp-content/themes/your_theme/). In this file, you'll have to add the following lines of code:
PHP:
-
<?php
-
-
register_sidebar();
-
?>
That's pretty much it. You'll want to fine tune things via your CSS settings. But that typically requires a bit of finessing. If you run into problems, just go to my contact page and send me an email.
I am still working out a few quirks related to special characters. For example, the apostrophe in Ain't isn't displaying properly. It's being converted into its html code.
Category: Techy Stuff