Chapter 2: What Is PHP?

Google

The dirty little secret about PHP

PHP scripts can be much faster than Perl/CGI scripts. And they can be much slower, too! Here's the short answer to why: There's a "module" called mod_php that gives PHP a big speed boost. (There's a similar one for Perl.) You need this module! Check to be sure the host you plan to use has installed it. If not, your scripts won't run as fast as they could.

If the sales page for the host doesn't mention it, you'll need to contact Technical Support at the host and find out whether they installed mod_php. Another way to find out is to run the little script mentioned in this book that just calls the phpinfo() function. It will give you a display of all the information about that host's installation of PHP. Look in the "apache" section (about 1/4 of the way down the page). At the end of this section, look in the "Loaded Modules" item and see if mod_php is on the list.

There's a lot of other useful stuff listed there as well. Certain things in the configuration may or may not cause problems with certain scripts. If you run into problems that you can't resolve, it may be a server issue. Before you bug the techies at the host, make sure that you've done everything you can to resolve the problem.

You can get answers to a lot of weird problems on the PHP forums. Be prepared to provide these nice people with as much information as possible. Also, if you're a "newbie" at programming or debugging, make sure you emphasize that fact in your post. Otherwise, they may assume you know a lot more than you really do - and their answers might not make sense to you.


What version(s) do I need?

For best results in all situations, I suggest using the most recent version you can get. Currently, version 4.3 or higher is available on most systems. This version will support practically anything you can ask a PHP script to do. PHP 5.0 is already available for beta testing. The most recent version can always be found at the PHP home page:

www.php.net

While it's possible to run PHP scripts on some - not all - Windows NT hosts, I don't recommend it. You really should be on a host using Linux or at least some version of Unix. Also, you want the host to be using the Apache web server software - preferably version 1.3 or higher.

A few tips about hosting

Please, please, please - don't just go with the cheapest host you can find! It can end up costing you time, money and success in the long run. You need to know certain things about a host before you put your site there. Here's a checklist:

  • You need PHP and MySQL. Don't settle for a host that doesn't provide both. In some cases you'll need more than one MySQL database; find out whether you get just one or several.

  • Since your home page may be a .php file, be sure that the correct settings have been made on your host to allow this to work. (For the techies...it's a usually matter of certain settings in the .htaccess file on Linux machines.)

  • For reasons that will soon become clear...you'll be much better off with a host that runs the Linux operating system rather than Windows on its servers.

  • Be sure you get web-based email and that you can create as many email accounts as you're likely to need. At times, you'll want to be able to check your email away from home. Unlimited autoresponders is also a good feature to have. So is email forwarding.

  • Be sure to find out about what spam filtering they use! You don't want to it!

  • Tech support must be knowledgeable and available quickly. Does the host provide toll-free phone support? Are they available any time - day or night? Tip: Contact tech Support before you sign up and check them out.

  • On-site backup and restore is a must. How often do they make backups? Do they back up your databases, too?

  • "Uptime" is critical. Your customers can't buy from you when your site is down! What uptime percentage do they claim to have? Expect 99% or better; don't settle for less.

  • You need plenty of bandwidth(expressed in GB/month). Be sure you know what you're getting - and whether it will be enough. Every page view and download consumes some of your bandwidth allotment. Will they sell you extra bandwidth automatically if you exceed your quota? (If not, your site will go down for the rest of that month!)

  • A web-based control panel such as cPanel is very handy. Be sure you get one of some kind so you can manage your site from anywhere. I find it easier if all the icons or control links are on one page.

  • What type of hosting do you need - virtual or dedicated? For low volumes of traffic, virtual is often OK. But your site will be on the same server with many others. All those sites must share the resources of a single computer. High-traffic sites will need dedicated hosting - your site will have a server all to itself. Expect to pay $99/month or more for dedicated hosting, compared to $10-25/month for virtual hosting.

Here's a virtual host with everything you need =>  http://9181401630.thirdsphereplus.com/

Previous Page   Table of Contents   Next Page

Copyright © 2004 Steve Humphrey