Category Archive Knowledgebase

ByJUJU-dev

How to – PHP Loaders

How to – PHP Loaders


What are PHP Loaders and what is their role?

As you may know, PHP files are plain text files that are not encrypted in any way, which basically means that if someone gains access to a PHP-based application or website, all the inner code structure will be available for modification. To prevent this, encoders were specifically designed to transform the human-readable code into unreadable sophisticated bytecode protected from unwanted interference and changes.

At the same time, PHP Loaders were designed to perform decryption of such secured files directly on the server, performing additional optimization during the deployment process. In simple words, PHP Loader is a PHP extension responsible for reading and executing PHP files encoded with a corresponding encoding product. A simplified presentation of the working principle of such products can be found below:

Currently, we provide three most popular PHP Loaders to decrypt protected applications on our shared servers: IonCube LoaderZend Guard Loader and Source Guardian.

NOTE: Depending on the encoder used to encrypt the files, a corresponding PHP Loader should be chosen in order to run applications smoothly on our servers and prevent any incompatibility issues during the deployment process.

How can I enable PHP loaders:

for cPanel Basic theme
for cPanel Retro theme


for cPanel Basic theme:

If you have a Regular Shared Hosting account with us, follow the steps below:

1. Log into the cPanel.
2. Go to the Software section >> select the PHP Version menu:

3. Enable the required loaders and Save the changes:

If you have a Business Shared Hosting account, you will need to do the following:

1. Log into the cPanel.
2. Click on the PHP Tweaks menu in the Exclusive for Namecheap Customers section:

3. Choose the domain to perform changes for in the Select domain drop-down menu and enable the required PHP Loader in Loaders:

for cPanel Retro theme:

If you have a Regular Shared Hosting account with us, follow the steps below:

1. Log into cPanel.
2. Go to the Software/Services section >> select the PHP Version menu:

3. Enable the required loaders and Save the changes:

If you have a Business Shared Hosting account, you will need to do the following:

1. Log into the cPanel.
2. Click on the PHP Tweaks menu in the Exclusive for Namecheap Customers section:

3. Choose the domain to perform changes for in the Select domain section and select the required PHP Loader in Loaders:

That’s it!

ByJUJU-dev

How to change PHP version on Business servers

How to change PHP version on Business servers

This guide will show you how yo manage PHP settings on our Business servers (Stellar Business and old Business SSD plans).

Our Business servers are running with FCGI module and have PHP 5.2 – 5.6 and 7.0 – 7.3 versions available. To change the PHP version for your account or a separate addon domain, follow these steps:

 

How to manage PHP settings using the PHP Tweaks plugin

 

 

For cPanel Basic Theme:

 

1. Log into your cPanel.

2. Go to the Exclusive for Namecheap Customers section >> the PHP Tweaks menu:

3. You can select the domain from the corresponding drop-down menu and manage the following group of settings:

The PHP version section allows you to check the version which is currently used and set the required one.

NOTE: The list of the available modules varies depending on the PHP version you select.

The Loaders and Caches sections allow you to choose the PHP loader for your scripts and the PHP accelerator for caching the compiled bytecode of your PHP scripts.

The Others section provides you with the list of additional modules and extensions which can be enabled according to your needs:

NOTE: There are the following modules conflicts:
  • nd_mysql conflicts with mysql;
  • nd_mysqli conflicts with mysqli;
  • nd_pdo_mysql conflicts with pdo_mysql;
  • gmagick conflicts with imagick.

4. Should you need to reset PHP configuration you currently have, select the domain name and hit Reset Extensions. That will revert all the changes and roll your PHP settings for the domain in question back to the default state:

 

For cPanel Retro Theme:

 

1. Log into your cPanel.
2. Go to the Exclusive for Namecheap Customers section >> the PHP Tweaks menu:

3. You can select the domain from the corresponding drop-down menu and manage the following group of settings:

The PHP version section allows you to check the version which is currently used and set the required one.

NOTE: The list of the available modules varies depending on the PHP version you select.

The Loaders and Caches sections allow you to choose the PHP loader for your scripts and PHP accelerator for caching the compiled bytecode of your PHP scripts.

The Others section provides you with the list of additional modules and extensions which can be enabled according to your needs:

NOTE: There are the following modules conflicts:

  • nd_mysql conflicts with mysql;
  • nd_mysqli conflicts with mysqli;
  • nd_pdo_mysql conflicts with pdo_mysql;
  • gmagick conflicts with imagick.

4. Should you need to reset PHP configuration you currently have, select the domain name and hit Reset Extensions. That will revert all the changes and roll your PHP settings for the domain in question back to the default state:

