Chapter 10. PHP Gotchas

Even though we've tried to give clear instructions, and you've no doubt followed them to the letter, problems can still arise. This chapter lays out some of the most common problems by symptom and suggest some frequent causes.

Note

There is a whole other universe of gotchas involving database connectivity. This chapter deals with PHP-only problems. You may want to skip ahead to Chapter 19 if you're having problems with PHP and a database. Also, problems specific to certain more advanced features (including sessions, cookies, building graphics, e-mail, and XML) are dealt with in their individual chapters in Parts III and IV.

Installation-Related Problems

Instead of getting moralistic about people who rush through their installs without understanding the documentation, we'll point out a few common symptoms that characteristically appear when you've just installed PHP for the first time.

Tip

If you are seeing similar errors but are confident that your installation is stable, follow the cross-references to later parts of this chapter.

Symptom: Text of file displayed in browser window

If you are seeing the text of your PHP script instead of the resulting HTML, the PHP engine is clearly not being invoked. Check that you are accessing the site through the web server and not via the filesystem. ...

Get PHP6 and MySQL® 6 Bible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.