What is PHP?
PHP is a programming language. Many websites, including WordPress, run on it. Like apps on a phone, PHP has versions, such as 8.1 or 8.2. Some scripts only work with certain versions.
Method 1: Use the command line
The command line is a text screen where you type commands. You reach it on a VPS through SSH.
- Log in to your server over SSH.
- Type this and press Enter:
This prints the PHP version used on the command line.php -v - To see the list of loaded add-ons, called modules, type:
php -m - To see where the main settings file is, type:
That file is usually namedphp --iniphp.ini.
Method 2: Use a test page
This shows the version your website really uses. The website version can differ from the command line version.
- Open your file manager or connect with FTP. FTP is a way of moving files to a server.
- Go to the folder of your website, often named
public_html. - Create a new file called
info.php. - Put this single line in it:
<?php phpinfo(); - Save the file.
- Open
yourdomain.com/info.phpin your browser, with your own domain name. - Read the top of the page for the PHP version. Scroll down to see settings such as
memory_limitandupload_max_filesize. - Delete the
info.phpfile when you are done.
Tip: Always delete
info.php afterwards. The page shows private details about your server that strangers could use.Method 3: Check in your control panel
Many control panels have a page to pick the PHP version for a site. Look for a menu with a name like PHP version or MultiPHP. If you cannot find it, ask Hostvento support.
Why this matters
- Old PHP versions stop getting security fixes.
- New plugins may need a newer version.
- A wrong version can cause errors on your site.
Take a backup before you change the PHP version of a live site.
Quick recap
php -vshows the command line PHP version.- A page with
phpinfo();shows the website version and settings. - Delete the test page afterwards.
- Back up before changing versions.