How to increase memory_limit

Note that memory_limit cannot be increased via the PHP Tweaks menu. In order to change its value, follow the steps below:

1. Log into your cPanel account and navigate to the Files section >> the File manager menu:
For cPanel Basic Theme:

For cPanel Retro Theme:

Navigate to the /home/cPanel_user directory:

Make sure that you enabled the Show Hidden Files (dotfiles) option in the Settings menu:

2. Navigate to the following directory /home/cPanel_user/.system-php/conf:

3. There you will see the list of the domains hosted in your cPanel account. Move further and enter the folder of the domain you need to increase memory_limit for. By default, there is a single file called php_ver:

This file defines the PHP version set for the domain:

NOTE: If you change the value specified in the php_ver file, your current PHP version will be changed accordingly, the changes will be reflected in the PHP Tweaks menu as well.

4. Now you need to create a new file called memory_limit:

5. Once done, right-click on the file >> the Edit option:

6. Simply specify the desired value (for example, 128M) and hit Save:

How to work with a php.ini file

Apart from the PHP Tweaks plugin, you may need to alter some of the settings using a php.ini file. One of the most common requests is to increase post_max_size and upload_max_filesize limits which can be done with the help of a php.ini file. Before proceeding, download php.ini for the required PHP version here.

1. Log into your cPanel account and navigate to the Files section >> File manager menu:
For cPanel Basic Theme:

For cPanel Retro Theme:

Make sure that you enabled the Show Hidden Files (dotfiles) option in the Settings menu:

2. Navigate to the following directory /home/cPanel_user/.system-php/ini:

3. Here you need to select the PHP version you have set for your domain and the domain name itself. Thus, the full destination path will look like /home/cPanel_user/.system-php/ini/5.6/nctests.info:

4. Now you need to upload the php.ini file that corresponds to your current PHP version. 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 proceed with the Edit option:

5. Here you can use Ctrl+F key match for your convenience – it will allow you to find the needed limit or value. In our case, it is upload_max_filesize:

6. Once all the required changes are performed, hit Save.

That’s it!

ByJUJU-dev

Telnet Definition

Telnet

What is Telnet?
Telnet is a user command and an underlying TCP/IP protocol for accessing remote computers. Through Telnet, an administrator or another user can access someone else’s computer remotely. On the Web, HTTP and FTP protocols allow you to request specific files from remote computers, but not to actually be logged on as a user of that computer. With Telnet, you log on as a regular user with whatever privileges you may have been granted to the specific application and data on that computer.

A Telnet command request looks like this (the computer name is made-up):

telnet the.libraryat.whatis.edu

The result of this request would be an invitation to log on with a userid and a prompt for a password. If accepted, you would be logged on like any user who used this computer every day.

Telnet is most likely to be used by program developers and anyone who has a need to use specific applications or data located at a particular host computer.

ByJUJU-dev

How to get an SSH client

How to get an SSH client

How to get an SSH client
To access your account via SSH, you should download and install one of available SSH clients. You can find the list of free SSH clients in the table below. If you have Windows, we recommend to use PuTTY as your SSH client.

SSH Client Operating Systems Supported Download
PuTTY Windows and Unix
WinSCP Windows (SCP and SFTP, no SSH)
Fugu Macintosh

 

ByJUJU-dev

How to connect via SSH using keys

How to connect via SSH using keys

Your SSH session can be authenticated either with the username and password or with a pair of private/public keys. It is recommended to use the latter, as it is considered to be a more secure and convenient solution:

For cPanel Basic Theme

For cPanel Retro Theme

 

For cPanel Basic Theme:

1. Manage SSH Keys

2. Create a new pair of SSH keys

3. Import of the existing keys

4. Use Putty and SSH key pair to connect

 

1. Manage SSH Keys

In cPanel you can manage SSH keys in the SSH access menu.

Click on Manage SSH keys:

On the next page, you can either import the existing pair of keys or generate a new one.

2. Create a new pair of SSH keys

2.1. Public and private keys generation

In order to generate a new SSH key pair click on the Generate a new Key option:

On the generator page, specify the password (passphrase), Key Name, Key Type and Size.
The maximum allowed DSA key size is 1024 which is not enough to guarantee its security nowadays. That’s why we suggest using only RSA with 2048 bits:

Once everything is set, click Generate Key.

Now you should see both private and public keys you created.

2.2. Public key authorization

In order to authorize SSH access to your hosting account by the private key you created, click on the Manage option:

On the next page, click on the Authorize button:

2.3. Acquiring a key pair

