Table of Contents
This updated guide examines How to Check Php Version and organizes the essential facts, background, and practical takeaways in clear American English.
Method 1
Web Server
Open a text or code editor. You can use Notepad or TextEdit. Don't use a word processor such as Microsoft Word.
Enter the following code. This small piece of code will return the PHP version information when it is run on your web server.[1]
Save the file as a PHP file. Click "File" → "Save as" and then give the file a name. Add the.phpextension to the end of the file name. Name it something simple, likeversion.php.
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 thephpinfo()command. Save the file asinfo.php.
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.
- Click here for more details on uploading files to your web server.
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 visitwww.yourdomain.com/version.php.
- To see the full readout, visitwww.yourdomain.com/info.php.
Method 2
Local PHP Version
Open the Command Prompt or Terminal. If you have PHP installed locally, you can use the Command Prompt or Terminal to check the version. This also works if you use SSH to create a remote connection to your server via the command line.
- Windows - Press⊞Win+Rand typecmd.
- Mac - Open Terminal from the Utilities folder.
- Linux - Open Terminal from the dash, or by pressingCtrl+Alt+T.
Enter the command to check the PHP version. When you run the command, the installed version of PHP will be displayed.
- Windows, Mac, Linux -php -v
Fix the version not appearing in Windows. A common problem for Windows users is PHP not being included in the system path, resulting in the message'php.exe' is not recognized as an internal or external command, operable program or batch file.[2]
- Find the location of yourphp.exefile. This is usuallyC:phpphp.exe, but you may have changed this during installation.
- Typeset PATH=%PATH%;C:phpphp.exeand press↵Enter. Change the actual location if yours is different.
- Runphp -vagain. You should now be able to see the version number.
FAQ
What is How to Check Php Version about?
It provides a structured overview of php, explains the main context, and highlights practical takeaways for readers.
Why does this topic matter?
Understanding the main concepts helps readers evaluate the issue, avoid common mistakes, and make better-informed decisions.
How should readers use this information?
Use the guidance as a practical starting point, confirm details that may have changed, and follow current product, safety, or security recommendations.
Reader Comments 0
Sign in with email or Google to join the discussion.