How to Check PHP Version
Open a text or code editor., Enter the following code., Save the file as a PHP file., Create a more detailed report (optional)., Upload the file(s) to your web server., Open the file in your web browser.
Step-by-Step Guide
-
Step 1: Open a text or code editor.
You can use Notepad or TextEdit.
Don't use a word processor such as Microsoft Word. -
Step 2: Enter the following code.
This small piece of code will return the PHP version information when it is run on your web server.<?php echo 'Current PHP version: ' . phpversion(); ?>
Click "File" → "Save as" and then give the file a name.
Add the .php extension to the end of the file name.
Name it something simple, like version.php. , The file above will output your current PHP version number, but if you want more information, such as system info, build dates, available commands, API information, and more, you can use the phpinfo() command.
Save the file as info.php. <?php phpinfo(); ?>
You may have to use an FTP client, or you may be able to upload through your server's admin control panel.
Place the file(s) in the root directory of your web server.
Click here for more details on uploading files to your web server. , Once the file has been uploaded to the server, you can use your browser to load the file.
Navigate to the location of the file on your server.
For example, if you placed it in the root directory of your domain, you would visit www.yourdomain.com/version.php.
To see the full readout, visit www.yourdomain.com/info.php. -
Step 3: Save the file as a PHP file.
-
Step 4: Create a more detailed report (optional).
-
Step 5: Upload the file(s) to your web server.
-
Step 6: Open the file in your web browser.
Detailed Guide
You can use Notepad or TextEdit.
Don't use a word processor such as Microsoft Word.
This small piece of code will return the PHP version information when it is run on your web server.<?php echo 'Current PHP version: ' . phpversion(); ?>
Click "File" → "Save as" and then give the file a name.
Add the .php extension to the end of the file name.
Name it something simple, like version.php. , The file above will output your current PHP version number, but if you want more information, such as system info, build dates, available commands, API information, and more, you can use the phpinfo() command.
Save the file as info.php. <?php phpinfo(); ?>
You may have to use an FTP client, or you may be able to upload through your server's admin control panel.
Place the file(s) in the root directory of your web server.
Click here for more details on uploading files to your web server. , Once the file has been uploaded to the server, you can use your browser to load the file.
Navigate to the location of the file on your server.
For example, if you placed it in the root directory of your domain, you would visit www.yourdomain.com/version.php.
To see the full readout, visit www.yourdomain.com/info.php.
About the Author
Jack Jones
Professional writer focused on creating easy-to-follow cooking tutorials.
Rate This Guide
How helpful was this guide? Click to rate: