Quick Troubleshooting Guide for Your First PHP Script

Problem: Nothing shows up or you see a 'Web page not found' sort of message.

Solution: Make sure the .php file is named correctly (no spaces, must end in .php, like chickenman.php).

IF YOU'RE TESTING YOUR PHP FILE ON YOUR OWN COMPUTER:

Looks like your Web browser is not opening up the script through the server. In order to test on your own machine you must have Web server software and PHP installed on your very own computer. If you do and you're still not getting your browser to open the .php file in the right way, you're not getting to the script through the right URL path. If you opened it through the File--> Open menus, you did it the wrong way; you must open the file through the browser's URL via a path that goes through the Web server (as opposed to opening the file directly). If you're using Windows, under the Start menu go to Settings-->Control Panel-->Network. The "Computer Name" listed under "Identification" will be the name of your computer (mine is "rocketboy"). That name will be the beginning of your URL and will lead you to your root Web directory, (which is often inetpub/wwwroot, but you don't have to type that part into the URL because that's where "rocketboy" leads you automatically). So on my computer, if I have chickenman.php inside my root Web directory, I type into my URL box: http://rocketboy/chickenman.php.

IF YOU'RE TESTING YOUR PHP ON A SERVER SOMEWHERE ELSE:

If you have your .php file on a server out on the Web somewhere and you've FTP-ed it up, you should be able to open the file through the URL. For example, if I FTP the file chickenman.php into the Web directory on hulagrrl.com, the URL to that file will be http://www.hulagrrl.com/chickenman.php. If you've done this and it still doesn't work, call your Web hoster's tech support and make sure that PHP is set up correctly on the server side.

Problem: You got an error message

Solution: Sounds like your PHP code has an error. The message should give you a line or lines of code to look at. Look at those lines of code in your document and see if you made a mistake. The most common mistakes are: missing opening tag (<?php); missing closing tag (?>); missing quotation mark; missing semicolon at the end of the line that reads print ("I am the CHICKEN MAN");