You can view and download keys you have in cPanel by clicking on the View/Download button in the Private Keys section:

Click on Download Key (it will be saved in a simple text document on your side) or just copy/paste the provided key if needed. You can also convert your key into PuTTY’s ppk format using the Convert option:

3. Import of the existing keys

If you already have a key pair generated by other means, you can import the public key using the Import Keyoption:

Next, fill in the required details:

  • Choose a name for this key (defaults to id_dsa): type in id_rsa;
  • Paste the Private Key in this box: leave it empty (this field is only used in cases, where you want to have SSH access from your cPanel account to other servers via the keys);
  • Passphrase: input the passphrase;
  • Paste the public key into the following text box: on your local computer open your public key file (e.g./User/name/.ssh/id_rsa.pub) > copy and paste the content of that file into the field;
  • Click Import

Once done, do not forget to authorize your imported public key in the same way as in step 2.2.

4. Use Putty and SSH key pair to connect

In this example, we will use the Putty SSH client and key pair generated by cPanel in order to access the server via SSH:

4.1. Download the Private key as it is shown in step 2.3.

4.2. In the PuTTy folder, run puttygen.exe; in the top menu select the File tab and click on Load private keyand select your private key file (make sure All files (*.*) filter is used so you can see your downloaded private key file):

You will be asked for the passphrase you specified during the key generation in step 2.1. After entering it you should receive a successful import message:

In case you do not wish to set a passphrase for the key, you can empty the Key passphrase and Confirm passphrase fields.
Now click on Save private key and save your key as a .ppk file which will be needed later:

4.3. Run the PuTTy client (putty.exe), select Connection > SSH > Auth and in the Authentication parameterssection, click on Browse to select the saved .ppk file:

Once done, get back to the Session section and input the server name (IP address) and specify SSH port (it should be 21098 for all shared servers accounts) and click Open:

In the console window, you will be asked for the login and passphrase:

For cPanel Retro Theme:

1. Manage SSH Keys

2. Create a new pair of SSH keys

3. Import of the existing keys

4. Use Putty and SSH key pair to connect

 

1. Manage SSH Keys

 

In cPanel you can manage SSH keys in the SSH access menu:

Click on Manage SSH keys

On the next page, you can either import the existing pair of keys or generate a new one.

2. Create a new pair of SSH keys

2.1. Public and private keys generation

In order to generate a new SSH key pair click on the Generate a New Key option:

On the generator page, specify the password (passphrase), Key Name, Key Type and Size.
The maximum allowed DSA key size is 1024 which is not enough to guarantee its security nowadays. That’s why we suggest using only RSA with 2048 bits:

Once everything is set, click Generate Key.

Now you should see both private and public keys you created.

2.2. Public key authorization

In order to authorize SSH access to your hosting account by the private key you created, click on the Manage option:

On the next page, click on the Authorize button:

2.3. Acquiring a key pair

You can view and download keys you have in cPanel by clicking on the View/Download button in the Private Keys section:

Click on Download Key (it will be saved in a simple text document on your side) or just copy/paste the provided key if needed. You can also convert your key into PuTTY’s ppk format using the Convert option:

3. Import of the existing keys

If you already have a key pair generated by other means, you can import them using the Import Key option:

Next, fill in the required details:

  • Choose a name for this key (defaults to id_dsa): type in id_rsa;
  • Paste the Private Key in this box: leave it empty (this field is only used in cases, where you want to have SSH access from your cPanel account to other servers via the keys);
  • Passphrase: input the passphrase;
  • Paste the public key into the following text box: on your local computer open your public key file (e.g./User/name/.ssh/id_rsa.pub) > copy and paste the content of that file into the field;
  • Click Import

Once done, do not forget to authorize your imported public key in the same way as in step 2.2.

4. Use Putty and SSH key pair to connect

In this example, we will use the Putty SSH client and key pair generated by cPanel in order to access the server via SSH:

4.1. Download the Private key as it is shown in step 2.3.

4.2. In the PuTTy folder, run puttygen.exe; in the top menu select the File tab and click on Load private keyand select your private key file (make sure All files (*.*) filter is used so you can see your downloaded private key file):

You will be asked for the passphrase you specified during the key generation in step 2.1. After entering it you should receive a successful import message:

In case you do not wish to set a passphrase for the key, you can empty the Key passphrase and Confirm passphrase fields.
Now click on Save private key and save your key as a .ppk file which will be needed later:

4.3. Run the PuTTy client (putty.exe), select Connection > SSH > Auth and in the Authentication parameterssection, click on Browse to select the saved .ppk file:

