Publié le - 969 visites -

What php version is my website?

When setting up web application or building a website, it can be handy to know what version of PHP I have. Here, below, different methods to find out.

To know my PHP version via the command line

The command line will be of great help under Linux, I can very simply know my version of PHP via the execution of a PHP command with the option "-v" as follows: php -v

To know my PHP version via Debian packages

Debian is a free operating system for a computer. An operating system is the set of basic programs and utilities that allow a computer to run. Debian is more than just an operating system: it contains more than 43,000 packages. Packages are precompiled software components designed to be easily installed on your machine.
I can find out via my command-line package (apt-get as part of Debian), as follows: apt-cache policy php5
I get the version of PHP installed but also the version present in the repositories to know if an update is to be done.

To know my version via the file Phpinfo

I can also find out via Phpinfo which is a PHP function that I can put in a file at the root of my web server for example. To know my version of PHP, I create a new script named phpinfo.php, I open it with a text editor and I write phpinfo () inside. I write it on 3 lines with the PHP opening and closing tags. I do not forget to give read and execute rights to the www-data user. Then I access this script via my browser by typing its URL.

I ask for help to a php programmer

A php developer can retrieve the version number of PHP installed on the server in a variable, for example to perform special processing for certain versions, to ensure backward compatibility, using the native phpversion () function. He can also create my website in PHP.

Les publications similaires de "Learn about the web design"

  1. 24 Mai 2022Why PHP Website Developers are Important for Companies63 visites
  2. 22 Fév. 2022What is a PHP Solution? A guide to understanding and using PHP solutions.122 visites
  3. 6 Fév. 2022Bitcoin Mining: The Popularity of Cryptocurrency and its Rewards125 visites
  4. 16 Janv. 2022What Every Company Will Eventually Need: PHP Programming Services142 visites
  5. 17 Déc. 2021What Qualifications Do You Need for Beginner PHP Website Developers?169 visites