How to Check PHP Version
Method 1 of 2:
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 .php extension to the end of the file name. Name it something simple, like version.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 the phpinfo() command. Save the file as info.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 visit www.yourdomain.com/version.php.
- To see the full readout, visit www.yourdomain.com/info.php.
Method 2 of 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+R and type cmd.
- Mac - Open Terminal from the Utilities folder.
- Linux - Open Terminal from the dash, or by pressing Ctrl+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 your php.exe file. This is usually C:phpphp.exe, but you may have changed this during installation.
- Type set PATH=%PATH%;C:phpphp.exe and press ↵ Enter. Change the actual location if yours is different.
- Run php -v again. You should now be able to see the version number.
4 ★ | 2 Vote
You should read it
- The best SFTP server and tools for secure file transfer
- How to install and open File Server Resource Manager in Windows Server 2012
- Check version information in SQL Server
- Use IIS to set up FTP Server on Windows
- Windows Server 2012 released in August 2012
- Microsoft continues to 'delay' the plan to launch a new version of Exchange Server for another 4 years
- Instructions for setting up and managing FTP Server on Windows 10
- New points in SQL Server 2017
May be interested
- How to Check PHP Version on Serverif you are interested in adding new features to your website or are trying to identify a programming error, you may want to check the php version your server is using. you can do this by running a simple php file...
- How to check your Linux versionif you need to find the actual linux version or even the linux kernel version, please read the following article.
- How to accurately check the lock or international version for iPhoneiphone international version or normal lock version has the same configuration and settings. however, the international version is always more expensive than the lock version. so how to distinguish iphone version lock from international version.
- How to check the version of Chrome browser, Coc Coc, Firefox is using is how many versionsto check if you have been upgraded to the latest version, you need to check your browser version. today, the software tips will guide you how to check the version of chrome browser, coc coc, firefox is using is how many version.
- How to check the version of Microsoft Office you are using is 32-bit or 64-bitnot only you but also many other users who are using microsoft office programs do not know the version of office you are using is 32-bit or 64-bit. if you want to know or need to know which version of office you are using is 32-bit or 64-bit, please refer to the steps in the following article of network administrator.
- How to check the Java version on Windows and macOSusers often want to check the java version before installing the latest version. in this article, tipsmake will check with you the java version easily on windows and macos.
- How to check .NET Framework version on Windows 10some software requires you to install the appropriate version of the .net framework to run, here are the two simplest and most common ways to check the .net framework version.
- Android App Version Checkschecking the application version on android will help you know if you need to upgrade the application or not, when tracking information about the new version of the application.
- How to check what version of DirectX you are usinghow to check what version of directx you are using. if you use windows operating system and play games, directx is a very familiar name. directx supports users to handle multimedia related tasks, especially graphics processing of game and video on windows platform.
- How to check the Bluetooth version on a Windows 10 computerthe article guides how to check the bluetooth version in use on computers, laptops, windows 10. click to see details!