Once done, get back to the Session section and input the server name (IP address) and specify SSH port (it should be 21098 for all shared servers accounts) and click Open:

In the console window, you will be asked for the login and passphrase:

That’s it!

ByJUJU-dev

What is SSH?

What is SSH?

What is SSH?

Secure Shell or SSH is a network protocol that allows data to be exchanged using a secure channel between two networked devices. The two major versions of the protocol are SSH-1 and SSH-2.

Shell is a program to log into another computer over a network to execute commands on a remote machine and to move files from one machine to another. It provides strong authentication and secure communications over insecure channels.

SSH was designed as a replacement for Telnet and other insecure remote shells (rlogin, rsh, rcp, and rdist), which send information, notably passwords, in plain text, rendering them susceptible to packet analysis. The encryption used by SSH is intended to provide confidentiality and integrity of data over an unsecured network, such as the Internet.

ByJUJU-dev

How to create and maintain MySQL Databases in cPanel

How to create and maintain MySQL Databases in cPanel

This tutorial describes the process of creating and managing MySQL Databases in cPanel. There are two cPanel tools that allow creating MySQL Databases: MySQL Databases menu and MySQL Database Wizard. Let’s find out how each of them actually works.

For cPanel Basic Theme

 

1. In order to start, log into cPanel and click on the MySQL Databases menu in the Databases section:

2. Once there, find the Create New Database section, then simply indicate name of the future database and click on the Create Database button:

3. The database is created and ready to use. Now, in order to be able to fill and maintain the database, MySQL User should be created and assigned to the database with correct privileges.

To create a MySQL User, find the section called MySQL Users > Add New User and choose the username you wish to assign to your database. Once done, choose a secure password for MySQL User and type it into the corresponding fields:

It is highly recommended to use the built-in Password Generator to create a secure password as shown below:

Make sure that you save the password, as you will need it to maintain the Database in the Future.

4. After the password is chosen, simply click on the Create User button to finish the process:

5. Now you have both MySQL Database and MySQL User created. Now we need to assign MySQL User to the database and set proper privileges. To do this, find the Add User To Database section and make sure that you choose the correct Database and User correspondingly. Once done, simply click on the Addbutton:

6. In the next window you will need to set correct privileges to the MySQL User. In this example, we shall grant all privileges to be able to maintain our MySQL Database without any restrictions, so you simply need to choose the All Privileges option and click on the Make Changes button:

NOTE: It is important to remember that multiple MySQL Users with different sets of privileges can be assigned to the same MySQL Database.

7. Once finished, you will get the message stating that the MySQL User was successfully added to the Database:

To check this, you can simply go back to the MySQL Databases menu and check the Current Databasessection:

For cPanel Retro Theme

1. In order to start, log into cPanel and click on the MySQL Databases menu in the Databases section:

2. Once there, find the Create New Database section, then simply indicate name of the future database and click on the Create Database button:

3. The database is created and ready to use. Now, in order to be able to fill and maintain the database, MySQL User should be created and assigned to the database with correct privileges. To create a MySQL User, find the section called MySQL Users > Add New User and choose the username you wish to assign to your database. Once done, choose a secure password for MySQL User and type it into the corresponding fields:

It is highly recommended to use the built-in Password Generator to create a secure password as shown below:

Make sure that you save the password, as you will need it to maintain the Database in the Future.

4. After the password is chosen, simply click on the Create User button to finish the process:

5. Now you have both MySQL Database and MySQL User created. Now we need to assign MySQL User to the database and set proper privileges. To do this, find the Add User To Database section and make sure that you choose the correct Database and User correspondingly. Once done, simply click on the Addbutton:

6. In the next window you will need to set correct privileges to the MySQL User. In this example, we shall grant all privileges to be able to maintain our MySQL Database without any restrictions, so you simply need to choose the All Privileges option and click on the Make Changes button:

NOTE: It is important to remember that multiple MySQL Users with different sets of privileges can be assigned to the same MySQL Database.

7. Once finished, you will get the message stating that the MySQL User was successfully added to the Database:

To check this, you can simply go back to the MySQL Databases menu and check the Current Databasessection:

 

Creating a database with the MySQL Database Wizard tool

MySQL Database Wizard brings the same step-by-step process which is described above, but in a more simplified way. Let’s check how it works:

1. To find the tool, log into cPanel and click on the MySQL Database Wizard option under Databases:

2. Once done, indicate the name of the new database and click on the Next Step button:

3. At Step 2 you will be prompted to indicate MySQL User and choose a password for it, reciprocally to the process described before:

4. After the username and password are indicated, simply click on the Create User button:

5. The next windows will allow you to set privileges for the newly created MySQL User similarly to the process described previously.

