To: Heading_
Smallsite Design logo (SD) 390x390px

Smallsite Design

Online setup help

8  Configure PHP

!

Smallsite Design uses the PHP programming language, but it needs to have the correct version and other settings.

This procedure must be used:
  1. a.Prior to installing Smallsite Design.
  2. b.If wanting to use a new version of PHP that the hoster has just enabled.

Fortunately, cPanel allows configuring a PHP version before committing to it. This enables ensuring Smallsite Design can work with it without risking breaking the site.

For most of the steps here, cPanel responses usually occur after several seconds delay, often accompanied by an animation indicating its taking its time, and for settings, will display a Success message box. These will not be described in the step responses.

Only these steps

Do not change any other options or settings.

Some of the cited options may not be available, usually because the hosting provider has confined them to safe settings in order to protect their systems. The critical ones are the required extensions and allowing uploads of sufficient size.

Steps

 Indicates the step has learning notes. Click its checkbox to show them.

The role to perform this procedure is: Site owner.

To configure PHP for use with Smallsite Design:1Log into the cPanel console

if not already.

2Open the PHP Selector page

by clicking the Select PHP version option under the Software section.

The page is displayed, showing the current PHP version:Sample cPanel PHP Selector page
3Select PHP version

by selecting an option from the Current PHP version dropdown list.

The version is displayed with a Set as current button:Sample cPanel PHP version to set as current
4Enable required PHP extensions

by performing:

4-1Enable a disabled extension

by clicking on one of the dom, gd, intl, openssl, xsl and zip checkboxes not already checked.

Sometimes a hoster may not fully set up a PHP version to support all extensions before enabling it. Return to step 3 to select an 8 or later version that does. If a Smallsite Design installation shows a Fail for one of more of these, select another version of PHP.

4-2Complete enabling

by clicking the checkbox for each of the remaining required but unchecked extensions.

5Specify options

by performing:

5-1Show options

by clicking on the Options link at the top of the page.

The PHP options are displayed:Sample cPanel PHP Options page
5-2Disable remote data access

by unchecking the allow_url_fopen checkbox if not already.

5-3Disable remote program access

by unchecking the allow_url_include checkbox if not already.

5-4Set default timezone

by replacing the text in the date.timezone field with UTC.

5-5Disable display of errors in pages

by unchecking the display_errors checkbox if not already.

Errors in the application's code are logged but their verbose text does not need to appear in pages.

5-6Hide PHP details

by unchecking the expose_php option.

Preventing knowledge of whether a site runs on PHP or which version of it may help to mitigate against targeted attacks on the site.

5-7Enable file uploads

by checking the file_uploads checkbox if not already.

File uploading is required for showing images or other files, and updating the site's code or its content.

5-8Allow larger uploads

by selecting at least the 32M option for each of the post_max_size and upload_max_filesize dropdown lists.

post_max_size specifies how much data a form can handle, and upload_max_filesize specifies the largest file that that form upload can allow. In Smallsite Design, only one file is allowed at a time, so both need the same setting. Each current version file for the application is not much under the 16MB option, so the allowance needs both to be the next size up to easily cover future versions.

If the site has multimedia files, these settings need to be at least more than the largest of them, as well as handling uploading of a compressed archive that may contain several such files. For example, a high-quality, 15-second, 30fps MP4 video will be up to 15MB. For a 60fps or 1080p version, up that to 25MB.

5-9Enable PHP control of compression

by checking the zlib.output_compression checkbox.

This allows Smallsite Design to compress pages but leave images and other files in their native compressed formats. Compression attacks like BREACH are prevented by randomising tokens. Settings in the site's .htaccess file ensure the compression setting in cPanel's Software > Optimize website are ignored.

6Make the PHP version current

by clicking the Set as current button.

The version is now current:Sample cPanel PHP current version
LinksLatest articles&Subsite links

Powered by  Smallsite Design  ©Smallsite™  Privacy   Manage\