NEWS CATEGORIES:



NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
Home / News / Webmaster / Tips and Tricks

Tips and Tricks


An Introduction to php.ini

Something about php.ini

By Adrian Placinta, Web News Editor

27th of August 2007, 15:17 GMT

Adjust text size:



Enlarge picture
php.ini is the configuration file for php and is read when php is started. php.ini is searched for in these locations in this order:

- SAPI module specific location
- The PHPRC environment variable. If you are using PHPRC environment variable,
you will have to specify the directory that contains php.ini and not the direct path to php.ini: export PHPRC=/your/path , not export PHPRC=/your/path/php.ini.
- As of PHP 5.2.0, the following registry locations are searched for in the following order: HKEY_LOCAL_MACHINE/SOFTWARE/PHP/x.y.z/IniFilePath, HKEY_LOCAL_MACHINE/SOFTWARE/PHP/x.y/IniFilePath and HKEY_LOCAL_MACHINE/SOFTWARE/PHP/x/IniFilePath, where x, y and z stand for the PHP major, minor and release versions.
HKEY_LOCAL_MACHINE/SOFTWARE/PHP/IniFilePath (Windows Registry location)
- Current working directory (except CLI)
- The web server's directory (for SAPI modules)
- The directory of PHP (otherwise in Windows)
- Windows directory (C:/windows or C:/winnt) (for Windows), or --with-config-file-path compile time option. The path can be overwritten using -c argument in command prompt. For Windows, the compile directory is the windows folder: c:/windows.

The most important parameters from php.ini or the parameters that are mostly changed are: safe_mode, register_globals, upload_max_filesize, post_max_size and max_execution_time.

safe_mode is an attempt to solve the shared-server security problem. safe-mode will be removed in version 6.0

register_globals - on the earlier versions of PHP, register_globals was set for easier, but less secure coding. Now it is recommended to turn it off.

upload_max_filesize - the default value is 2MB. If you don`t want to have problems later, set it to 8MB.

post_max_size sets max size of post data allowed. This setting also affects file upload.

max_execution_time sets the maximum time in seconds; a script is allowed to run before it is terminated by the parser. This helps prevent poorly written scripts from tying up the server. The default setting is 30.

More info about php.ini in the next article.

TAGS:

PHP | php.ini | safe_mode | register_globals
Read by 1,351 user(s) | Add comment | Link to this article TWEET THIS


Article rating:
Very Good (4.1/5) 6 vote(s)    

Subscribe to news | Print article | Send to friend

© Copyright 2001-2009 Softpedia
Contact:

 

 

SEARCH THE NEWS ARCHIVE :




Today's News
| Yesterday's News | News Archive


MORE RELATED ARTICLES:


How to install PHP on IIS

Manually Configure PHP5 and Apache2

Ubuntu Christian Edition 3.3 Released

User opinions:

No user comments yet.
Be the first to express your opinion using the form below!

Share your opinion:

Your Name:
Your Email Address:
(will not be used for commercial purposes)
Solve this to prove you're not a bot: =
Your review/opinion:

 




Windows tabGames tabDrivers tabMac tabLinux tabScripts tabMobile tabHandheld tabGadgets tabNews tab

SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   ENTER NEWS SITE   |   ENGLISH BOARD   |   ROMANIAN FORUM