Cara cek php --version di cmd
Introduction Show Hosting providers are traditionally slow to adopt new PHP versions on their servers. The consequence of this is that many different PHP versions exist on the web at the same time. If you are implementing new features, installing a new PHP-based app, or trying to locate a bug on your website, it is important to know which PHP version your web server is running. In this tutorial, you will learn how to check your PHP version by running PHP code on your server or using the command line. Prerequisites
Check PHP Version by Running PHP CodeThe simplest method to determine the PHP version running on your website is executing a PHP file that contains the following code:
Create the file using a text editor like gedit or Notepad, and upload it to your website’s document root directory. Then open a web browser and type the full address of the file in the address bar. For example, if you uploaded a file titled
The code above displays the PHP version without any further details, like in the output below: If you need more details on your PHP configuration, such as system information, build date, server API, configuration file information, etc., upload a file containing the
When visited in the browser, this file shows the PHP version in the upper-left corner, followed by configuration data: Note: While For a list containing all the loaded PHP extensions and their versions, upload a file with the following code:
The output shows each extension in a separate line, including the version of the PHP core: Check PHP Version Using the Command Line (Windows, Linux and macOS)If you have permission to SSH into the remote server, use the command line to check the installed PHP version. This method is also useful for checking the PHP version installed locally. 1. Type the PHP command:
2. The
Note: If there is more than one PHP version installed on the server, the Fix ‘PHP is not Recognized’ Error on WindowsOn Windows, the PHP path is sometimes not recognized by the system, so the To solve this problem, set the 1. Type the following command, replacing
2. Typing Conclusion This article aimed to explain the common ways to check the PHP version on your server or local machine. The methods covered in this tutorial include running PHP code and using the command-line interface. Cara Mengetahui PHP versi berapa?Caranya ketik domainanda.com/phpinfo. php. Anda akan melihat versi PHP yang digunakan pada website.
PHP terbaru versi berapa?Versi terbaru dan stabil dari bahasa pemograman PHP saat ini adalah versi 8.0.
|