Knowledge Base

PHP Web Hosting on cPanel


cPanel is a web hosting platform for static or dynamic pages mainly written in PHP with a local MySQL database.  The pages and database on a site are managed by account local to the cPanel server which are NOT linked to university accounts.

We have two servers

Server Site Name Usage <username> Personal / Development As requested Research Groups/Projects

On the the site username will be the same as your university username but the password will be local to the server. This is designed from small personal sites or development. The webhosts sever is designed to host larger research group or project sites and can only be requested by members of staff.

Default Quota
Storage 200MB 10GB
Monthly Bandwidth 10GB 1TB
Databases 1 2

The sites are provided free of charge but we reserve the right to charge for larger sites. A site name not ending in will also incur a charge.

You are responsible for keeping your site secure and to make sure it complies with the appropriate  UoR policies, legislation, and accessibility requirements see

Getting Started

Create a cPanel Account

    • Go to the portal on and put in a ticket to request a cPanel site. We are working on automating the to make it easier.
    • Once your account has been created you can log into the management portal and explore the options available

How to’s

Two Factor Authentication

Since the website can be managed via the management portal from anywhere it is a good idea to setup two factor authentication so that your password and the paired authenticator app from Microsoft or Google on you smart phone is required to gain access. For more information see

Transfer files to/from my account

You can transfer files using the following services;

On-line “File Manager”

A web based file manager

  1. Login into the management portal
  2. In the “Files” section, Click “File Manager”
  3. Select the directory to open and Click Go

For a detailed look at File Manager, see this Video Tutorial

Git Repository

You can manage files on your account using git repositories which can be local or clones from a remote repository such as

  1. Login into the management portal
  2. Follow this Video Tutorial

You can deploy files from your git repository either automatically (push)  or manually (pull/deploy)

Secure your Website

SSL Certificates

To make the communication between a browser and your site over https secure you need a valid SSL certificate. Sites on can get a certificate from Letsencrypt using the FleetSSL plugin. Generally you will only need a certificate for the primary domain.

Sites on  use the AutoSSL system to create certificates signed by


You can use Header Directives in a .htaccess file to make you web site more secure. For a standalone website we would recommend the .htaccess file in your public_html directory should contain the following directives

Header add Strict-Transport-Security "max-age=15768000"
Header edit Set-Cookie ^(.*)$ "$1;HttpOnly;Secure;SameSite=Strict"
Header set Content-Security-Policy "default-src 'self';"
Header always append X-Frame-Options DENY
Header set X-XSS-Protection "1: mode=block"
Header set X-Content-Type-Options nosniff
Header set Referrer-Policy: no-referrer-when-downgrade
Header set Cache-Control "max-age=84600, public"
Header set Permissions-Policy: geolocation=(self)

For more information on headers see

Setup/Manage a MySQL Database

Setup via MySQL Wizard

  1. Login into the management portal
  2. Follow this Video Tutorial

Setup/Manage Manually

  1. Login into the management portal
  2. Follow this Video Tutorial

Create a Subdomain

You may want to create a subdomain if you wish to put a project into a separate area. I.e

  1. Login into the management portal
  2. Follow this Video Tutorial

Password Protect Directories

Learn how to limit access to a certain part of your site by requiring a user name and password to access a folder or folders from the web.

  1. Login into the management portal
  2. Follow this Video Tutorial

Take a Backup

Download (to your computer) a zipped copy of either your entire site (your home directory, databases) or one of the previously mentioned parts of your site.

  1. Login into the management portal
  2. Follow this Video Tutorial

Install WordPress

  1. Login into the management portal
  2. In the “Software / Services” section, Click “Site Software
  3. In the “Blogs” section, Click “WordPress” button
  4. Follow the on-screen instructions

Send Email from a PHP script

A lot of code out there uses the php mail() function to send mail. You will see code like

$to = '';
$subject = 'Subject';
$message = 'This is a test';
mail($to, $subject, $message);

This will work but by default the mail server on the cpanel site sends email from and if you do not specify a FROM address people will not be able to reply to you.

Using Native PHP Mail Function

$to = '';
$subject = 'Subject';
$message = 'This is a test';
$headers = 'From:' . "\r\n" .
'Reply-To:' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);


Suggest Content…

Related articles

WordPress websites for research groups and projects