Apache PHP

The platform uses a strong, commercial-grade version of the open-source Apache HTTP Server (“httpd”) to provide a secure, efficient, and scalable application server for PHP hosting. The Apache PHP stack provides built-in support for the PHP programming language and the HTTP/2 protocol (which requires SSL via the php7_module and http2_module modules).

Notes:

  • This template is made to work smoothly with the newest version of the systemd startup manager.
  • You can see all the modules loaded on the server by running the apachectl -M command or by checking the default phpinfo page.

apache2handler

To set up your Apache PHP server, follow these instructions:

1. Sign in to your PaaS account and select New Environment from the top menu.

New Environment

2. In the topology wizard, navigate to the PHP tab and choose Apache as your application server. Adjust the remaining settings according to your requirements, such as cloudlets limits, public IP addresses.

Select Apache

Enter the name of your environment, then click on Create.

3. After setting up the environment, simply click the Open in Browser button located beside the Apache application server.

Open environment in browser

4. On the default page that opens, you will find your server’s phpinfo details displayed.

PHP Versions

You can now deploy your PHP application into the environment.

Apache Configuration

To personalize your application server to your individual needs, you may need to modify several essential Apache and PHP configuration files:

  • /etc/php.ini: Contains directives for configuring your PHP setup.
  • /etc/httpd/conf.d/php.conf: Manages the execution of PHP scripts.
  • /etc/httpd/conf/httpd.conf: Includes directives for configuring your Apache server.

For instance, we’ll demonstrate how to modify the settings to change the maximum upload file size for your application.

1. To access the configuration file manager for your Apache server, simply click on the Config button.

Config file

2. Go ahead and open up the /etc/php.ini file, which you can find conveniently in your Favorites. Once you’ve got it open, look for these settings:

  • upload_max_filesize: This determines the largest size files allowed for upload to the server, set to 100MB by default.
  • post_max_size: This sets the maximum size of the POST data that PHP can handle, also defaulting to 100MB.

php.ini file

Note: No matter how you tweak the settings, the biggest file you can send through the platform’s file manager straight from your computer is 150MB (though this could change depending on the hosting provider’s settings). If you need to handle larger files, you’ve got a couple of options: either use the URL feature or connect with your manager by providing a public IP address (like adding an FTP add-on, for instance).Upload archive options

3. Remember to Save any changes you’ve made and Restart the Nodes on your application server so that the new settings take effect.

Restart the node