Press Ctrl/Cmd + P to print
or save as PDF

HOW TO: Test Apache and PHP configuration

HOW TO: Test Apache and PHP configuration

Q. Test Apache and PHP configuration: How can I be sure that my PHP server is working? and How to know the version and modules enabled? 

A. You can create a simple PHP script and load it from your browser in order to know the version of PHP and the modules you are running.

To do that follow this step.

vim phpinfo.php

And paste inside that file these contents:

<?

php phpinfo();

?>

Then, go to http://your-server/path/phpinfo.php

Extra Knowledge on php.ini

Whether you’re a PHP beginner or a seasoned developer, I’m sure that you’ve heard of php.ini: the most important PHP configuration file. 

When PHP is run, it looks for the php.ini file in some specific locations and loads it. This file allows you to configure a few important settings that you should be aware of. Quite often, you’ll find you need to tweak settings in the php.ini file.

On the other hand, it’s certainly possible that you’ve never needed to modify php.ini. PHP can run happily with the settings provided in the default php.ini file, since PHP ships with these default recommended settings. In fact, there are no critical configuration parameters that you must set in order to run PHP. 

However, the php.ini file provides a couple of important settings that you want to make yourself familiar with. In fact, as a PHP developer, it’s inevitable, and you’ll encounter it sooner rather than later.

Check out the next article on Install Imagemagick PHP extension.