Developers find PHP as one of the easy to use server-side scripting languages. There’s an increase in websites using PHP (top 10 million by Alexa rank) and has currently reached 83.5%.
So, let’s understand PHP cloud hosting within MilesWeb PaaS powered by Jelastic, its key features, benefits and rich possibilities offered for running the applications efficiently.
Keeping the pace with technology evolution, MilesWeb 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 from the above versions while creating environment and easily switch between them afterward via intuitive MilesWeb UI.
PHP Application Servers
MilesWeb offers and supports two PHP application servers (e.g. version updates or security patches are added by MilesWeb team to the templates):
To dive into details about the server configuration and find out the list of editable config files for each of them, refer to the document PHP App Server Configuration.
PHP Application Deployment
You get the ability to run any cloud-native or legacy application with the zero downtime deployment. For delivering your PHP projects to the created environment within MilesWeb, you can choose one of the available options:
In addition, you can also configure an automatic periodic re-deployment from the repository (it is performed only if there are any new code changes).
When it comes to production purpose, an external domain name (custom) can be bound to your applications instead of default environment domain. It is possible in two ways: using either A Record or CNAME.
The swapping domains feature doesn’t let the end-users of your application to experience any downtime when you, for example, deploy a new application version. Your new application version can be staged in a test environment and thus, URLs can be swapped with a production environment just in a few clicks.
When you use multiple domains on a single PHP server, it increases the application usability, efficiency and scalability along with saving the costs required for setting up separate instances.
Automatic Vertical Scaling
MilesWeb offers automatic vertical scaling which allows you to vigorously change the number of allocated resources (RAM and CPU) for a server as per its current demands without any manual intervention. This feature assures that you never overpay for unused resources and it save your time required to eliminate the necessity of handling the load-related adjustments or architectural changes.
For setting up automatic resource consumption by your PHP server, open the environment topology wizard and mention the upper scaling limit of cloudlets (each equals to 128 MiB and 400 MHz) with the slider at the top:
The limits set will reduce resource consumption when the load is down or increase it when the load is up as your application will work within these limits. This means your pay only for the resources that are actually consumed.
Related: What Is Automatic Vertical Scaling?
Manual Horizontal Scaling
In order to add extra PHP servers manually, just click on Change environment topology. Then click on the “+” button in the wizard and also, insert the required number of instances.
The highest number of the same-type servers within a single environment layer is dependent on particular hosting provider settings (generally, it stands for 16 nodes and is adjustable by sending a request to support).
Additionally, when you add extra servers, load balancing gets enabled automatically.
Learn more about manual horizontal scaling.
Automatic Horizontal Scaling
Tunable triggers help to implement automatic horizontal scaling. They keep a track on the changes in the application load and add or remove the nodes due to them.
For configuring a trigger for the automatic horizontal scaling – open Settings > Monitoring > Auto Horizontal Scaling section and click the Add button.
This way, the triggers can be configured for particular stacks and resources (CPU, RAM, Network, Disk) within your environment individually. Just mention the conditions of scaling and then apply the changes.
Read More: What Is Automatic Horizontal Scaling?
The implementation of PHP sessions clustering for your application can improve its availability and failover capabilities with the use of the sticky sessions that are run on multiple app server modes. This mechanism is guaranteed by a Memcached node, that needs to be added to your environment and used for storing the backups of the processed sessions.
When you scale out the PHP server with your deployed application, the result is the exact copy with similar configurations and files inside because of the built-in data synchronization.
The pre-packaged auto-scalable WordPress Cluster and Magento Cluster of Jelastic help in one-click installation for ensuring your service operability. Additionally, any PHP application can be packaged in this way for automating its clustered installation.
Database Connection to PHP Application
A set of fully manageable and scalable database servers is provided by MilesWeb PaaS which helps you in easy installation and operation within the PHP environment. For establishing the connection, make some adjustments to your application following the instruction based on the database required:
Modules and Accelerators
When you work with MilesWeb PaaS, it is possible to extend the environment functionality by setting different PHP extensions at the suitable application servers. You can either activate and select the default extensions or upload your own custom one – both of these are mentioned in the PHP Modules instruction.
PHP accelerators can be determined as separate kind of PHP extension. These are used for expanding the efficiency of your application via caching the already compiled PHP code parts that can be instantly executed when a user requests them.
A specific set of the inbuilt modules is included in Apache PHP and NGINX servers. Furthermore, there are some separate tutorials on different modules’ configuration.
TLS / SSL (Transport Layer Security / Secure Sockets Layer) is the standard security technology in the industry for setting up an encrypted connection between a web server and a browser. It is supported by MilesWeb PaaS and makes sure that all the data passed remains confidential and private, i.e., it can’t be interrupted by a third party.
Apart from the basic protection methods, your application security can be increased by customization of the main PHP configuration file, named php.ini. The number of default settings it contains or adds your own can be edited as per the requirements of your application.
For more details about configuration of particular application servers check the below guides:
Another way to guarantee the application security is by using a container firewall feature. It allows controlling your nodes availability from inside as well as outside of the platform.
Want highly available, secure, auto-scalable and easy-to-manage PHP cloud hosting? Look at limitless PHP possibilities with MilesWeb PaaS powered by Jelastic.