How to set up custom php.ini file for your website

Many of us have wondered, how can we change some of the PHP directives to match some script requirements? Even though this might sound complicated, it is much easier than it looks.

First, we should know a few facts about PHP directives and where they reside. We have 3 levels of php.ini file levels:

1) Server global php.ini (this file resides in the server configuration and this cannot be edited by the users in a shared hosting environment).

2) User global php.ini (this file usually resides in the main folder for a user website, like public_html and this serves all the php scripts that fall under the user account).

3) User local php.ini file (this file is not limited to a specific path and can be deployed by the user wherever he feels he needs to change some parameters for some script).

Now, an interesting question arises: how does this work? The answer is pretty simple. PHP interpreter looks for the php.ini files from down upwards, meaning it looks for a user local file, if the file is not there, it looks in the folder above and then above until it reaches the main folder for the user account. If it fails to find any custom user php.ini file, the interpreter reverts to the global php.ini file for directives.

This is very useful for creating custom php.ini files. You can have the global file serve all your PHP directive needs. If you need a certain directive overwritten (we will show how soon), you simply create a php.ini file in the folder where your script resides, and add that directive. The changes will only affect script files running on this folder and any subfolders below that folder. Parent folders will revert to the php.ini file in their respective folder or their parent folder, and so on.

Now, how to create a php.ini file? it is very simple. There are 2 ways of doing this:

– Login into your control panel, open file manager
null

– Navigate to the folder you wish to add the file, click on “new file”, enter the name of the file which is php.ini
null

null

– Open the file in the editor by clicking on the edit button. And add the parameters you wish to change in the following order:

[PHP]
variable = value;
variabl2 = value2;

eg.

[PHP]

max_execution_time = 60;
memory_limit = 256M;

null

– Save the file and exit.

The second way you can add this file is by logging onto your FTP and adding the file or uploading it after creating it locally.

The last portion of this tutorial will discuss how to check if your changes have been reflected or not and what php.ini file is actually being used to process scripts in a specific location. You can create a PHP file (using the same steps as above) with the following content: –

You have to go to your browser and open the PHP file. This script will simply display all the information for your PHP environment. We are now interested in one field, the “loaded configuration file”. This directive will show you which file is being used to obtain the directives for the PHP file you just created and executed. –
null

null

Note: You only need to include the directives which values you want changed and not all the values that are globally defined.

External Authentication

Don’t you hate having to remember so many usernames and passwords?

In cPanel & WHM version 54, we added the External Authentication feature, which allows system administrators to grant users the ability to link credentials at OpenID authentication providers to their cPanel accounts. So, if the user is currently authenticated to an external provider that they’ve linked to their cPanel account, they can click on the provider’s button on the login interface to automatically log in to cPanel.

One click, and you’re in.

The following video link demonstrates the sample Facebook authentication provider module:

System administrators can select and configure the authentication providers, and they can manage user credentials in case of a security issue.

Currently, the feature allows cPanel users the ability to authenticate with cPanelID, which are the credentials that Manage2, cPanel Store, and our ticket system uses. Your server will automatically configure the cPanelID authentication provider when you upgrade to cPanel & WHM version 54.

The cPanelID authentication will allow smoother integration with cPanel support tickets, the cPanel Store, and other features.

If you do not already have a cPanelID, you can register at https://www.webhostingworld.net/linux-shared.html

You can also add your own provider to the server’s configuration. We provide information in our SDK that documents how to create a module and the relevant API calls to use to connect the module to the provider. We also include several sample authentication provider modules as examples for developers.

3 Apps to Optimize Your Server Performance

Server performance isn’t just an issue for hosting providers, it’s a big deal for web admins, and most of all, for the person staring into a blank browser window, waiting for a page to load. Not only can an overloaded server lead to poor user experience, it can also cause a major hit to a site’s search engine ranking. That’s why we’ve decided to take some time to share some of our favorite cPanel apps and plugins that will not only mitigate the load on your servers, but also work to ensure visitors to your hosted sites are getting the best experience possible.

CloudFlare

Through the nifty use of cloud technology, this application allows hosting providers to deliver increased performance for the websites they host while also bolstering the overall security of their domains. CloudFlare’s service, which can be compared to digital gated community, allows a site’s static content to be cached and stored amongst their 23 global data centers.

LiteSpeed

LiteSpeed Web Server is a high-performance Apache drop-in replacement that streamlines the way data is retrieved and delivered between the server and client. LiteSpeed lowers server load through a method called event-driven architecture.

Varnish

Varnish is yet another amazing plugin that positions itself as a liaison between the client and server. This easy-to-install application improves performance and security, while offering both hosting providers and website owners an assortment of tools that can handle performance down to the subdomain level. Not only does Varnish integrate well with cPanel, it also can perform in conjunction with our entire suite of performance add-ons, including EasyApache, LiteSpeed, and Apache.

Magento Security Update

Magento recently released a security update that fixes many vulnerabilities found in their software. If you are running a Magento installation without patch SUPEE-6285 we highly recommend you update immediately:

https://www.magentocommerce.com/products/downloads/magento/

If you are a customer with us, we will be in contact if this issue affects your account.

For more information on the security vulnerabilities fixed in this update, please visit the following link:

http://merch.docs.magento.com/ee/user_guide/Magento_Enterprise_Edition_User_Guide.html#magento/patch-releases-2015.html

Joomla critical zero day exploit !!!!

null

A recently discovered zero day vulnerability within Joomla is currently being actively exploited, this vulnerability allows an attacker to take full control of an affected site’s Joomla administration area.

This exploit affects versions 1.5 through 3.4.5, you can determine your Joomla version by logging into your administrator area, your version will displayed either in the top right hand corner or at the bottom of your administrator panel.

If your site is an affected version it is essential you either upgrade or apply the latest patches.

If you are running any currently supported version of Joomla you should upgrade to the latest version

For EOL versions a patch has been provided which can be found at the link below, however we strongly recommend client’s upgrade to the latest version as soon as possible.