Cara menggunakan check php version linux

Untuk memastikan versi php yang digunakan cukup mudah, yaitu dengan membuat file berisi script phpinfo. Berikut isi file phpinfo :

<?php 
phpinfo(); 
?>

Pada artikel ini kami akan memberikan informasi dan tutorial cara cek versi php, simak penjelasan dibawah ini.

Cara cek versi PHP di cPanel

Cara cek versi PHP yang aktif melalui cPanel terdapat dua cara yaitu melalui menu “Select PHP Version” ataupun melalui menu “Multi PHP Manager”. Agar lebih jelas mari kita simak penjelasan dibawah ini:

  1. Login ke cPanel lalu pilih menu “Select PHP Version”
Cara menggunakan check php version linux
  1. Pada gambar diatas, Anda dapat mengetahui versi yang aktif adalah php versi 7.2. Namun pada cPanel, versi PHP dapat aktif di PHP Selector (Select PHP Version) ataupun di menu “Multi PHP Manager” untuk memastikan PHP yang di gunakan.
Cara menggunakan check php version linux
  1. Pada halaman MultiPHP Manager, terdapat nama domain dan status versi PHP. Jika pada status versi PHP terdapat tanda “inherited”, maka dapat dipastikan PHP aktif pada menu PHP Selector (Select PHP Verison)

Cara menggunakan check php version linux

  1. Tanda panah diatas menunjukan bahwa PHP yang digunakan sesuai versi yang ada di menu “PHP Selector”.

Untuk memastikannya, Anda bisa membuat file phpinfo pada public_html hosting Anda, lalu bisa mengakses file phpinfo yang Anda buat untuk melihat detailnya.

Cara Cek versi php di Plesk Panel

Untuk mengetahui versi php yang aktif pada plesk panel cukup mudah, Anda dapat mengetahui melalui menu “PHP Selector” seperti gambar dibawah ini.

Cara menggunakan check php version linux

Pada gambar dibawah, informasi php yang aktif adalah 7.2. Artinya, versi php yang digunakan pada hosting Anda adalah php 7.2.

Cara menggunakan check php version linux

Apabila Anda ingin melakukan perubahan versi php pada plesk, caranya klik php version seperti gambar diatas, lalu pilih versi php yang akan digunakan, dan klik tombol ‘set as current’.

Untuk memastikan versi php telah update atau belum, Anda bisa membuat file php info seperti yang telah kami sampaikan diatas.

Cara cek versi php melalui SSH

Jika Anda menggunakan VPS, salah satu cara cek versi php bisa dilakukan melalui akses SSH. Apabila Anda belum pernah menggunakan ssh, klik link berikut untuk panduannya” pelajari cara akses SSH

Setelah Anda terkoneksi dengan SSH, Anda bisa menggunakan perintah php –version untuk mendapatkan informasi php yang aktif di server. Berikut contohnya:

Cara menggunakan check php version linux

Perintah tersebut akan menampilkan informasi tentang versi PHP. Dalam contoh ini versi server PHP adalah 7.4.16.

Cara menggunakan check php version linux

Cara Cek versi php di Xampp Localhost

Yang terakhir adalah cara mengetahui versi PHP pada xampp localhost. Simak langkah langkah-langkah berikut:

  1. Buat file info.php menggunakan notepad, yang berisi script phpinfo.
<?php 
phpinfo(); 
?>
  1. Simpan script diatas dengan nama info.php difolder htdocs, kemudian pada “Save as Type” pilih All Files.
Cara menggunakan check php version linux
  1. Akses melalui browser dengan alamat localhost/info.php. Maka hasilnya akan seperti berikut:
Cara menggunakan check php version linux

Dalam journal ini, kami telah menunjukan beberapa opsi berbeda tentang cara melihat dan memeriksa versi PHP yang sedang dijalankan di server Anda. Selamat mencoba dan semoga bermanfaat.

So, let’s just get started by the login from Ubuntu 20.04 system. After login, try to open your Ubuntu 20.04 terminal console application from its application area using the search activity bar. Write “terminal” and tap Enter. An application named “terminal” will be shown. Click on it to open it. If you want to avoid this complex and long procedure, just use the “Ctrl+Alt+T” shortcut. Let’s get started with the newly launched terminal shell and the system update in it.

For the system update, we need to make use of the “apt” package in the command along with the “update” keyword. This command must be executed with the sudo rights to avoid any issue. Within a few minutes, all the updates will be installed and applied to your Linux system. The output is attached in the appended screenshot.

