When Apache starts, it loads PHP module and its extensions based on configuration in php.ini file. Once started, it is easy to see which extensions were loaded by using PHP’s phpinfo() function. Not only it will output detailed information on PHP configuration, it will also note which php.ini file was loaded, which is very useful in case thereare several php.ini files in the file system.
To use the function, simply create new file called e.g. myphpinfo.php in the root directory of web server, with the following content:
<?php
phpinfo();
?>
In the browser, navigate to the newly created file, e.g. http://www.example.com/myphpinfo.php and you will see a large amount of information about the current state of PHP in your web server.
As from PHP 5.2.2, “Loaded Configuration File” information was added, and it tells which php.ini file was used on Apache startup. That is the one you need to modify in order to change PHP configuration.
To enable/disable PHP extensions, open php.ini file in your editor of choice and comment/uncomment the ones you need to affect.
After saving the changes, Apache needs to be reloaded for them to come into effect.
On Ubuntu, issue the command
PHP Configuration – Extensions
When Apache starts, it loads PHP module and its extensions based on configuration in php.ini file. Once started, it is easy to see which extensions were loaded by using PHP’s phpinfo() function. Not only it will output detailed information on PHP configuration, it will also note which php.ini file was loaded, which is very useful in case thereare several php.ini files in the file system.
To use the function, simply create new file called e.g. myphpinfo.php in the root directory of web server, with the following content:
<?php
phpinfo();
?>
In the browser, navigate to the newly created file, e.g. http://www.example.com/myphpinfo.php and you will see a large amount of information about the current state of PHP in your web server.
As from PHP 5.2.2, “Loaded Configuration File” information was added, and it tells which php.ini file was used on Apache startup. That is the one you need to modify in order to change PHP configuration.
To enable/disable PHP extensions, open php.ini file in your editor of choice and comment/uncomment the ones you need to affect.
After saving the changes, Apache needs to be reloaded for them to come into effect.
On Ubuntu, issue the command
sudo /etc/init.d/apache2 reloadThe same applies if order of extensions needs to be changed, as is the case in enabling PHP EXIF extension.