Sub-Domains on Windows localhost

General 2 Comments

I find it useful when working on a web project to set up a sub-domain on my development PC's "localhost" Apache installation. This allows me to test the project by accessing pages via that sub-domain, treating the directory being used as the root of that sub-domain as if it were the web document root directory (i.e.: $_SERVER['DOCUMENT_ROOT'] in your PHP scripts will point to that directory when the page is launched via that sub-domain).

Setting up a localhost sub-domain in an Windows/Apache environment is fairly easy. You just need to set up a few lines of text in three files, then restart Apache. First, make sure that your Apache httpd.conf file has the following in it, adjusting the path to the "httpd-vhosts.conf" file as appropriate for your installation:

Read the rest...

Google Chrome Beta

General 2 Comments

Note: See the comments section regarding the change in the EULA.

As I posted at PHPBuilder.com, Ghrome, Google's entry into the browser wars, now has a beta version available for public download (Windows XP/Vista only, for now).

My initial impression is that it works just fine and seems pretty "peppy". For me it has one bug so far: I cannot scroll up via the touchpad on my notebook PC, though it scrolls down just fine. (I've submitted a bug report on it, and it appears others have had the same problem.)

Read the rest...

Turning Off Wordpress “Smart Quotes”

General No Comments

I just realized today that Wordpress was converting my "straight" quotes into directional or so-called "smart" quotes. While this may be nice for nontechnical blogs, it's a pain in a programming-related blog. It can make a block of sample code useless when you copy and paste it until you go through it and convert those directional quotes back into the straight quotes normally used in most programming languages.

Fortunately, a little Googling quickly found this forum entry with a suggested fix. I used Otto42's suggestion:

Read the rest...

Wordpress Upgrade

General No Comments

I just completed the upgrade to Wordpress version 2.5.1. (Wordpress is the application which runs this blog.) It was a relatively painless process, and as it includes an important security fix, I recommend anyone else out there using Wordpress perform the upgrade as soon as possible.

Get the latest version here.

So far everything appears to be working fine, and hopefully it will have no effect on my readers (if there are any).

PHP4 Is Dead; Long Live PHP5…

General 2 Comments

...at least until PHP6 is released.

As stated in the php.net release notes, "Support for PHP 4 has been discontinued since 2007-12-31. Please consider upgrading to PHP 5.2. The release below is the last PHP 4 release." The news archive also notes, "This release wraps up all the outstanding patches for the PHP 4.4 series, and is therefore the last normal PHP 4.4 release. If necessary, releases to address security issues could be made until 2008-08-08," (my emphasis).

While I've often tried to create general-purpose functions and applications that could port to either PHP4 or PHP5, I've decided to forego any further support of PHP4 with any code I create (unless, of course, someone is paying me to create something for PHP4 for some reason). I would therefore like to encourage my fellow PHP hackers (in the good sense) to join me in encouraging all developers to move on to PHP5, and explain to all clients and hosting services that they should migrate to PHP5 ASAP, if for no other reason than to ensure that they can continue to operate with the most secure version of PHP by keeping up with the latest stable releases.

But this upgrade is also to our benefit, opening up access to the much more thorough class and object support of PHP5, enhanced database interfaces such as MySQLi, and new functions like filter_var(), just to name a few of the benefits. Additionally, we should strive to rid our applications of deprecated features and functions, in particular those that will not be supported at all in PHP6. (We don't want to have to upgrade our scripts again, right?) According to Nathan A. Good in "The Future of PHP", the following features will be completely removed from PHP6:

If your scripts depend upon any of those settings, it's time to wean yourself of them now. Don't wait until someone upgrades a server and all your scripts start crashing.

<?php echo “Hello, world!”; ?>

General No Comments

Yes, I've decided to join the world of blogging.

The intent of this blog will is to pass along any words of wisdom or wit I may come up with during my continuing journey in the world of web application development, in particular in regards to the use of the PHP programming language. You can find more articles and code samples in the PHP and MySQL section of my web site.

I am a moderator at the PHPBuilder forums (under the user name “NogDog”) and encourage you to visit there if you’d like to learn more.

I am available for freelance work. If interested, please use my “Email Me” page to let me know something about your needs, and we can begin a dialog about how best to attain them.