Accordingly, you will need to choose the All Privileges option and click on the Next Step button after that:

6. Once done, you will get a confirmation that the MySQL User was successfully added to the MySQL Database:

That’s it!

ByJUJU-dev

How to access a hosting account via SSH

How to access a hosting account via SSH

To access your hosting account via SSH, you should:

1. Follow the steps specified in this guide in order to enable SSH access for your account.

2. Open your SSH client, put your domain name or the IP address of the server into the Host Name field (you can also use server name here, you can check it using this tutorial), enter 21098 into the Port field (22 for a VPS/Dedicated server), choose SSH as your connection type and press the Open button:

3. You will receive the Putty Security Alert. Press OK:

4. When prompted, enter your cPanel username and password (when you enter the password, it is automatically hidden for the security purposes):

login_succeed.JPG

That’s it!

ByJUJU-dev

How to use Manage Shell in cPanel

How to use Manage Shell in cPanel

Secure Shell (SSH) is a cryptographic network protocol that is used to log into the system via a secure channel. With the help of SSH, you can safely exchange data between two devices. For more detailed information, visit here.

Enabling SSH access allows for:

  • Remote hosting control
  • The ability to add, remove, edit, backup and restore hosting files and directories
  • The easy import and export of your database
  • An established connection between 2 different servers

However, there are some downsides with enabling SSH:

  • More difficult to use than a web interface
  • Increased security risks

 

The Manage Shell plugin provided by Namecheap allows you to enable or disable SSH access for your respective hosting accounts with just a few clicks.

For cPanel Basic Theme:

Firstly, locate the Manage Shell plugin from your cPanel:
cPanel >> the Exclusive for Namecheap Customers section >> Manage Shell:

How to use Manage Shell in cPanel - Cheap VPS

By default, SSH access is disabled for hosting accounts.

How to use Manage Shell in cPanel - Cheap VPS

There are 3 options related to enabling SSH keys:

  • Managing SSH keys
  • Generating a new key
  • Importing a key

All these options will take you to the SSH Access menu in your cPanel. Detailed instructions can be found in this guide.

To enable SSH, turn the toggle button on. After it has been enabled, you will then see how you can manage your SSH.

How to use Manage Shell in cPanel - Cheap VPS

Feel free to explore more about SSH clients here.

For cPanel Retro Theme:

Firstly, locate the Manage Shell plugin from your cPanel:
cPanel >> the Exclusive for Namecheap Customers section >> Manage Shell:

How to use Manage Shell in cPanel - Cheap VPS

By default, SSH access is disabled for hosting accounts.

How to use Manage Shell in cPanel - Cheap VPS

There are 3 options related to enabling SSH keys:

  • Managing SSH keys
  • Generating a new key
  • Importing a key

All these options will take you to the SSH Access menu in your cPanel. Detailed instructions can be found in this guide.

To enable SSH, turn the toggle button on. After it has been enabled, you will then see how you can manage your SSH.

How to use Manage Shell in cPanel - Cheap VPS

Feel free to explore more about SSH clients here.
ByJUJU-dev

How to import and export a database via phpMyAdmin (‘Access denied create database db_name’ error)

How to import and export a database via phpMyAdmin (‘Access denied create database db_name’ error)

In cPanel you can import and export databases using the phpMyAdmin menu which you can find in the Databases section. Note, that only databases of 50MB maximum can be imported/exported in phpMyAdmin. Larger databases have to be imported/exported via SSH. To do this, follow the instructions here or simply submit a ticket to our HelpDesk.

Database import

1. Log into your cPanel
2. Navigate to phpMyAdmin menu:

3. Select the database that you will need import to:

4. In the upper bar, click the tab Import:

5. Click Browse and locate the .sql file from your computer. Once done, click Go:

6. And you will see a notification that your database was successfully imported:

Database export

1. Log into your cPanel
2. Navigate to phpMyAdmin menu:

3. Select the database that you will need import to:

4. Choose the tables that you need to export or click Check All. Click Export to proceed:

5. Select the required file from the drop-down menu in Format and click the Go button:

Access denied create database db_name error. How to fix it?

If you received this error message, you can resolve the issue by following the next steps:

1. Open the dump of your database using any text editor on your computer (for instance, Notepad or WordPad).
2. Find the line: CREATE DATABASE db_name (it can usually be found at the beginning) and remove it.
*db_name – your database name:

how_to_import_and_export_database_in_cpanel_access_denied_create_database_db_name_error_and_how_to_fix it(10).jpg

3. Save it and import it using the instructions provided above.

That’s it!