Tag Archive PHP version

How to check PHP version and configuration

How to check PHP version and configuration

There are two ways to check PHP version set for the account. By default, we have PHP 5.6 set on our shared servers.
To check what PHP version is selected for your account go to cPanel Software section > Select PHP version menu:

How to check PHP version and configuration
You will see the current PHP version above PHP extensions:

How to check PHP version and configurationAnother way to check PHP version is PHPinfo() function, commonly used to check the current state of PHP configuration. It can also be used for debugging purposes as it contains all EGPCS (Environment, GET, POST, Cookie, Server) data.

for cPanel Basic theme:

1. Log into your cPanel account, go to Files section > File Manager menu:

How to check PHP version and configuration

2. Navigate to public_html directory, click on New File and create a phpinfo.php file:

How to check PHP version and configuration

How to check PHP version and configuration

3. Find the newly created file in the list and click on Code Editor:

How to check PHP version and configuration

4. Add the lines of the code provided below to the file and click on Save Changes:

<?php
phpinfo();
?>

How to check PHP version and configuration

5. To see the detailed information about PHP configuration of your account, open http://yourdomain.com/phpinfo.php link in your browser, replacing yourdomain.com with your main domain name.

NOTE: For security reasons, do not forget to delete the file once you check all the necessary information.

for cPanel Retro theme:

1. Log into your cPanel account, go to the section Files File Manager menu:

How to check PHP version and configuration

2. Navigate to the public_html directory, click on New File and create a phpinfo.php file:

How to check PHP version and configuration

3.Find the newly created file in the list and click on Code Editor:

How to check PHP version and configuration

4. Add the lines of the code provided below to the file and click on Save Changes:


<?php
phpinfo();
?> 

How to check PHP version and configuration

5. To see the detailed information about PHP configuration of your account, open http://yourdomain.com/phpinfo.php link in your browser, replacing yourdomain.com with your main domain name.

NOTE: 
For security reasons, do not forget to delete the file once you check all the necessary information.

That’s it!

How to edit php.ini on Shared servers

How to edit php.ini on Shared servers

This guide describes how to edit the php.ini file on shared servers (Stellar and Stellar Plus plans, as well as old Value, Professional, and Ultimate plans).

If your account is hosted on the Business server (Stellar Business or old Business SSD plans), use this guide.
With the help of PHP Selector implemented on our Shared Hosting servers, you can easily modify basic PHP settings via your cPanel >> the Software section >> Select PHP Version menu. You can find detailed guidelines here.

 

However, advanced PHP settings are missing from the Select PHP Version tool and must be manually configured in the php.ini file. You can either create the file or upload the existing one to your account.

How to create a php.ini file

How to upload and edit an existing php.ini file

How to create a php.ini file

1. Log into your cPanel account, go to the Files section >> the File Manager menu.

For cPanel Basic Theme:

 

How to edit php.ini on Shared servers

For cPanel Retro Theme:

How to edit php.ini on Shared servers

2. Navigate to the root directory of the domain, click on New File, and create a file named php.ini:

How to edit php.ini on Shared servers

3. Find the newly created file in the list, right-click, and choose Edit:

How to edit php.ini on Shared servers

4. Add the required PHP settings and click on Save Changes in the top right corner:

How to edit php.ini on Shared servers

When all updates are completed, make sure to add lsapi_phpini directive.
To check the current PHP version and configuration, refer to this article.If you wish to change values for the PHP settings (e.g., max_execution_timememory_limitpost_max_sizeupload_max_filesize, etc.), you must reset the values in the Select PHP version menu. This way, it will be possible to overwrite PHP settings using php.ini.1. Log into your cPanel account, go to Software section >> Select PHP version menu.For cPanel Basic Theme:

How to edit php.ini on Shared servers

For cPanel Retro Theme:

How to edit php.ini on Shared servers

2. Go to the Switch to PHP Options menu:

3. Reset the option in question:

4. You may then apply changes to the required value in the php.ini file:

How to upload and edit an existing php.ini file

1. Log into your cPanel account, go to the Files section >> the File Manager menu.

For cPanel Basic Theme:

For cPanel Retro Theme:

2. Navigate to the root directory of the domain name in question, upload the php.ini file that corresponds to your current PHP version. Feel free to download php.ini for different PHP versions below in the Attachments section at the end of the guide.

3. Once done, use the Extract option:

4. After that, right-click on php.ini.txt to Rename it php.ini, then another right-click to use the Edit option:

5. Here, you can use the search option and find the needed limit or value. In this example, it is upload_max_filesize.

 

6. Once all the required changes are made, click Save.

In order for the php.ini to work, add lsapi_phpini directive.

That’s it!