Artboard
Classic Docs
Docs Navigation

PHP support on Semaphore

Semaphore supports the following PHP versions via phpbrew:

  • 5.4.45
  • 5.5.38
  • 5.6.37
  • 7.0.31
  • 7.1.21
  • 7.2.9

The Semaphore stack includes:

List of all packages and versions is available on the supported application stack page.

# PHP versions

The major version specified in project settings will be set as global to the latest corresponding version. Semaphore uses phpbrew for managing PHP versions.

Setting a PHP version is performed by the equivalent of the following command:

phpbrew switch php-7.0

# Modifying the PHP configuration file

The examples below illustrate how PHP can be configured with build commands.

# Changing timezone

To set a different timezone you can use a build command like below which changes the timezone from UTC to America/Denver. We're using | as a delimiter in sed to avoid escaping the forward slash in the timezone.

phpbrew cd etc && sed -i "s|date.timezone = UTC|date.timezone = 'America/Denver'|" php.ini && cd -

# Increasing the Memory Limit

To increase the default memory limit for the PHP add a setup command similar to the following.

phpbrew cd etc && sed -i "s/memory_limit = 128M/memory_limit = 256M/" php.ini && cd -

# Using custom PHP configuration file

To use your custom php.ini file include it in Project Settings > Configuration Files and add the line below as a build command. In this case, the configuration file is called custom_php.ini.

phpbrew cd etc && cp /home/runner/custom_php.ini php.ini && cd -

Semaphore Docs are open source — Edit on GitHub

Newsletter

Occasional lightweight product and blog updates. Unsubscribe at any time.

2009-2020 © Rendered Text. All rights reserved. Terms of Service, Privacy policy, Security.