Click here for Toll-Free Service for your business starting at $2.00 per month

Main Menu

How do I know my PHP version?

Started by iamplj, January 27, 2007, 02:56:42 PM

Previous topic - Next topic


Hi everyone

I want to upgrade my Wordpress. It said they need PHP 4.2 or greater. So how can I get my PHP version on Freepgs? Thank you! ;D


It happens to be PHP Version 5.0.4, but you can get that by making a PHP file (like maybe phpinfo.php) and putting this in it:

echo phpinfo();

It also gives a lot of other useful information about the PHP installation on the server.




You can also use the PHP defined constants. For example the exact PHP version is stored in PHP_VERSION.
Here is a list of some of them which can be usefull:
- PHP_VERSION contains the version of PHP
- PHP_OS contains the name of the Operating System used on the server
- _FILE_  contains the name of the file currently used.

If you want the full list use get_defined_constants() which returns an array with the names and values of all the constants currently defined. This includes those created by extensions as well as those created with the define()  function.