Archives

How to create phpinfo pages

Do you want to know PHP/Apache information? The easiest way is to use the phpinfo() function.

1. Log in to your control panel (cPanel, DirectAdmin, CWP etc)

2. Go to the File Manager and create a new file – phpinfo.php – in your public directory (where your site’s files are)

3. Edit this file and put the text:

<?php
phpinfo();
?>

4. Access the newly created file – https://yourdomain.com/phpinfo.php

phpinfo() output

If you are an admin you can easily create such a file for the specific user:
1. navigate to the specific directory:

cd /home/username/public_html/

2. create a phpinfo file, edit it with the vi/nano editor and add the above PHP code:

touch phpinfo.php
nano phpinfo.php

3. modify phpinfo.php file permissions:

chmod 644 phpinfo.php
chown <username>:<username> phpinfo.php

4. access the file phpinfo.php in your web browser or send the link to the client.


Notice that on some servers the phpinfo() function is disabled. In this case, you may need to use other functions like ini_get(). A simple PHP file to get the most common PHP values is here https://github.com/plothost/php-list-values

Resources:
phpinfo() help

Share this post:

PHP 7.4 on cPanel servers

13 January 2020 – As of writing this article, cPanel doesn’t support PHP 7.4 yet. According to the feature request, the PHP 7.4 version will be added in Q1 of 2020.

We’re currently working towards Q1 of 2020.

PHP 7.4 feature request

PHP 7.4 is already at the first minor release 7.4.1. PHP 7.4. was released on 28 Nov 2019 and comes with some new features, such as:

Typed Properties
Arrow Functions
Limited Return Type Covariance and Argument Type Contravariance
Unpacking Inside Arrays
Numeric Literal Separator
Weak References
Allow Exceptions from __toString()
Opcache Preloading
Several Deprecations
Extensions Removed from the Core

PHP 7.4 new features

We will support the new version as soon as it is added by cPanel. From our internal tests, we don’t expect any issues. PHP 7.4 will become our servers’ default PHP version.
WordPress, the most used script, is already supporting PHP 7.4.

Resources:
PHP 7.4 Release Info
Guide PHP 7.3.x to PHP 7.4.x

Share this post:

Set up an Apache+PHP+MySQL local environment

You want to have a local Apache web server to test your new site? We’ll show you how to setup a web server and an MySQL server using XAMPP. XAMPP is a software that will install Apache+PHP+MySQL on your computer. Of course, you can download Apache, PHP and MySQL and install them by yourself, but using a suite like XAMPP will make the things much easier.

This tutorial is for XAMPP on Windows OS. XAMPP is also available for Linux and Max OS.

So, the steps to install the Apache+MariaDB(MySQL) development environment are:

1.Download XAMPP from https://www.apachefriends.org/index.html (the Windows Installer is about 110MB)

XAMPP Site

2. Install XAMPP. During the installation, choose the components you want to install.

XAMPP Installer Components

3. Start XAMPP Control Panel. 

4. Start the modules you want to run – in our case Apache(which includes PHP) and MySQL.

XAMPP Control Panel

You can now access the web server on your web browser at http://localhost/. The root folder of the web server is c:\xampp\htdocs\ In this folder you will put your site’s files.

To manage the database server go to http://localhost/phpmyadmin/. phpMyAdmin is a graphical tool that allow you perform various database operations.

And the video tutorial:

Resources: https://www.apachefriends.org/index.html

Share this post:

How to check server information in cPanel

Ever wanted to check your web hosting account details? Like Apache Web Server, MYSQL, PHP versions? cPanel allow you to examine these details. The steps are:

  1. Log into your cPanel account (you can find the cPanel username and password in the Welcome email you received from your host)
  2. On the right side of the cPanel click the Server Information link
  3. A new page will load where you can see a lot of details about your web hosting account, like: Apache, PHP, MySQL, PERL, cPanel versions; server load, status of the server services.
cPanel Server Information
cPanel Server Information

An example of some server details for your web hosting account that you can see in cPanel:

Item Detail
Hosting Package default
Server Name w08
cPanel Version 62.0 (build 17)
Apache Version 2.4.25
PHP Version 7.0.17
MySQL Version 10.1.22-MariaDB
Architecture x86_64
Operating System linux
Shared IP Address 162.255.100.100
Path to Sendmail /usr/sbin/sendmail
Path to Perl /usr/bin/perl
Perl Version 5.16.3
Kernel Version 2.6.32-042stab117.14

Check out the video we made to show you how easy is to check the server information in cPanel:

All our shared and reseller plans comes with cPanel. cPanel is a tool that allows you to manage many aspects of your web hosting account.
Share this post:

How to change the PHP version of your domain in cPanel

It’s always a good idea to use the latest version of PHP. For some time 2-3 PHP versions will be supported, but in the end the old ones will be discontinued. So, whenever possible, use the latest version.
We will show below how to change the PHP version for your site from cPanel.

cPanel MultiPHP Manager Interface
cPanel MultiPHP Manager Interface

The steps are:

  1. Log into your cPanel account.
  2. Go to MultiPHP Manager under the Software Section
  3. Select the domain for which you want to change the PHP version.
  4. From the right drop down list select the desired PHP version. If you choose the inherit option the site will use the default PHP version which is listed at the top of the page.
  5. Click the Apply button. The site is using now the PHP version you selected.
Some hosts may block this cPanel feature for end users. If you don’t see this feature in cPanel contact your host.

Please check now the video tutorial. You will also see how to check your current PHP version.

For more details of the PHP function used this tutorial check PHP: phpversion – Manual
Share this post:
Page 1 of 2
1 2