WampServer - A Test Bed For WordPress
WampServer - A Test Bed For WordPress
Recently, I upgraded my WordPress blog to the latest version — with very low stress. One of the main reason for this was the preparation and testing I did on my local PC test bed. This article describes how I installed both a test bed and WordPress on my local PC.
On my local PC, I had previously installed Apache, mySQL, and PHP. My original installation was through open source and individual packages: I installed each of these components individually. However, there is a better and quicker way for those wishing to install their own WordPress test bed — WampServer.
The present components of this integrated, easy to install package are these:
Apache 2.2.11
Apache MySQL 5.1.30
PHP 5.2.8
I decided to give the latest version, WampServer 2, a try-out on my local PC and to test the ease of installing WordPress after WampServer was operational. I’ll give you a clue right now of how I like WampServer after my testing — it’s wonderful.
I am not going to bother with lots of detail about the installation because the installer is just plain bulletproof: except for electing to create Desktop and Quick-Launch icons, I accepted all of the defaults for an easy install.
When the installation was completed, the installer placed a new icon in the system tray. If the icon is not present after system startup, clicking either the quick-start or desktop icon will place it there. Left clicking the icon displays the WampServer menu.
The very first menu item is a toggle for placing the server online or offline. I keep this set to the offline (default) mode because I only want to access WampServer from my local PC.
At this point, a click on the “Localhost” menu item will bring up the very first, and very useful, WampServer HTML page.
My next step was to set a password for the mySQL server. Unless this is done, the server is a security risk. Clicking the phpMyAdmin menu item brought up phpMyAdmin. Initially, there were two information messages at the bottom of the page. One message warned that the password had not been set. The other message about the PHP mySQL library version can be safely ignored.
From the phpMyAdmin screen,I selected the Privileges tab, clicked the “Edit Privileges” icon for “root,” entered a password, and clicked the “Go” button. This assigned the password to the root user. One more step needed to be completed to eliminate a nasty-looking error message.
I opened the phpMyAdmin configuration file at C:/wamp/apps/phpmyadmin3.1.1/config.inc.php (for my installation). I used my favorite text editor to add the root password to the file.
In preparation for WordPress, I activated one additional Apache module. From the quick-start menu, I selected Apache/Apache modules/ and checked the rewrite_module. You may have to “Start All Services” for this to take effect. When the module has been activated, a check mark will be in front of the option. The rewrite_module is needed for “pretty URLs,” otherwise known as permalinks. For my WordPress sites, I configure permalinks for /%postname%/.
WordPress needs a mySQL database to store blog data. I opened phpMyAdmin , entered a database name of “wordpress,” and clicked the “Create” button. That’s it! WordPress will fill in the tables it needs.
Next, I downloaded the latest version of WordPress and unzipped the file into the C:/wamp/www directory. All web pages get placed in this root directory. In fact, the default home page for WampServer is reached through the index.php file that is already there.
Before running the WordPress installer, the wp-config.php file needed to be created and modified in order to tell WordPress how to access the database. See the first reference at the end of this article for how to create and configure the file.
Once the wp-config.php file had been modified, the installation could begin. I browsed to the wordpress directory, hit the “Enter” key, and the installation began.
After the installation, WordPress was up and running.
To help keep my test bed private, I installed a plugin called “Maintenance Mode.” The plugin enables me to display a web page to anyone browsing to the WordPress test site. I configured the page to display the message, “This Site is Permanently Offline.” The page does allow the administrator to log in, manage, and view the blog.
Installing a WampServer test bed on your local PC can save you loads of time by enabling you to test your WordPress installation, including plugins, and your (X)HTML pages — before putting them online. After WordPress is installed on the test bed, and depending on what plugins you install, other Apache modules might have to be activated. By using the WampServer menu, it is easy to do this.
REFERENCES
* How to Install and Style WordPress
– A comprehensive tutorial on installing and styling WordPress.
* Giving WordPress its Own Directory
– If you want to access WordPress from the root directory (instead of the “wordpress” directory), this article shows what to do.
* Download WampServer
For more information about installing, managing, theming, and styling WordPress, including a full XHTML version of this article with images, please visit
http://www.blog.selectdigitals.com
Useful MySQL Commands For PHP Development
Useful MySQL Commands For PHP Development
When I’m developing PHP applications I normally have a DOS window open so I can run SQL scripts from the command line. Often, this is so I can check that MySQL database tables are being updated correctly while I am running PHP scripts.
There are not that many command line tasks I need to perform, but it is useful to be able to run them as and when I need to. In this tutorial I’ll look at a few MySQL commands I find really useful during the development of PHP applications.
Logging onto the MySQL monitor
To log onto the MySQL monitor:
Open a command prompt window, and navigate to the the mysql\bin folder.
Run the command:
mysql
OR
mysql -u user -p
If prompted, enter the password for the database user.
Setting a root password
If you have not got a root password set, here is how you set one.
Log onto the MySQL monitor as described above.
Run the command:
set password for root@localhost=password(’password’);
Updating a table
I quite often need to add or delete new columns, or modify existing ones.
To perform the following commands you need to be logged onto the MySQL monitor, as described above.
Adding a new column
The format is:
ALTER table tablename
ADD new_column type
AFTER column;
And here are a couple of examples:
ALTER table users
ADD surname char(30)
AFTER firstname;
ALTER table users
ADD age int (2) NOT NULL default ‘0′
AFTER surname;
Modifying an existing column
Sometimes it is necessary to update existing columns; here is the format:
ALTER table tablename
MODIFY column type;
And here’s an example:
ALTER table users
MODIFY age int (3) NOT NULL default ‘0′;
Dropping a column
Here’s the format:
ALTER table tablename
DROP column;
And here’s an example:
ALTER table users
DROP age;
Dumping the contents of a database into an SQL file
For backup purposes, if nothing else, it’s sometimes useful to dump all the contents of a database into an SQL file. Here’s how you do it:
Open a command prompt window, and navigate to the the mysql\bin folder.
Run the command:
mysqldump -u database_user_name -p database_name > database_name.sql
When prompted, enter the password for the database user.
Sending the output from an SQL query to a file
Sometimes it is useful to send the output from a query to a file, for example, a text file. Here is an example of how to do it.
Log onto the MySQL monitor.
Run the SQL query, for example:
SELECT name,surname FROM users into outfile ‘/tmp/users.txt’;
About the Author: John Dixon is a web developer working through his own company John Dixon Technology Limited. The company also develops and supplies a free accounting bookkeeping software tool called Earnings Tracker. The company’s web site contains various articles, tutorials, news feeds, and a finance and business blog.
Introduction to MySQL Certifications
If you are interested in becoming a MySQL professional, you should consider getting one or more MySQL Certifications. This means requires passing one or more exams containing about 70 multiple-choice questions. The present cost of each exam is $200 but is sometimes discounted. This exam is available through the Pearson VUE test centers located virtually across the globe.
What do you get for passing these tests? The first answer is professional recognition. While certification is no proof that you can really perform on the job, doing the hard, hard work of certifying can help you prepare for the real world. Let’s be frank. If you only know your stuff on paper, you won’t know what to do on the job. Before long you’ll be pounding the pavement. In a community like certified professionals the word spreads fast.
In this article we look at your choices for MySQL Certifications. Companion articles will discuss each of these certifications in more detail. The CMA (Certified MySQL Associate) is an entry-level certification, designed for people who are relatively new to using the database server. This certification covers basic database management system concepts as well as basic SQL. While this certification is not a prerequisite to the other certifications many people new to MySQL start with CMA certification before going to the more advanced certifications. It’s up to you.
The CMDEV (Certified MySQL Developer) is targeted at candidates who will be developing applications using MySQL as back-end storage. This certification is issued to those who pass both the Certified MySQL Developer-I and Certified MySQL Developer-II exams. You may pass either of these two exams first; they cover different but complementary material.
The CMDBA (Certified MySQL Database Administrator) is targeted at database administrators responsible for tuning, planning, and optimizing data layout for one or several servers and who do not write many applications. This certification is issued to those who pass both the Certified MySQL DBA-I and Certified MySQL DBA-II exams. You may pass either of these two exams first; they cover different but complementary material.
The CMCDBA (Certified MySQL Cluster Database Administrator) requires first obtaining the CMDBA certification and then passing a single exam associated with a very specific aspect of MySQL technology. You can be a professional MySQL database administrator and never deal with the material covered by this exam.
There are a wide variety of tracks to prepare for any and all of these certifications. For example, MySQL offers books and classes at every level. Take my advice, don’t sign up for anything more expensive than a book until you download MySQL and spend some serious time trying it out. One thing is sure; if you want to pass the test you must run MySQL hour after hour, day after day. If you don’t like that do something else.
Levi Reiss has authored or co-authored ten books on computers and the Internet. He teaches Linux and Windows operating systems plus other computer courses at an Ontario French-language community college. His brand-new site http://www.mysql4windows.com shows you how to download (legally and for free) MySQL and work with this software. Visit his new website http://www.linux4windows.com which teaches you how to download and run Damn Small Linux on Windows computers, even if they are “obsolete.”
Introduction to MySQL Certifications
If you are interested in becoming a MySQL professional, you should consider getting one or more MySQL Certifications. This means requires passing one or more exams containing about 70 multiple-choice questions. The present cost of each exam is $200 but is sometimes discounted. This exam is available through the Pearson VUE test centers located virtually across the globe.
What do you get for passing these tests? The first answer is professional recognition. While certification is no proof that you can really perform on the job, doing the hard, hard work of certifying can help you prepare for the real world. Let’s be frank. If you only know your stuff on paper, you won’t know what to do on the job. Before long you’ll be pounding the pavement. In a community like certified professionals the word spreads fast.
In this article we look at your choices for MySQL Certifications. Companion articles will discuss each of these certifications in more detail. The CMA (Certified MySQL Associate) is an entry-level certification, designed for people who are relatively new to using the database server. This certification covers basic database management system concepts as well as basic SQL. While this certification is not a prerequisite to the other certifications many people new to MySQL start with CMA certification before going to the more advanced certifications. It’s up to you.
The CMDEV (Certified MySQL Developer) is targeted at candidates who will be developing applications using MySQL as back-end storage. This certification is issued to those who pass both the Certified MySQL Developer-I and Certified MySQL Developer-II exams. You may pass either of these two exams first; they cover different but complementary material.
The CMDBA (Certified MySQL Database Administrator) is targeted at database administrators responsible for tuning, planning, and optimizing data layout for one or several servers and who do not write many applications. This certification is issued to those who pass both the Certified MySQL DBA-I and Certified MySQL DBA-II exams. You may pass either of these two exams first; they cover different but complementary material.
The CMCDBA (Certified MySQL Cluster Database Administrator) requires first obtaining the CMDBA certification and then passing a single exam associated with a very specific aspect of MySQL technology. You can be a professional MySQL database administrator and never deal with the material covered by this exam.
There are a wide variety of tracks to prepare for any and all of these certifications. For example, MySQL offers books and classes at every level. Take my advice, don’t sign up for anything more expensive than a book until you download MySQL and spend some serious time trying it out. One thing is sure; if you want to pass the test you must run MySQL hour after hour, day after day. If you don’t like that do something else.
Levi Reiss has authored or co-authored ten books on computers and the Internet. He teaches Linux and Windows operating systems plus other computer courses at an Ontario French-language community college. His brand-new site http://www.mysql4windows.com shows you how to download (legally and for free) MySQL and work with this software. Visit his new website http://www.linux4windows.com which teaches you how to download and run Damn Small Linux on Windows computers, even if they are “obsolete.”