$ sudo apt update

Cara menggunakan check php version linux

Now, the system update has been done, we need to upgrade the system as well. For that, you must use the same “apt” package command with sudo rights to upgrade your system. Use the keyword “upgrade” to do so. Within a few minutes, your system will be upgraded as well. The output is attached in the appended screenshot.

$ sudo apt upgrade

Cara menggunakan check php version linux

Let’s start with the checking of the PHP installed version on our system using the simple and most used “version” command. For this, you have to use the word “PHP” with the flag “—version” and execute it as a single command by pressing the Enter key. On execution, we have got the below-shown output. The output is showing that the PHP has no version installed on our system and it is suggesting a command to install the newest version available for our system. So, it is clear that we must have some version of the PHP language already configured at our end. The output is attached in the appended screenshot.

$ php --version

Cara menggunakan check php version linux

We can also use the same version command with a shortcut. For this, we don’t need to use the “—version” full word flag. We can utilize the simple “-v” flag to do so as shown below.

$ php -v

Cara menggunakan check php version linux

So, before checking the installed version on our system with the command, we have to install it for sure. For installation, we require sudo rights to be used in the command. Within the query area, you have to use the “apt” package to install the “PHP” language. Also, if you don’t know any PHP version, just use the word “PHP” after the “install” keyword in the command beneath. It will start getting the necessary information regarding this installation. The output is attached in the appended screenshot.

$ sudo apt install php

Cara menggunakan check php version linux

It will show you a list in this command output that is going to be installed on our Ubuntu 20.04 system. This list contains many of the server packages, some utilities, and necessary libraries to make it usable on our Linux system.

Cara menggunakan check php version linux

After the above listing, the system will pause the installation process and let you know about the memory space it is going to be taken after the installation i.e., 25.9 MB. If you are willing to give such space to the PHP language on your system, then simply click “y” from the keyword and hit the key “Enter” to continue the installation process as we did beneath.

Cara menggunakan check php version linux

Right after your click on the Enter key, the system will start executing all the listed libraries, packages, and utilities on the Linux system. The below-shown progress will be shown and different links will be created to add PHP within the system.

Cara menggunakan check php version linux

Within no more than 10 minutes, the newest PHP version will be installed and successfully configured on our system. The complete output of the last processing lines is shown below.

Cara menggunakan check php version linux

After the PHP installation, we will take a look at its installed version through the version command with i.e., “-v” flag as below. You will see that it will display an installed version of PHP within your system i.e., 7.4.3. You will also get other information regarding the installation date and time, and the owner of PHP. The output is attached in the appended screenshot.

$ php -v

Cara menggunakan check php version linux

The same thing can be achieved by the “—version” flag in the “PHP” command as beneath. The output is attached in the appended screenshot.

$ php --version

Cara menggunakan check php version linux

These were the simplest and most used commands to get to know about the PHP version in the Ubuntu 20.04 CLI. There are other commands too. For example, we can also use the keyword “PHP” with the flag “-i” to get the PHP version and other information regarding it. After running it, the “phpinfo()” function got executed and displayed the version of PHP along with extra info. The output is attached in the appended screenshot.

$ php -i

Cara menggunakan check php version linux

You can also check out all the other utilities of PHP installed within your system along with it using the “dpkg” list command with the “—list” flag. You have to use the “grep” keyword with the “PHP” keyword. The output is attached in the appended screenshot.

$ dpkg –list | grep php

Cara menggunakan check php version linux

Conclusion

To sum up, this was all about the checking of the PHP installed version on our Ubuntu 20.04 system. To achieve this, you need to have a mounted version of PHP on your system. If not, you have to go through the above article from start to end and you will understand everything. The details provided in this article were all quite simple and we must say will be easy to do.

Langkah cek versi PHP?

Caranya ketik domainanda.com/phpinfo. php. Anda akan melihat versi PHP yang digunakan pada website.

PHP sekarang versi berapa?

Versi terbaru dan stabil dari bahasa pemograman PHP saat ini adalah versi 8.0.

Cara Melihat xampp versi berapa?

Cara cek versi PHP di Xampp.
Simpan (save as) dengan nama (versi.php) di direktori htdocs (Xampp). Biasanya secara default direktori ada di C:\xampp\htdocs. ... .
Buka browser..
Ketik : localhost/versi.php..
Jika sesuai, informasi versi Php akan muncul seperti dibawah ini..