How to Check PHP Version on Server
Server
Open a code or text editor. You can use Notepad or TextEdit, but don't use word processing software like Microsoft Word.
Enter the following code. When run on your server, this little code will return PHP's version information.
Save as PHP file. Click "File" → "Save as" and give the file a name. Add the .php extension to the end of the name. Choose a simple name, such as version.php.
Generate a more detailed report (optional). The file above will tell you what the current version of PHP is. However, if you want more information, such as system information, release date, available commands, API information, etc., you can use the phpinfo() command. Save the file with the name info.php.
Upload your file(s) to the server. You will probably have to use an FTP client program. You can also get it through your server's admin console. Leave the file in the root directory of your server.
Refer to the article on how to upload files to your server.
Open the file in your browser. Once the files have been uploaded to the server, you can use your browser to upload them. Find the file location on the server. For example, if you leave them at the root of your domain, go to www.yourdomain.com/versions.php.
To view the full data, go to www.yourdomain.com/info.php.
Local PHP version
Open Command Prompt or Terminal. If PHP is installed locally, you can use Command Prompt or Terminal to check the version number. You can also do it this way if you use SSH to make a remote connection to the server via the command line.
Windows – Press ⊞ Win+R and type cmd.
Mac – Open Terminal from the Utilities folder.
Linux – Open Terminal from the desktop or by pressing Ctrl+Alt+T.
Enter the command to check the version number of PHP. When running the command, the installed PHP version will be displayed.
Windows, Mac, Linux - php -v
Fix version number not appearing on Windows. A common problem for Windows users is that PHP is not in the system path, hence the message 'php.exe' is not recognized as an internal or external command, operable program or batch file (not recognized as an internal or external command, operable program or batch file). can determine whether 'php.exe' is an internal or external command, a workable program or a batch file).
Find your php.exe file location. It's usually C:/php/php.exe, but you may have changed it during installation.
Type set PATH=%PATH%;C:/php/php.exe and press ↵ Enter. Change its actual location if it's not currently in this location.
Run php -v again. You will now see the version number.
You should read it
- How to check the version of macOS in use
- How to check the current Driver version of the computer
- How to view the version of Word in use
- How to check TPM version before upgrading to Windows 11
- Check version information in SQL Server
- How to check your Linux version
- How to accurately check the lock or international version for iPhone
- How to check the version of Chrome browser, Coc Coc, Firefox is using is how many versions
May be interested
- How to check Windows 11 versionchecking the windows 11 version helps you know which version your computer is using and whether it needs to be updated or not. the following article from software tips will guide you on how to check the windows 11 version quickly, simply and accurately.
- How to check TPM version before upgrading to Windows 11if you want to upgrade to windows 11, you must discover whether your computer has a tpm and which version of tpm you have access to.
- Check Office, Word, Excel, Powerpoint versionwant to check the version of office you are using? with just a few simple steps, you will know the current version. let's explore the details in the article of free download.
- 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.
- Microsoft continues to 'delay' the plan to launch a new version of Exchange Server for another 4 yearscurrently, with a focus on security, microsoft has just announced that the next version of exchange server will be released in the second half of 2025.
- 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.