Follow:  Follow PHPExercises on Twitter  Follow us on Facebook

Your Setup

Testing Your Scripts

To test your scripts, you will need access to a computer or server with PHP installed. If you don't have access to such a site or computer, you'll need to set up a localhost server on your home computer and install PHP. The easiest way to do this is to set up a solution stack, a combination of server (usually Apache), database (usually mySql), and PHP. You will find versions of these available for Windows, Mac, and Linux. We have included links to several sources for these on the Resources page.

If you really want to dig in and like a challenge, set up an Apache server, then download PHP and a database like mySql. If you want to go this route, here are the links:

Whichever route you choose, you will benefit from having a local server to practice with.

Here's the page on the official PHP site that gives setup recommendations.

Help for White Screen of Death

If you run into the 'white screen of death' (wsod), a blank white screen with no indication of where the problem is, there are a couple of things you can do. Check the browser's source code for the page. Sometimes you'll find a hint there. Or check the Apache error log.

If that doesn't help, and you are on a local development or test server, switch on strict PHP error reporting. Go to your server's php folder, open the php.ini file, and find the section titled, 'Error handling and logging.' Read through the excellent documentation; you probably need the setting E_ALL | E_STRICT, but you might find a different setting that's better suited to your needs. Warning: as the PHP documentation states, this setting is only for development sites, not for production sites. You can find more information in the PHP manual: Runtime Configuration.