6 ways to check which version of PHP you are running
The quickest way to check your version of PHP
To check your version of PHP, simply run the php -v
command, no matter if you are running macOS, Linux, or Windows.
6 ways to check your version of PHP
Using phpversion()
To check which version of PHP you are running, you use the phpversion()
function. It returns a single string containing the precious information.
<?php echo phpversion(); ?>
Using phpinfo()
To check which version of PHP you are running, use the phpinfo()
function. It will show you a web page containing every bit of information you might need about your installation of PHP.
<?php phpinfo(); ?>
Using the terminal on macOS, Linux and WSL
To check which version of PHP you are running using your terminal on macOS or Linux, use the php -v
command. It’s simple and straightforward, the version of PHP is the first thing in the output.
php -v
Using the command prompt on Windows
To check which version of PHP you are running using your Windows command prompt, use the php -v
command. It’s as simple and straightforward as in the previous section.
php -v
Using Laravel’s welcome page
To check which version of PHP you are running using Laravel’s welcome page, just look at the bottom right corner. It’s that simple.
Using Laravel Artisan
To check which version of PHP you are running using Laravel, use the php artisan about
command. It will show you the version of PHP, including various information about your setup.
php artisan about