Env settings.php

From ARK
Revision as of 09:45, 5 December 2012 by Guy (talk | contribs) (General Paths)

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


The document root of the virtual host in which this instance of ARK resides. This directive specifies a path relative to the server's file system. Therefore the path must relate to the root of the relevant filesystem beginning with a forward slash on Linux or Mac and with a drive letter on Windows.

As the path references the docroot itself, not its contents, no trailing slash is required. This should match your docroot directive in the virtual hosts setup of your webserver.



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


$doc_root = '/Applications/MAMP/htdocs';


$doc_root = 'C:\ms4w\Apache\htdocs';


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';

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

Export Paths

  • $export_dir - The export directory where CSV and files are stored when exported

File Paths

  • $registered_files_dir - The directory where files are stored after they are registered
  • $registered_files_host - ***
  • $default_upload_dir - The top directory of the file directory, can only search below this folder for uploading files
  • $phMagickDir - phMagick directory, if using for Image Conversion

Mapping Paths

  • $ark_maptemp_dir - Path to temporary map directory (on server)
  • $ark_web_maptemp_dir - Path to temporary map directory (on web)
  • $openlayers_path - Path to OpenLayers on local server, or alternatively pointed to OpenLayers API
  • $ark_wms_map - If you are using Mapserver via the ark_wxs_server.php, you will need to specify the location of the relevant map files (WMS and WFS)
  • $ark_wfs_map - If you are using Mapserver via the ark_wxs_server.php, you will need to specify the location of the relevant map files (WMS and WFS)

Example Setups

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