PHP information

Updated 10 months ago by Theo Chu

How is PHP compiled in the server?

The main reason the server compiles PHP is to put human-readable code (C, PHP, Java etc.), into machine-readable code. When you execute your PHP scripts, they are interpreted (almost inline compilation), which means they are read line by line, and the code is executed accordingly.

Compiled code, means that it is compiled at the source. Therefore, it is already in machine language, and as a result, the server does not have to interpret the code each time. This makes it quicker.

What is the version of PHP on your servers?

Follow these steps to check what version of PHP your server is using:

  1. Log in to your cPanel account 
  2. Go to Database > phpMyAdmin

You should see what version of PHP you currently have on the right side of the interface under Database Server.

What are the PHP configuration or variable sets for your server?

You can use the function phpinfo() to find out the PHP details.

The phpinfo file outputs a large number of information about the current state of PHP. This includes information about PHP compilation options and extensions, the PHP version, server information and environment (if compiled as a module), OS version information, paths, and master and local values of configuration options. 

Because every system/server is set up differently, phpinfo() is commonly used to check configuration settings for available predefined variables on a given system/server.

How do you create a phpinfo() file?

  1. Open any simple text editor, like notepad.
  2. Copy and paste the following one line code: <?php phpinfo() ?>
  3. Save the file as phpinfo.php
  4. Upload the file to the desired directory using an FTP client or File manager software
    cPanel: Under public_html folder
    Plesk: Under httpdocs folder 
  5. Access the file with your browser to the location of the site where you uploaded your phpinfo.php file (ex. http://domain.com/phpinfo.php)

For more information on the phpinfo() function, check out the PHP manual.

Having trouble? Contact us and our team will be happy to help.


How did we do?


Powered by HelpDocs