DelphiFAQ Home Search:

Get information about php version and configuration

 

commentsThis article has not been rated yet. After reading, feel free to leave comments and rate it.

Question:

How can I find out which version of php is installed on my server?

Answer:

Use the php function phpinfo() which delivers lots of information about your server's configuration. Typically this will look like below. The function will put out the information HTML encoded when called within a web page and as plain text when using the CLI mode.

There is a configuration variable expose_php which decides whether PHP will expose the fact that it is installed on the server (e.g. by adding its signature to the Web server header). If this variable is set to off then see less information.

If you're just interested in the version number, you can call phpversion() instead. This function returns version information as a string.

<?php
  phpinfo();

  // prints e.g. 'Current PHP version: 4.1.1'
  echo 'PHP version: ' . phpversion();
?>

Content-type: text/html

Comments:

2009-11-14, 06:34:28
anonymous from India  
<?php
phpinfo();

// prints e.g. 'Current PHP version: 4.1.1'
echo 'PHP version: ' . phpversion();
?>


 

 

NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.
 

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: