Question

Upgrading to PHP 8.0 ?

Posted June 22, 2021 709 views
PHP

Hi,

Is it a good idea to upgrade my live website to PHP 8.0?

Also, 8.0.7 is the latest stable release. How can I check which version of php I’m actually using?

Thanks

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Hello, @Chris0303

It is considered a good practice to use the newest available (stable) version. You can also make sure that your code is compatible with the newer version in order to prevent any issues.

You can check which is the current version via ssh or by creating a phpinfo file and load it to your browser.

You can ssh to your droplet and run the following command:

  • php -v

This will list the installed system version. However, you might have multiple PHP versions installed on your droplet. You can also create a phpinfo.php file in your public directory and then add the following content to the file:

  • <?php
  • phpinfo();
  • ?>

You can then access the file in the browser, e.g - yourdomain.com/phpinfo.php or whatever you named the file.

You can check the following question on how to upgrade the PHP version -

https://www.digitalocean.com/community/questions/how-to-upgrate-php-7-4-3-to-php-8-on-wordpress

Hope that this helps!
Regards,
Alex