Working with the php.ini File
Being able to work with the php.ini file goes along way towards mastering PHP. If you are developing scripts on your own PHP-enabled computer or if you have administrative level control over your server, you can globally change how your PHP installation runs.
Common settings you might want to adjust include:
- register_globals
- display_errors
- error_reporting
- magic_quotes_gpc
Keep in mind that PHP is installed with the settings that the developers think are best. Changing any particular setting may make it easier to learn the language but at the cost of security or performance. That being said, I present to you…
Steps for editing your php.ini file:
-
Create a script called phpinfo.php containing the following code:
<?php phpinfo(); ?>
-
Place this script on your server.
-
Run this script in your Web browser by going to
http://your.url.here/phpinfo.php
in your Web browser (on your own computer, this may be something likehttp://localhost/phpinfo.php
orhttp://localhost/~username/phpinfo.php
). -
In the resulting page, look for the line which says “Configuration File (php.ini) Path”. It should be about 6 rows down in the table.
…