PHP Cloud Hosting with Jelastic PaaS: Code, Deliver, Optimize

47

PHP is considered one of the easiest to use server-side scripting languages. Its usage for websites (top 10 million by Alexa rank) is steadily growing and currently reached 83.5%. The popularity of PHP and PHP cloud hosting is also proven by Jelastic PaaS customers, getting 47.6% among other programming languages according to software stacks statistics of the previous year.

1598-1-php-engines-usage

Let’s take a journey to PHP cloud hosting within Jelastic PaaS, its chief peculiarities, winning points, and rich possibilities provided for the efficient running of applications.

PHP Versions

Keeping the pace with technology evolution, Jelastic PaaS supports the latest PHP engine versions:

  • PHP 7.2.1;
  • PHP 7.1.0 – 7.1.13;
  • PHP 7.0.13 – 7.0.27;
  • PHP 5.6.28 – 5.6.33;
  • PHP 5.5.38;
  • PHP 5.4.45;
  • PHP 5.3.29.

You can choose the engine version you need while environment creation and easily switch between them afterward via intuitive Jelastic UI.

1598-1-php-environment-creation

PHP Application Servers

Two PHP application servers are provided by default and supported by Jelastic PaaS (e.g., version updates or security patches are added by Jelastic to the templates):

To see in details how these servers can be configured, and find out the list of editable config files for each of them, refer to the document PHP App Server Configuration.

1598-1-php-app-server-configuration

PHP Application Deployment

Zero downtime deployment provides the ability to run any cloud-native or legacy application. In order to deliver your PHP projects to the created environment within Jelastic PaaS, you can choose one of the available options:

Besides, you can configure an automatic periodic re-deployment from the repository (it is performed only if new code changes appear).

1598-1-php-automatic-periodic-redeployment

Domains Management

For production purposes, you can bind an external domain name (custom) to your application instead of the default environment domain. This can be done in two ways: using either CNAME or A Record.

With the help of the swapping domains feature, end-users of your application won’t experience any downtime when you, for example, deploy a new application version. You can stage your new application version in a test environment and consequently swap URLs with a production environment just in a few clicks.

1598-1-custom-domains-swapping

Using multiple domains on a single PHP server increases the application usability, efficiency, and scalability, simultaneously saving the costs on the necessity to set up separate instances.

Automatic Vertical Scaling

Automatic vertical scaling is made possible by Jelastic ability to dynamically change the number of allocated resources (RAM and CPU) for a server according to its current demands, with no manual intervention required. This feature guarantees you never overpay for unused resources and saves your time due to eliminating the necessity of handling the load-related adjustments or architectural changes.

In order to set up automatic resource consumption by your PHP server, open the environment topology wizard and specify the upper scaling limit of cloudlets (each equals to 128 MB and 400 MHz) with the slider located at the top:

1598-1-cloudlets-scaling

Your application will work within these limits reducing resource consumption when the load is down or increasing them when the load is up. Thus, you only pay for the resources that are actually consumed. For more information, please refer to the documentation about automatic vertical scaling.

Manual Horizontal Scaling

For adding extra PHP servers manually, just click Change environment topology. Then press the “+” button in the wizard and add the required number of instances.

1598-1-changing-environment-topology

The maximum number of the same-type servers within a single environment layer depends on Jelastic PaaS platform settings (usually this limit stands for 16 nodes and can be adjusted by sending a request to support).

Also, as you can see, when you add extra servers, load balancing is enabled automatically.

Please, find more details about manual horizontal scaling in the documentation.

Automatic Horizontal Scaling

Automatic horizontal scaling can be implemented through tunable triggers, which monitor the changes in the application load and increase or decrease the number of nodes due to them.

To configure a trigger for the automatic horizontal scaling open Settings > Monitoring > Auto Horizontal Scaling section and press Add button.

In this way, you can configure the triggers for specific stacks and resources (CPU, RAM, Network and Disk) within your environment separately. Just specify the conditions of scaling and apply changes.

1598-1-auto-horizontal-scaling

Please, find more details about automatic horizontal scaling in the documentation.

PHP Clustering

Implementing the PHP sessions clustering for your application can highly increase its availability and fail-over capabilities using the sticky sessions, run on several app server nodes. This mechanism is ensured by a Memcached node, that should be added to your environment and used as storage for the processed sessions’ backups.

While scaling out PHP server with your deployed application, you get its exact copy with all the same configurations and files inside due to built-in data synchronization.

Beside, Jelastic PaaS has pre-packaged auto-scalable WordPress Cluster and Magento Cluster available for one-click installation to ensure your service operability. Moreover, you can package any PHP application in this way to automate its clustered installation.

1598-1-clustered-package-installation

Database Connection to PHP Application

Jelastic PaaS provides a set of scalable and fully manageable database servers that you can easily install and operate within the PHP environment. To establish the connection, adjust your application following the instruction based on the database you require:

Modules and Accelerators

While working with Jelastic PaaS, you can extend the functionality of the environment through setting different PHP extensions at the appropriate application servers. You can either select one of the default extensions and activate it, or upload your own custom one – both these operations are described in the PHP Modules instruction.

As a separate kind of PHP extension, PHP accelerators can be determined. They are used for enlarging your application efficiency through caching the already compiled parts of PHP code, which can be quickly executed upon a user’s request.

Apache PHP and NGINX servers include a particular set of the inbuilt modules. In addition, there are a few separate tutorials on configuring the various modules:

PHP Security

SSL / TLS (Secure Sockets Layer / Transport Layer Security) is the industry standard security technology for establishing an encrypted connection between a web server and a browser. This technology is supported by Jelastic PaaS and ensures that all passed data remains private and confidential, i.e., it can’t be intercepted by a third party.

Besides the common protection methods, security of your application can be increased through customizing the main PHP configuration file, named php.ini. You can edit a number of default settings it contains or adds your own in accordance with the needs of your application.

Additional configuration guidance is available for particular application servers:

One more way to ensure the application protection is using a container firewall feature. It lets control your nodes availability both from inside and outside of the platform.

1598-1-container-firewall

“PHP has always been about making Web development easy and accessible to everyone. Jelastic’s approach to PaaS fits nicely with this mission, and I am looking forward to helping them build more great products.” – Rasmus Lerdorf, Creator of PHP.

Rasmus has joined Jelastic in 2013 as a senior advisor, and assisted while integrating PHP technologies to the platform. Currently, this language became the top choice of the users along with Java, Ruby, Python, Node.js, .Net and Go.

Looking for the highly available, secure, auto-scalable and easy-to-manage PHP cloud hosting? Explore limitless PHP possibilities with Jelastic PaaS. Take a try by registering at our Jelastic PaaS platform.

SOURCEJelastic, Inc.