PHP information
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:
- Log in to your cPanel account
- 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?
- Open any simple text editor, like notepad.
- Copy and paste the following one line code:
<?php phpinfo() ?>
- Save the file as phpinfo.php
- Upload the file to the desired directory using an FTP client or File manager software
cPanel: Under public_html folder
Plesk: Under httpdocs folder - 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.