PHP configuration
To determine the configuration of PHP on a shared server, run the following command from a shell account (or by running the command in Virtualmin):
php -i
This command will tell you the PHP configuration (stored in /usr/local/etc/php.ini
) of the shared server.
To the check the current configuration of PHP for a virtual server on your account, create a new PHP file (e.g. phpinfo.php) somewhere in your Document root directory or a subdirectory thereof, with the following contents:
<?php phpinfo(); ?>
and access that file from your browser using your virtual server's hostname (e.g. navigating to http://domain.com/phpinfo.php - depending on where you put the file).
Every virtual server you create (see Domains) will have its own php.ini file (which is a copy of server wide shared one in /usr/local/etc/php.ini
) and stored under the ~/etc
directory for each virtual server.
If you need to change some common settings under PHP for your account (like error reporting), you can do so through Virtualmin.
To use PHP on the command line with the configuration of one of your virtual servers, instead of the shared configuration, use the -c switch:
php -c /path/to/your/php.ini ...
Customizing your PHP configuration
- Sign in to Virtualmin (see Account logins and important URLs).
- Click Webmin Modules in the left-hand navigation, then click PHP Configuration. You should now see a listing of PHP configuration files for each of your domains.
- Under the Actions column, click Manage for the domain whose PHP setting you'd like to edit. You should now see a page listing all the available settings you can edit such as PHP Variables, Safe Mode Options, and Error Logging.
As an example, if you'd like enable error reporting do this:
- Sign in to Virtualmin (see Account logins and important URLs).
- Click Webmin Modules in the left-hand navigation, then click PHP Configuration. You should now see a listing of PHP configuration files for each of your domains.
- Under the Actions column, click Manage for the domain whose PHP setting you'd like to edit
- Click Error Logging
- For Display error messages? select Yes
- For Error types to display, select the type of errors you'd like to see. So see all error types, select All errors and warnings
- Click Save
If you prefer, you may also edit ~/etc/php5/php.ini or ~/etc/php4/php.ini within your account to achieve the same effect.
pkill php
.