To check which PHP version your WordPress site is using on a YunoHost server, you can follow these steps:
- Check via WordPress Dashboard:
If you have access to your WordPress admin dashboard:
Go to Tools > Site Health.
Click on the Info tab.
Scroll down to the Server section, where you will see the PHP version currently in use.
- Check via Command Line on YunoHost:
If you have SSH access to your YunoHost server, you can check the PHP version directly by running a command.
SSH into your YunoHost server.
Run the following command to find the PHP version in use:
php -v
This will show the system’s default PHP version.
To check the PHP version specifically used by your WordPress site (in case different PHP versions are installed), navigate to the directory where your WordPress site is hosted (usually /var/www/your_wordpress_site) and create a phpinfo.php file:
Navigate to your WordPress directory:
cd /var/www/your_wordpress_site
Create the phpinfo.php file:
sudo nano phpinfo.php
Add the following content to the file:
php
<?php
phpinfo();
?>
Save and close the file (Ctrl + O, then Ctrl + X).
Open your browser and visit the page:
http://yourdomain.com/phpinfo.php
Look for the PHP version displayed at the top of the page.
After confirming the PHP version, make sure to delete the phpinfo.php file for security reasons:
sudo rm phpinfo.php
These methods will help you determine which PHP version your WordPress site is using on your YunoHost server.