JavaScript appears to be disabled. We recommend you enable JavaScript while visiting this site.

(All original content on this site is licensed under the Creative Commons License Attribution-Noncommercial-No Derivative Works 3.0.)

Upgrading PHP (4.4.2 to 4.4.4 and 5.1.4 to 5.2.0)

In this article, we'll be upgrading PHP on our local, Windows, Web server. In previous guides we installed PHP 4.4.2 as well as PHP 5.1.4, both on the same machine, with the ability to switch as we like. However, we've yet to cover how to upgrade either installation (and upgrading is definitely a need).

At the time of this writing, the current versions of PHP are 4.4.4 and 5.2.0, for the 4.x and 5.x versions, respectively.

We'll be going over the upgrade for each version separately, so you can simply skip to which version you're currently using.

Upgrading PHP 4.4.2 to PHP 4.4.4

First off, make sure that Apache has been stopped.

Now, rename the directory where you've installed PHP 4.x to ... have the suffix of '-previous' (for example, c:\php4-previous\). We'll do this, instead of installing over the directory so that we have a backup copy, as well as a 'clean' version of the install directory.

Next, you should have, or should, download the Windows binary in zip format, for the most current version of PHP 4.x (4.4.4 at the time of this writing). Extract the contents of this folder so that you have the same directory structure as before.

For example, for the previous version of PHP, my php.exe file was at c:\php4\php.exe. For the new install, I'll want php.exe to be in the same location.

Once that's done, we'll want to grab the php4apache.dll and/or php4apache2.dll files from our previous install directory and put a copy of them into our new install directory.

For the new version of PHP 4.x, make a copy the php4ts.dll file and put the copy in the Windows folder (c:\windows\).

Next, there's the matter of the php.ini file. At this point, I did a compare of the new version's file with the previous version's file (php.ini-dist) using WinMerge. Luckily, the two files are identical, so there's no updating necessary.

At this point, you can start up Apache and hit your phpinfo page (code listed below). You should see that PHP's version has been updated to 4.4.4. If you'd like, you can also test your connection to the database server of your choice (MySQL and/or PostgreSQL).

<?php
phpinfo();
?>

Now that we're set with our new version of PHP 4.x, you can either delete, or as I recommend, archive, your old PHP install directory, just in case something comes up in the next couple of weeks. Also, if you have any non-core extensions, you'll want to make sure that those get moved over as well.

Next, we've got our PHP 5.x installation to upgrade.

Upgrading PHP 5.1.4 to PHP 5.2.0

Upgrading PHP 5.x is almost exactly the same as upgrading PHP 4.x.

