Php.ini settings

From Lunarpages Web Hosting Wiki

What should my php.ini file look like?

In php.ini, there is a different format to define your PHP settings. All lines are in the following format:

setting_name = setting_value

So, this means if you move the settings from .htaccess to php.ini, you must convert the format. Let's say you have the following line in your .htaccess file:

php_value register_globals 0

The corresponding php.ini format is as follows:

register_globals = Off

Notice how the value 0 becomes Off (without quotes) and 1 becomes On. Now if your php_value has quotes like the following, for example:

php_value include_path ".:/home/user/lib"

The corresponding php.ini format is:

include_path = ".:/home/user/lib"

For the PHP settings you do not have in your php.ini file, PHP will use our default configurations. It will not use the server php.ini but rather a default one. You may need to set other settings. You may create a phpinfo.php file in public_html with the beginning and ending php tags and the following in between to see any changes by browsing it:

<? phpinfo() ?>

Where should I place the php.ini file?

Upload php.ini into your /public_html/ directory. Then, add the following line into the .htaccess file in your public_html:

suPHP_ConfigPath /home/username/public_html

Change username to your Lunarpages username.

On Windows servers you would upload the php.ini file to your httpdocs directory. (Note that this only works if your domain is set to php4.)