Configuring PHP

FileRun requires PHP version 7.1 or newer.

It is recommended to use the PHP 7.3, for increased performance and security.

FileRun also requires the free “ionCube loader” PHP extension. Read here how to get that installed.

The following are the optimal PHP settings we recommend for using with your FileRun installation.

(This guide assumes that you have a default PHP installation, configured without any –disable or –without parameters.)

expose_php              = Off
error_reporting         = E_ALL & ~E_NOTICE
display_errors          = Off
display_startup_errors  = Off
log_errors              = On
error_log               = "/private/path/php_error.log"
ignore_repeated_errors  = Off

Note: Replace /private/path/php_error.log with a valid path.

Keep in mind that you need to have display_errors set to “Off” on a production server and it's a good idea to frequently check the error logs for possible problems.

If encountering any problems with your FileRun installation, please temporarily set “display_errors” to “On” before providing our technical support access for troubleshooting. Or send us the PHP error log when you are reporting a problem.

open_basedir            = /path-to-filerun:/path-to-user-files/

Note: Replace /path-to-filerun and /path-to-user-files above with actual paths.

This allows PHP access to the FileRun application files (to run the application) and your files, to allow FileRun to manage them. You can add more paths, as needed. Under Windows, separate the directories with a semicolon character (;).

 allow_url_fopen         = On
 allow_url_include       = Off
 variables_order         = "GPCS"
 allow_webdav_methods    = On
 memory_limit            = 128M
 max_execution_time      = 300
 output_buffering        = Off
 output_handler          = ""
 zlib.output_compression = Off
 zlib.output_handler     = ""
 safe_mode               = Off
 register_globals        = Off
 magic_quotes_gpc        = Off
 date.timezone           = "UTC"

Note: Replace UTC with your actual time zone. For a list of possible values, please visit: http://php.net/manual/en/timezones.php

 file_uploads            = On
 upload_tmp_dir          = /path/to/your/temp/folder/
 upload_max_filesize     = 20M
 post_max_size           = 20M

Note: Replace /path/to/your/temp/folder/ with an actual path.

“post_max_size” needs to have at least the same value as “upload_max_filesize”. If you go with larger values than 20M keep in mind that your server might have other limitations in place, which might prevent FileRun from uploading file in larger chunks. If having troubles uploading larger files, always set the two settings lower not higher, as low as 2M. If you are sure that your server can receive larger pieces of files, than increasing these two values will allow for a faster throughput.

 enable_dl               = Off
 disable_functions       = ""
 disable_classes         = ""

Disabling functions such as “sys” and “exec” is a common practice but note that it does not necessary make your PHP safer and it disables any FileRun feature which requires third-party programs (ImageMagick, FFmpeg, Apache Tika, etc.)

 session.save_handler     = files
 session.use_cookies      = 1
 session.use_only_cookies = 1
 session.auto_start       = 0
 session.cookie_lifetime  = 0
 session.cookie_httponly  = 1

It is a good practice to change “session.name” to something else than the PHP default.

Make sure session.save_path is set in your PHP configuration file and points to an existing folder that PHP can write to.

The following are the extensions needed by FileRun. For performance, it's recommended that you disable anything else.

  • php_curl
  • php_mbstring
  • php_openssl
  • php_pdo_mysql
  • php_sockets
  • php_gd2
  • php_xml
  • php_json
  • ionCube

For installing ionCube, see this page.

The following extensions are optional, but good to have:

  • php_fileinfo
  • php_exif
  • OPcache

Newer cURL versions no longer include an SSL certificate bundle by default.

If your FileRun installation fails to connect to other servers because of SSL problems, you can fix it by downloading this file: https://curl.haxx.se/ca/cacert.pem

and configuring it inside “php.ini” like this:

[CURL]
curl.cainfo = "/path/to/cacert.pem"

Note: Replace /path/to/cacert.pem with the actual path on your server.

fastcgi.impersonate = 0
cgi.fix_pathinfo = 1

To avoid troubles installing FileRun updates, make sure the above is set in your PHP configuration.

Besides the settings above, for everything else we recommend to leave the default PHP settings.

The log settings are contained in the php.ini file stored on the server.

If you don't know where that is, create a PHP file inside the FileRun installation folder, add the following as the second line

<?php phpinfo();

Then open the URL of the file in a browser and look on the generated page for the entry Configuration File (php.ini) Path.

When you have located php.ini open it in your favorite text editor.

Find the Error handling and logging section of the php.ini file.

Make sure that both display_errors = On, display_startup_errors = On and log_errors = On are present and uncommented.

Check the value of error_log - this tells you the location of the file errors are logged to. If it is commented out then errors will be sent to the web server error log file.

Remember, if you make any changes to this file you will need to restart the web server (or just reboot the server).