# ๐Ÿ˜ PHP

Version PHP
4.0 ~8.0

Chevereto V4 is PHP (opens new window) software, it has been designed using:

๐Ÿ‘‰ Packages and PECL provides the same convenience, but as packages are made for debian-based systems, you should prefer PECL if you don't have a debian-compatible system.

๐Ÿ’ก Packages not only contain the software, it could trigger other effects in the system.

# Resources

# What it does?

PHP is the programming language used to write Chevereto application instructions, it is used for everything as it provides high flexibility to alter instructions on-the-fly at a minimum system performance footprint.

# Troubleshoot

Having issues? Check the following common pitfalls:

  • Outdated PHP version
  • Misconfiguration in PHP libraries
  • Bad php.ini directives
  • Low execution time
  • Bad sessions setup
  • Open basedir restrictions

# PHP Configuration

The following ini values are recommended for Chevereto installations.

upload_max_filesize = 64M;
post_max_size = 64M;
max_execution_time = 30;
memory_limit = 512M;
Property Description Example
upload_max_filesize Maximum upload size 64M for 64 MB
post_max_size Maximum post size Same as above
max_execution_time Maximum time to execute the software, in seconds 30 for 30 seconds
memory_limit Maximum memory to allocate 512M for 512 MB

You can toggle this limits to reflect your hardware and server load. Check this article for more info: PHP common pitfalls (opens new window).

# PHP Extensions

The following PHP extensions are required for Chevereto.

  • curl
  • exif
  • fileinfo
  • gd
  • hash
  • imagick
  • json
  • pdo
  • pdo-mysql
  • session
  • xml

# PHP Features

Chevereto requires unrestricted access to all PHP functions. Note that the following functions should not be restricted:

# PHP Image library

The image library (GD, Imagick) should be provided with support for PNG GIF JPG BMP WEBP. By default, Chevereto prefers Imagick and fallback to GD.

๐Ÿ‘‰ If you need to explicit use GD you can pass this ENV:

CHEVERETO_IMAGE_LIBRARY=gd

๐Ÿ‘‰ If the server doesn't provide support for all the image formats handled by Chevereto, the ENV must reflect only the system supported formats. In the following example Chevereto is configured with explicit support only for PNG, GIF, BMP and JPG (removes WEBP):

CHEVERETO_IMAGE_FORMATS_AVAILABLE='["JPG","PNG","BMP","GIF"]'

# Configuring ImageMagick

Additional recommended ImageMagick configuration at /etc/ImageMagick-6/policy.xml file:

<policymap>
    <!-- policies -->
    <policy domain="resource" name="width" value="16KP"/>
    <policy domain="resource" name="height" value="16KP"/>
</policymap>

# PHP Filesystem

User running php must be in the owner group of your installation directory. This is required to allow Chevereto to modify the filesystem for uploading features.

Chevereto user will require read/write access in the following paths:

  • /tmp
  • app/*
  • content/*
  • images/*
  • importing/*