StrivingLife presents ...

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

Google Videos - How social networking can work

by James Skemp, July 27, 2006 20:22

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

I was trying to pass some time, and came upon Adventures in Linux - Episode I, on Google Video. While the top 100 is full of material of little lasting value, it's nice to see the 1-2% of content that actually serves a purpose.

For example, Stanford's famous prison experiment is available through G Video. Likewise, I think Adventures In Linux is another beneficial video.

While I'll bash most Web 2.0, social networking sites, Google continues to be the forerunner of good uses, even if the masses must plague the site with that which graces the top of most lists; dig in, and you'll find the pearls.

I've thought about doing something similar myself, using some of my guides for inspiration, and probably will after I've moved in the coming days.

Tags:
Categories: software | Internet

Dual-installing PHP: Running PHP 5 and 4 on the same local, Windows-based, Apache, server

by James Skemp, July 18, 2006 19:34

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

In previous guides, we installed PHP 4.4.2 and later moved our installation to a different folder. This time, we'll be installing the current release of PHP 5 (5.1.4) so that we can still switch back to PHP 4.4.2 if we'd like.

Downloading PHP 5.x

The current version of PHP 5.x is 5.1.4, so we'll begin by downloading that from PHP.net. We’ll want to download the (Windows Binaries) zip file, even though it is significantly larger in size than the installer (the zip file is almost 9 MB, compared to less than 3 MB for the executable), but allows us a deal more flexibility.

Installing

Once you've downloaded the zip file, extract the contents to a folder called c:\php5\. Once done, php.exe will have the full path of c:\php5\php.exe.

As with the PHP 4 installation, the install.txt file will detail how to install PHP 5. However, since you're using this guide, you shouldn't need to consult it. As with our PHP 4 installation, we'll be installing PHP 5 as a module, instead of as CGI binary (again, you can do this instead, if you so desire).

Start by backing up all of your httpd.conf files, in C:\Program Files\Apache Group\Apache\conf (if using the defaults). Since these work, add '_php4' to each of these backups.

For example, I have three httpd.conf files that I'm backing up; httpd.conf, httpd_CFMX6.1.conf, and httpd_CFMX7.01.conf. I'll be creating copies of each of these files, and calling them httpd_php4.conf, httpd_php4_CFMX6.1.conf, and httpd_php4_CFMX7.01.conf. This way I know that these use PHP 4. Once we modify the httpd.conf file(s) below, it may be a good idea to create backups and then call name them with '_php5'.

For the next steps, I'll be assuming that you've already installed PHP 4.

Begin by doing a search for

LoadModule php4_module "c:/php4/php4apache.dll"

Change this to

LoadModule php5_module "c:/php5/php5apache.dll"

Now do a search for

AddModule mod_php4.c

And change this to

AddModule mod_php5.c

Save httpd.conf. Next, head over to c:\windows\ and find the php.ini file. Rename this file to php_php4.ini (to keep with our naming standard above). We're renaming the original file, in this case, because we actually want to copy the file php.ini-dist from the c:\php5 folder to the c:\windows folder, and rename it to simply php.ini.

Once you've renamed the file, open it up. Once the file has been opened, do a search for doc_root and change it from

doc_root =

to

doc_root = “c:\home”

Or where your document root is for Apache.

Now do a search for the following line

;session.save_path = "/tmp"

And change that to your temporary PHP folder (in my previous guide, it ended up being

session.save_path = "c:/windows/temp/temp_php"

Make sure you remove the semi-colon from the beginning of the line to uncomment this line. Make sure that this folder exists.

Finally, search for the following line

extension_dir = "./"

and change it to

extension_dir = "c:\php5\ext\"

If you've installed MySQL (this page also contains a script to check the connection), you can enable access by uncommenting the following line

;extension=php_mysql.dll

You'll also want to copy libmysql.dll from c:\php5\ to c:\windows\system32\.

If you've installed PostgreSQL (this page also contains a script to check the connection), you can enable access by uncommenting the following line

;extension=php_pgsql.dll

Save your changes to the php.ini file, and close out of the file. You may want to create a copy of this file as php_php5.ini - this way you have both a php4 and php5 file.

Finally, in c:\php5\, copy php5ts.dll into the c:\windows\ folder.

Restart Apache, and assuming it starts, hit the phpinfo.php page (which contains the following lines).

<?php
phpinfo();
?>

If you visit this page, you should be told that you're running PHP 5.1.4. You may notice that Zend Optimizer is no longer listed as being installed.

If you made a copy of the php.ini file for PHP 4 (php_php4.ini is what I recommended), then you can copy the last four lines from this file, which are as follows (I'm including the new line as a line)


[Zend]
zend_extension_manager.optimizer_ts="C:\Program Files\Zend\ZendOptimizer-3.0.1\lib\Optimizer-3.0.1"
zend_extension_ts="C:\Program Files\Zend\ZendOptimizer-3.0.1\lib\ZendExtensionManager.dll"

Paste these lines at the end of your php.ini (and php_php5.ini file, if necessary) file. Restart Apache and Optimizer 3.0.1 should display on the phpinfo() page.

Until then, verify that you have backups of the files that we modified in this guide; httpd.conf and php.ini. In a later guide, or update, I'll detail how to setup a batch file to automatically move the necessary files to switch from PHP 4 to PHP 5, and vice versa (again, for updates, leave a comment).

To manually change from PHP 4 to PHP 5, and vice versa, simply delete the existing httpd.conf file. Next, make a copy of the httpd_php4.conf or httpd_php5.conf file, and rename it to httpd.conf. Do the same thing for the php.ini file. Finally, restart Apache. As long as you keep your backup copies, you can switch back and forth fairly easily. Again, a future batch file will make this much easier, by allowing one file to do all the work for you.

The batch files

Below is code for two batch files. Lines beginning with === should not be entered into the batch file - they merely contain the name of the file. Note that you may need to make some modifications, based upon where you installed programs and files.

c:\home\zblank.txt is simply a blank file. Including blank lines, each batch file contains 12 lines (2 of which are blank).

===_start php4.bat

net stop “Apache”
DEL “c:\home\php4 is ready.txt”
DEL “c:\home\php5 is ready.txt”
COPY “c:\windows\php.ini” “c:\windows\php_backup.ini”
COPY “c:\windows\php_php4.ini” “c:\windows\php.ini”

COPY “C:\Program Files\Apache Group\Apache\conf\httpd_php4.conf” “C:\Program Files\Apache Group\Apache\conf\httpd.conf”
COPY “C:\Program Files\Apache Group\Apache\conf\httpd_php4_CFMX6.1.conf” “C:\Program Files\Apache Group\Apache\conf\httpd_CFMX6.1.conf”
COPY “C:\Program Files\Apache Group\Apache\conf\httpd_php4_CFMX7.01.conf” “C:\Program Files\Apache Group\Apache\conf\httpd_CFMX7.01.conf”

net start “Apache”
COPY “C:\home\zblank.txt” “C:\home\php4 is ready.txt”

===_start php5.bat

net stop “Apache”
DEL “c:\home\php4 is ready.txt”
DEL “c:\home\php5 is ready.txt”
COPY “c:\windows\php.ini” “c:\windows\php_backup.ini”
COPY “c:\windows\php_php5.ini” “c:\windows\php.ini”

COPY “C:\Program Files\Apache Group\Apache\conf\httpd_php5.conf” “C:\Program Files\Apache Group\Apache\conf\httpd.conf”
COPY “C:\Program Files\Apache Group\Apache\conf\httpd_php5_CFMX6.1.conf” “C:\Program Files\Apache Group\Apache\conf\httpd_CFMX6.1.conf”
COPY “C:\Program Files\Apache Group\Apache\conf\httpd_php5_CFMX7.01.conf” “C:\Program Files\Apache Group\Apache\conf\httpd_CFMX7.01.conf”

net start “Apache”
COPY “C:\home\zblank.txt” “C:\home\php5 is ready.txt”

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

Tags: ,
Categories: tutorials/guides

A Scanner Darkly (2006) - best PKD movie ever?

by James Skemp, July 18, 2006 19:27

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

This last weekend I watched A Scanner Darkly, which had just hit a local Madison theatre on Friday. I'd been looking forward to the film since I'd heard about it, and since it promised to showcase a look like Waking Life.

After watching the film, I was certainly impressed. I was afraid that Linklater was going to add his own spin to it, but he actually did quite well. Of the various movies based on pieces by Philip K. Dick, I'd say that A Scanner Darkly plays very close to the work.

However, when compared with Blade Runner, Scanner just doesn't have the same stunning imagery. Of course, it's hard to compare any science fiction movie to Blade Runner, and especially difficult to compare a Dick-based movie to it (since PKD had some impact on Blade Runner - he was still alive for some of the shooting).

Once Scanner hits DVD, perhaps it will become memorable, and I dare say it's the second-best PKD movie thus far, and certainly one that mimics the novel the most (although a quick reading will show that it's certainly not that close - less than 20 pages in will show one semi-major difference).

Great acting, and great imagery which was the best way this film could have been done (how else could they really do the suit?).

Definitely looking forward to purchasing the DVD - that's what I'll leave it at for now.

Tags:
Categories: dvd / movie