First, make sure that Apache has been stopped. Next, rename your current PHP 5.x directory (I added '-previous' to the end of my directory's name). If you don't already have a copy, download the Windows PHP 5.x binaries and extract them so that you preserve the same file structure as before.

For example, php.exe was located at c:\php5\php.exe for my previous version, so that's also where it should sit in the new directory.

Next, make a copy of the php5ts.dll file and put it into the Windows directory (c:\windows\ for example), overwriting the old one. If you installed any extensions, copy those extensions over from your previous install's directory to your new install's directory.

Now there's the matter of the php.ini file. At this point, I did a compare of the new version's file with the previous version's file (php.ini-dist) using WinMerge and there's a number of changes.

So, what you'll want to do is compare your PHP.ini file with the php.ini-dist file from the previous version, so we can get an idea of what changes were made. Now, make a copy of the new php.ini-dist and make the same changes you've made for the old version.

For example, six changes had been made to my php.ini file, which I've listed below.

doc_root
extension_dir
extension=php_mysql.dll
extension=php_pgsql.dll
session.save_path
[Zend]

Once you've ported over all of your changes, make a backup of your old php.ini file and replace it with the updated version. You can now restart Apache (2) and verify using phpinfo() that your version has been upgraded. You'll also want to check your database connection(s) as well.

And with that, you've updated PHP 5.x.

View all of the steps to creating a local Web server, for development.

Tags: ,

Categories: tutorials/guides

(All original content on this site is licensed under the Creative Commons License Attribution-Noncommercial-No Derivative Works 3.0.)

Upgrading Subversion and TortoiseSVN on Windows (1.4.0 to 1.4.2)

In a previous article, Installing Subversion and TortoiseSVN to a Windows XP, Home Edition, SP2, local machine with Dreamweaver 8, we installed Subversion 1.4.0 and TortoiseSVN 1.4.0 to our Windows machine. This time, we'll be quickly going over how to upgrade our installation.

Upgrading Subversion

The Subversion upgrade is a quick installation because all you really need to do is install the new setup file. You can get the file from Tigris, which is called svn-1.4.2-setup.exe. Once the 3.5 MB file has been downloaded, run it.

You can also uninstall Subversion and then run the new installer, if you so desire.

You can continue through the installation, reading as you do. When you get to a Select Additional Tasks window, make sure that the checkbox next to the lone Apache module option is unchecked. Of course, if you're using Apache, check it (but in my previous article, we/I decided not to use this module).

Once the installation begins, files will be replaced. If you setup Subversion as a service, you may run into an error message when svnserve can't be replaced. Make sure that you stop the service and then retry. Once the installation has finished, you can restart the service.

Note that you shouldn't need to upgrade any previous repositories.

Upgrading TortoiseSVN

First, of course, download the most recent version of TortoiseSVN, 1.4.1 for Subversion 1.4.2, from Tigris.

To upgrade TortoiseSVN, you do not have to uninstall previous versions (per the documentation). So, start up the 8 MB installer and work through the steps. Nothing surprising here.

Once the installer is finished, you'll need to restart your computer (but the documentation suggests you can just log off and then log back on). Restart, and you should be set.

(All original content on this site is licensed under the Creative Commons License Attribution-Noncommercial-No Derivative Works 3.0.)

PHP Forum Software Showdown Part 6: phpBB

It's that time again. This time, we'll be looking at phpBB. “phpBB is a high powered, fully scalable, and highly customizable Open Source bulletin board package. phpBB has a user-friendly interface, simple and straightforward administration panel, and helpful FAQ. Based on the powerful PHP server language and your choice of MySQL, MS-SQL, PostgreSQL or Access/ODBC database servers, phpBB is the ideal free community solution for all web sites.”

Lot's of features, so let's get to it. In this article, we'll be installing phpBB version 2.0.21, which is the latest version, as of June 9, 2006. A beta version of 3.0 came out a very short period before this article was written, otherwise I don't know that phpBB would have made it. Anywho, on with it.

File and folder size

The zip file for phpBB weighs in at around 650 KB. Unzipped, we're looking at almost 2 MB. The zip file contains a single phpBB2 folder, so extract away. phpBB is also available in gzip and bz2 formats.

Requirements

Check out these requirements. PHP 4.0.3+ and one of these database systems; MySQL 3.22+ or PostgreSQL 7.0.3+ or MS SQL Server 7+ or MS Access 2000+

Installing on our local Web server

Unlike past articles, for these forum reviews we're going to create the necessary users and databases using the command line interface of MySQL. If you're going to be installing these forums to a remote system, just create the user(s) and database(s) as usual (and that goes for if you're installing it locally as well).

Creating the user and database via the command-line

First, you'll need to login to MySQL. Open up the Run prompt by going to Start > Run ... and type cmd, then press Enter. At the prompt, if you've setup MySQL correctly, you can type the following command, followed by pressing Enter.

mysql -h localhost -u root -p

At this point, you'll be prompted to enter your password, which you'll have already setup. Enter your password and press Enter.

At this point, you're logged into MySQL. Now, we can create our database, create our user, and grant the user privilege to modify the database we created.

Since we're installing phpBB, we'll create a database called phpBB.

create database phpBB;

At this point, you'll be told that “Query OK, 1 row affected”, followed by the execution time.

Now, we'll create a user with privileges to access the database. Note that other than the bold text, this command is case-insensitive. Also, you may want to change 'phpbb' to something different (as this is the user's password).

Before you enter this, look it over, and then read the paragraph following, for an explanation.

GRANT select, insert, update, delete, index, alter, create, drop
ON phpBB.*
TO phpBB IDENTIFIED BY 'phpbb';

The first line, “GRANT select, insert, update, delete, index, alter, create, drop”, states what privileges the user will be granted. The next line, “ON phpBB.*”, states what the privileges are applied to. Finally, “TO phpBB IDENTIFIED BY 'phpbb';” states what user will get these privileges. Since the user doesn't exist yet, we're also giving a password to the user.

If the query is OK, enter the following command.

UPDATE mysql.user SET Password = OLD_PASSWORD('phpbb') WHERE User = 'phpBB';

If this query is OK, and it works, type exit, and press Enter. Now attempt to login to the phpBB user. Once you've logged in, enter the following command.

show databases;

You should be given an ASCII table that shows there's a database of phpbb. Yippee.

Now, let's install phpBB.

Installing phpBB

First, unzip the downloaded zip file. I'll be using one called phpBB2.

Since we're installing locally, we don't have to worry about permissions. So, once phpBB has been decompressed, navigate to the phpBB root folder in your browser. You'll be automatically be redirected to http://localhost/projects/phpbb2/install/install.php

There's a form to fill-out, so let's get to it.

Database Type: MySQL 4.x/5.x
Choose your installation method: Install
Database Server Hostname/DSN: localhost
Your Database Name: phpBB
Database Username: phpBB
Database Password: phpbb
Prefix for tables in database: phpbb_
Admin Email Address: strivinglife@gmail.com
Domain Name: localhost
Server Port: 80
Script path: /projects/phpbb2/
Administrator Username: admin
Administrator Password: cbe15b

That's it. Woot. You'll have to delete or rename the install and contrib folders (I put an underscore before both). At this point, you can start bouncing around the forum. Woot?

How's the code look?

Like most other forums, phpBB uses tables, and doesn't care to declare a summary. There's also an issue with an 'invalid' target for the footer link.

Internally, code is commented pretty darn well. However, the main comment header is the same copyright notice over and over. Yuck.

Default layout and administrative interface

Once installed, phpBB setups up one category, one forum, and one post.

Unfortunately, the look is very boxy, and reminds me of the look of a number of other forums. There's really not that much, graphically, that separates it from the others. Very similar look to MyBB and PunBB. Where's the admin interface? Oh, there's a link way down at the bottom of the page. Eh.

Upgrading

Checking for updates, amongst other things, is quite easy from the interface, and the install even had an option regarding upgrading. Hmm.

They do have archived files with the changed and patched files only available for download, which is quite nice.

The temporary conclusion

phpBB is pretty much like the others that we've reviewed. But, now that we've gone over all of them, as far as installation and first impressions, it's time to dig into them deeper.

Stay tuned for the next PHP Forum review article, where we start busting heads.

View all of the steps to creating a local Web server, for development.