John Davidson

Switch to php 8 Wordpress

0 comments
Message:


I have installed php 8.0.15 on my Debian 10 (GCP vm)


php -v


PHP 8.0.15 (cli) (built: Jan 29 2022 07:37:39) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.15, Copyright (c) Zend Technologies
with Zend OPcache v8.0.15, Copyright (c), by Zend Technologies

But my wordpress site still on php 7.4
I used a2dismod, a2enmod, apache2 restart - its doesnt help.
What could be the problem? Thanks



My Answer:
The issue may be that the PHP version being used by Apache is still set to PHP 7.4. You can try the following steps to switch your WordPress site to PHP 8:

1. Update the PHP version for Apache:
- Disable the PHP 7.4 module for Apache: `sudo a2dismod php7.4`
- Enable the PHP 8 module for Apache: `sudo a2enmod php8.0`
- Restart Apache: `sudo systemctl restart apache2`

2. Update the PHP version for the command line:
- Update the PHP version for the command line: `sudo update-alternatives --set php /usr/bin/php8.0`

3. Verify the PHP version:
- Check the PHP version for Apache: `php -v`
- Check the PHP version for the command line: `php -v`

After following these steps, your WordPress site should now be running on PHP 8.0.15. If you encounter any issues, make sure to check your Apache configuration and PHP settings to ensure everything is correctly set up for PHP 8.

Rate this post

4 of 5 based on 7982 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us