O'Reilly logo

PHP and MySQL® For Dummies®, 4th Edition by Janet Valade

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix B. Configuring PHP

This appendix assumes that you have the Web software installed.

PHP has many configuration settings that determine how it behaves. I talk about PHP settings at various places throughout the book. For instance, I talk about the PHP error settings when I explain how PHP errors work in Chapter 6. I explain the settings and when they need to be changed in context in the book.

The configuration settings are stored in a text file named php.ini. PHP looks for the file php.ini when it begins and uses the settings it finds. If PHP can't find the file, it uses a set of default settings.

All PHP settings can be changed in the php.ini file. Some settings should always be changed, and some should be changed only in specific circumstances. For example, magic quotes should always be turned off. I explain magic quotes in Chapter 6.

On your own computer, you always have access to the php.ini file and can change the settings yourself. However, a Web host isn't going to allow you access to the general php.ini file, because it controls the settings for all the users on the computer, not just for your site. So, you change any PHP settings on your Web hosting account with a different procedure:

  • A local php.ini file: Some Web hosts allow you to have a local php.ini file that controls: PHP's behavior for your Web site only. If so, you can make any needed changes in this local php.ini file.

  • An .htaccess file You can add directives to your .htaccess file that change PHP settings. Only ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required