Env settings.php

From ARK
Revision as of 13:11, 6 December 2012 by Guy (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This file contains settings for the specific server environment. This is to separate the settings relating to the server environment from the settings that relate directly to the instance of ARK itself. In order to make life easier for admins, three standard types of server environments are included in the default file. Currently ARK is provided with default setups for Windows, Mac, or Linux servers.

The env_settings.php file is configured in a standard ARK to be included from within the standard settings.php file and should not need to be included by name into any page.

The directives in this file relate mostly to paths, some attention needs to be paid to ensuring that these paths exist and are readable by your webserver. Some paths also need to be writeable.

As a rule, you should first switch to the correct type of server environment and then verify the paths for that specific environment. If you are using a Windows server, you ONLY edit the settings for windows.



Server Type


The type of server being used. Once selected, the directives for that server type need to be verified.

  • Permitted options: = linux|mac|windows

General Paths


This is the ARK directory as it will appear in URLs, relative to the domain. This therefore begins with a forward slash, indicating that it is relative to the highest level in this domain. Where ARK is installed in a subdirectory, this information is added here.

Because this refers to a web 'folder' it is followed by a trailing slash.

This path should look identical in all types of server, but is included in this server specific section as a convenient way to keep paths grouped together.

In Linux and Mac systems that use forward slashes within their filesystem paths (Windows uses backslashes) this variable can be used within other paths in this file to reduce repetition, although for clarity, the default setups write out the paths longhand.


Linux | Windows | Mac

$ark_dir = '/ark/';
Resolves to:
$ark_dir = '/my_subfolder/ark/';
Resolves to:


The full path to the directory containing ARK within the server's filesystem. This resolves the ARK directory back to the filesystem root. In many cases (not all), this is the $doc_root plus the folder containing the ARK installation, therefore subsititution may be used to reduce repetition. In the case of doubt, it doesn't hurt to write this path out longhand to ensure that it points to the right directory.



$pear_path = '/srv/www/htdocs/ark';


$pear_path = '/Applications/MAMP/htdocs/ark';


$pear_path = 'C:\ms4w\Apache\htdocs\ark';


The path to your PEAR installation. This is a fully resolved path to the directory that contains the PEAR files. The system will automatically append this path to PHP's include paths at runtime.

In versions of ARK =< v1.1 these paths began with a colon or semi colon. This is now not required, and will cause the system to fail to load PEAR properly.

Default setup points to the PEAR that ships as a library in ARK.



$pear_path = '/srv/www/htdocs/ark/lib/php/pear';


$pear_path = '/Applications/MAMP/htdocs/ark/lib/php/pear';


$pear_path = 'C:\ms4w\Apache\htdocs\ark\lib\php\pear';

In order to reduce repetition, the $ark_server_path variable can be substituted for the beginning of this path in cases that the PEAR resides within the docroot (such as the default setups).



$pear_path = $ark_server_path.'/lib/php/pear';

File Paths


The directory where ARK stores files after they are processed. This location is relative to the filesystem and must be readable and writeable by the webserver.

By default, ARK ships with a "data" folder which contains a "files" folder. In most cases it is convenient to use this structure. Ensure that permissions are set correctly.



$registered_files_dir = '/srv/www/htdocs/ark/data/files';


$registered_files_dir = '/Applications/MAMP/htdocs/ark/data/files';


$registered_files_dir = 'C:\ms4w\Apache\htdocs\ark\data\files';

As above, the $ark_server_path can be used as shorthand for part of this path.



$registered_files_dir = $ark_server_path.'/data/files';


The folder where files can be found by the webserver. This is relative to the domain (host). This should be the same on all server types.


Linux | Windows | Mac

$ark_dir = '/ark/data/files/';
Resolves to:
$ark_dir = '/my_subfolder/ark/data/files/';
Resolves to:


This is the directory which acts as the 'base' for the file uploading interface. This will appear to be the 'top level' for the file browser. This must be relative to the filesystem.



$default_upload_dir = '/home/uploads';


$default_upload_dir = '/home/uploads';


$default_upload_dir = 'C:\ms4w\Apache\htdocs\ark\data\uploads';


The directory where CSV and files are saved when created for export. This directory must be relative to the filesystem, must be readable and writeable by the web server.



$export_dir = '/srv/www/htdocs/ark/data/tmp';


$export_dir = '/Applications/MAMP/htdocs/ark/data/tmp';


$export_dir = 'C:\ms4w\Apache\htdocs\ark\data\tmp';


This points to the phMagick.php file to be used if required. ARK ships with the phMagick library (ark/lib/php/phMagick/).

You will need to have GD and ImageMagick installed as modules on your PHP for this library to work. If in doubt look at your phpinfo() to see if both modules are loaded. Also run preflight checks.

By default, ARK ships with this line commented out. If you intend to use phMagick (and you have checked that you have GD and ImageMagick), uncomment this directive.

Despite the name, this must point to the file, not the directory.



$phMagickDir = $ark_server_path.'/lib/php/phmagick/phmagick.php';


$phMagickDir = $ark_server_path.'/lib/php/phmagick/phmagick.php';


$phMagickDir = $ark_server_path.'\lib\php\phmagick\phmagick.php';

Mapping Paths


Path to the directory mapserver uses to store temporary data. Relative to server filesystem.


Path to the same temporary directory relative to the domain.


Path to OpenLayers. This is relative to the web and so can be either specified as a local location relative to this domain, or as a fully resolved path to a remote location.

By default, the local version is selected, in order to use a remote location comment this out and comment in the remote location.


If you are using Mapserver via the ark_wxs_server.php, you will need to specify the location of the WMS map file. This is related to the server filesystem.


If you are using Mapserver via the ark_wxs_server.php, you will need to specify the location of the WFS map file. This is related to the server filesystem.


These directives should not need editing.


This indicates how paths are separated in path lists. Windows systems us a semicolon and *nix systems use a colon.


This indicates how folders within a path are separated. Windows systems use a backslash and *nix systems use a forward slash.

Database Settings

  • $ark_db - Your ARK database
  • $sql_server - The MySQL server
  • $sql_user - The MySQL user who will make db calls
  • $sql_pwd - The MySQL user password

DELETED Directives


As of v1.1 this is no longer required, please remove from your files to prevent confusion. This is now completely superseded by $ark_server_path.

Example Setups

Example setups are provided in the env_settings.php file that ships in the packaged code.