How to Check PHP Version
Welcome to Our Blog
Share this post
If you're interested in implementing new features on your website, or are trying to pinpoint a bug, you may need to check the version of PHP that your server is currently running. You can check the version by running a simple PHP file on your webs server. You can also check what version is installed on your local computer using the Command Prompt or Terminal.
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.
echo 'Current PHP version: ' . phpversion();
STEP 3: Save the file as a PHP file. 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.
STEP 4: Create a more detailed report (optional). 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.
STEP 5: Upload the file(s) to your web server. 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.
STEP 6: Open the file in your web browser. 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.
NOTE: As a courtesy, we provide information about how to use certain third-party products, but we do not endorse or directly support third-party products and we are not responsible for the functions or reliability of such products.