Chapter 5: Installing PHP Scripts |
|
Configuration files |
|
|
One or more configuration files often come with the PHP scripts you download or get from friends. If so, pay close attention to all the instructions about editing them. Never edit them in a word processor such as MS Word; always use a text editor such as NotePad, WordPad or EditPlus. Configuration files are used to set the values for certain variables that will be used by your script. These variables usually control 1) options within the script and 2) items such as email address or domain name that will be unique to your installation. A more user-friendly approach is gaining acceptance these days; some scripts create an "admin page" where you can set these values without having to edit the code yourself. Tip: If your script runs but doesn't behave quite right, check the values in the configuration files. For example, if it's supposed to be emailing you whenever a certain thing happens - and it's not doing it - you may have typed the email address wrong. Fix the mistake and test it again. |
There's no configuration file! ... Now what? |
|
First, don't panic. With some scripts, especially those that consist of just one PHP file, the configuration info is usually right near the top of the file. Also, there may not be a separate README file or any other text file with the install instructions. In this case, look for comments near the top of the file. That's where you're most likely to find instructions for setup. Do EXACTLY what they tell you to do. |
Using FTP |
|
First let me say a little about FTP client programs. First, you must have one (or several). I have three favorites. I'm not a reseller for any of these; choose whichever one suits you best or shop around for a different one altogether. I've downloaded and tested literally dozens of these clients and these are the ones I liked best. Overall, WS_FTP is the best FTP client I've used for PHP installing. It makes it easy to set the file permissions so that your script will execute (Unix systems). It's literally a point-and-click operation; you don't have to know how it works. Also, it comes with login data in a list for several FTP sites. You can type the login info for your site (including User ID and password) and it will add it to the list. Add as many sites as you want. Select the one you wish to access from the list, click Connect and presto! You're there. Get WS_FTP here: Use the search box and type in WS_FTP. It's been downloaded over 2,000,000 times and 96% of users recommend it. So do I! Thee's a free trial of the Home version. You will probably just register this version (for a small fee) and use it. If you need more features, you should check out the Pro version. It's $44.95 (for a higher price you can get all future upgrades plus full tech support) via download. For Web site maintenance, Cute FTP is a great client. It allows you to transfer multiple files at once. That's good for backing up a Web site to your local machine and Cute FTP makes it easy. Download it from: Use the search box and type in Cute FTP. Get the 32-bit version. The current revision is 5.0.4. It comes as shareware with a 30-day trial (all features enabled). After 30-days, several features, including multiple file transfer are disabled. Registration is $39.95 and will restore it to full power. |
|
|
Cardinal Rule #1: Getting Started: I'll assume you've just acquired an FTP client program, unpacked the archive and run the Install or Setup procedure. Now, it's set up on your home computer. If you're already using FTP and are comfortable with your level of expertise, you can skip the rest of this section. If not... Start up the program, read the Help files and play with the controls a bit. Log into an FTP site somewhere and get used to how downloading works. it may not seem as easy as it is on the Web - at first. Practice it a little and it will become routine. Now, I'll assume you have a Web site, and you want to move a file to it. Let's start with something very safe. Send a plain text file to some directory on your site. Now change the local directory in your FTP client. Next, download the file from your site to this directory. Load the file into WordPad or NotePad. Now, start a second copy of WordPad (or NotePad) and load the other copy of the text file. Compare the two; they should be exactly the same. Use the FTP client to delete this test file from your Web server. This harmless little exercise should have convinced you that you can use FTP without any problems at all. Note: While many people recommend using NotePad, it does have one important shortcoming. It can't handle files over 32K in size. For larger files, use WordPad or some other text editor. Tip: I use and strongly recommend a text editor called EditPlus. It's capable of some basic HTML editing, which can save you time. Also, it lets you have a lot of files open at once and do global search-and-replace operations on one file or all open files at once. This is really cool, since you sometimes make a mistake that gets copied and pasted into many files before you realize it's a mistake. EditPlus will let you fix the mistake in a several files at once. That's a major time-saver. |
| Previous Page Table of Contents Next Page |
Copyright © 2004 Steve Humphrey |