How to Check PHP Version on Server

Server

How to Check PHP Version on Server Picture 1

Open a code or text editor. You can use Notepad or TextEdit, but don't use word processing software like Microsoft Word.

How to Check PHP Version on Server Picture 2

Enter the following code. When run on your server, this little code will return PHP's version information.

How to Check PHP Version on Server Picture 3

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.

How to Check PHP Version on Server Picture 4

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.

How to Check PHP Version on Server Picture 5

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.

How to Check PHP Version on Server Picture 6

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

How to Check PHP Version on Server Picture 7

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.

How to Check PHP Version on Server Picture 8

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

How to Check PHP Version on Server Picture 9

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.

4 ★ | 1 Vote

May be interested

  • PHPStorm: The best PHP programming software 2021Photo of PHPStorm: The best PHP programming software 2021
    the best paid php programming software - phpsrtom. link to download phpsrtom software, a professional support software for php programmers
  • How to Enable Cross Origin Resource Sharing (CORS) for Sharing Resource Using Apache Servers, PHP and JqueryPhoto of How to Enable Cross Origin Resource Sharing (CORS) for Sharing Resource Using Apache Servers, PHP and Jquery
    all kinds of interaction on web involve either a client side or a server side. the client side (usually a web browser) launches a request for some resource on server and the server side (usually a php or asp) gives a response back. if the...
  • How to Make a PHP Hit CounterPhoto of How to Make a PHP Hit Counter
    hit counters are a popular feature among new and experienced webmasters alike. there are several different methods of including a hit counter on your site, but this manual focuses on a specific implementation in php. it is assumed you are...
  • How to Create and Call PHP FunctionsPhoto of How to Create and Call PHP Functions
    perhaps you have learned the basics of writing php scripts. but sometimes your code may be long and repetitive. php functions are a flexible and easy way to consolidate code. this tutorial will you teach the basics of php functions. (note:...
  • How to Install PHPMailerPhoto of How to Install PHPMailer
    need to send emails from your php application? the default mailing system in php (mail()) doesn't offer the customization features of phpmailer, which is the most popular mail extension for php. this wikihow will show you how to install...
  • How to Write PHP ScriptsPhoto of How to Write PHP Scripts
    php is a server scripting language used to make web pages interactive. it became widely popular due to its ease of use, interactivity within web pages, and integration with html. think of what happens when a page is edited on this website....