Configuration directives reference

admin_ip

Category: main/misc (Advanced)

Type: string

Your IP address, it need to be provided during the installation procedure so that nobody else is able to create an administrator account on your behalf. If you don't know what your IP address is don't worry it will be given to you during the installation procedure.

Example: "193.29.43.244", "192.168.0.1", "127.0.0.1"

convert_path

Type: string

Obsolete since version: 0.9.11

Replaced by: thumb_generator_path

If you use convert as $config['thumb_generator'], you can specify its path using this directive (leave blank for auto detection).

Example: "/usr/bin/convert"

cover_picture_mode

Category: display/layout

When using the 'picture' mode of 'directory_display_mode' and no cover picture is actually set for a directory, what should phpGraphy do about it ? 'random' Select automatically one random picture from the directory 'manual' Don't do anything and let you handle the situation Note that the 'random' mode can slow down your site as it does scan the content of every directory without cover.

Default value: random

data_dir

Category: main/path (Advanced)

Type: string

Path to data files (with a trailing slash '/'). This directory is mainly used with the flat file database backend but it contains also others data files like one for the EXIF function.

Example: "data/" or "../data/"

Default value: data/

database_type

Category: main/database

This define your database backend. For now, you have the choice between 'file' for default Flat Files Database and 'mysql' for MySQL.

Default value: file

db_host

Category: main/database (Advanced)

Type: string

Name of the host running the MySQL database, if you don't know try the default setting 'localhost', else ask your hosting compagny. NOTE: Only needed if using MySQL.

Example: 'localhost', 'mysql.provider.com'

db_name

Category: main/database (Advanced)

Type: string

Name of the database that will contain phpGraphy tables. NOTE: Only needed if using MySQL.

Example: 'phpgraphy', 'accountname'

db_pass

Category: main/database

Type: string

Password of your MySQL account. NOTE: Only needed if using MySQL.

db_prefix

Category: main/database (Advanced)

Type: string

Prefix used for phpGraphy tables NOTE: Only needed if using MySQL.

Example: 'phpg_', 'phpgraphy_'

db_use_mysql_pconnect

Category: main/database (Advanced)

Enable/disable MySQL persistent connection 'mysql_pconnect()' See http://www.php.net/manual/en/features.persistent-connections.php for details. NOTE: Only needed if using MySQL.

Default value: 1

db_user

Category: main/database (Advanced)

Type: string

Username of your MySQL account. NOTE: Only needed if using MySQL.

debug_mode

Category: main/behavior (Advanced)

Change verbosity of the errors messages. If you have any problems that you can't resolve, start by increasing the value of this setting. Keep also in mind that setting a high level of debugging might reveal details about your configuration. 0 = disabled, 1 = normal, 2 = verbose, 3 = development/debugging, 4 = development/debugging+

Default value: 2

default_file_permissions

Category: main/behavior (Advanced)

Type: int

If set, file permissions will be changed to the value specified here, acceptable values are the same as the ones accepted by the chmod command of the form 0xxx. See http://php.net/manual/en/function.chmod.php for details

Example: '0664', '0644', '0600'

directory_display_mode

Category: display/layout

Choose the way you want to display directories when in browsing mode. 'picture' display a picture with a nice frame border effect around, handle directory title and also display statistics for each directory (numbers of files and sub-directories) 'icon' display a small folder icon just before the directory name. 'name' oldschool mode, only display the directory name.

Default value: picture

dirs_sort_by

Category: display/layout (Advanced)

Default sort method for directory, you can choose between 'filename' (default) and 'datetime'.

Example: "filename" or "datetime"

Default value: filename

dirs_sort_order

Category: display/layout (Advanced)

Default sort order for directories, you can choose between 'asc' (default) and 'desc' (reverse)

Example: "asc" or "desc"

Default value: desc

exclude_files_preg

Category: display/pictures (Advanced)

Type: string

This variable contain a perl regexp (Regular Expression) of files/directories to exclude when parsing directories. Please modify it carefully as an improper value may break your whole site and/or render previously invisible files visible.

Default value: /^(\..*|_comment|thumbs.db)/i

files_sort_by

Category: display/layout (Advanced)

Default sort method for files, you can choose between 'filename' (default) and 'datetime'.

Example: "filename" or "datetime"

Default value: filename

files_sort_order

Category: display/layout (Advanced)

Default sort order for directories, you can choose between 'asc' (default) and 'desc' (reverse)

Example: "asc" or "desc"

Default value: asc

highest_rating

Category: modules/rating

Type: int

The maximum rating that can be given to a picture, from 1 to this number Change this carefully, especially if you have already some pictures rated as it would falsify the results.

Default value: 5

highres_min_level

Category: display/pictures

Type: int

Mininum level to be able to see high resolution pictures, Value can be from 0 to 999. "1" means that you need to be authenticated to see them, "0" mean that everyone as access to them.

Default value: 1

icons_dir

Type: string

Obsolete since version: 0.9.11

Path to icons/images used by phpGraphy (with trailing '/'), default should be fine in most cases.

Example: "graphics/" or "someothername/"

install_mode

Category: main/misc (Advanced)

Enable install_mode, you'll then be redirected to the installation process pages

iptc_title_field

Obsolete since version: 0.9.11

Replaced by: metadata_title_field

This define which IPTC field should be used to fill (if empty) the picture title/description.

Example: 'Iptc.ObjectName' or 'Iptc.Headline'

language_file

Category: main/lang

Change the default language to one available in base/lang/ directory. Please note that the english language will still be used as fall-back, so if you get some english text, it means that the external language file is incomplete.

Example: "lang_fr.inc.php"

lr_limit

Category: display/pictures (Advanced)

Type: string

Size (in bytes) where we generate a low resolution picture. Basically, if the picture is bigger than this size, a low resolution picture will be generated.

Example: "1024*100" mean that if a picture is more than 100KBytes, we generate a low res.

Default value: 102400

lr_quality

Category: display/pictures (Advanced)

Quality (from 10 to 100) of the generated low resolution pictures.

Default value: 80

lr_res

Category: display/pictures

Type: string

Size (in pixels) of the generated low resolution pictures.

Default value: 800x600

metadata_title_field

Category: modules/metadata

This define which EXIF/IPTC field should be used to fill (if empty) the picture title.

Example: 'Iptc.ObjectName' or 'Iptc.Headline' or 'Exif.JpegComment'

Default value: Iptc.ObjectName

movie_extractor

Category: main/imagetools

Tool used to extract frames from movies and generate a thumbnail from it "ffmpeg" requires exec() permission and the ffmpeg binary to be installed and accessible from php. "none" is the default choice

Default value: none

movie_extractor_path

Category: main/imagetools (Advanced)

Type: string

If you use ffmpeg as 'movie_extractor', you may have to specify its path using this directive if not autodetected (ie: not in the $PATH, %PATH%).

Example: "/usr/bin/ffmpeg" or "C:\FFmpeg\FFmpeg.exe"

nb_col

Category: display/layout (Advanced)

Type: int

Maximum number of columns per page to display the thumbnails. See also nb_thumbs_max.

Example: "5" mean that you'll get 5 columns of pictures per page

Default value: 3

nb_last_added

Category: modules/lastadded

Type: int

Numbers of pictures/directories on the last added pictures/directories page

Default value: 10

nb_last_commented

Category: modules/comments

Type: int

Numbers of pictures on the last commented pictures page

Default value: 10

nb_pic_max

Type: string

Obsolete since version: 0.9.11

Replaced by: nb_thumbs_max

Maximum number of pictures per column (2 columns per page)

Example: "5" mean that you'll get 10 pictures per page

nb_thumbs_max

Category: display/layout (Advanced)

Type: int

Maximum number of thumbnails per page. See also nb_col.

Example: "10" mean that you'll get 10 pictures per page

Default value: 12

nb_top_rating

Category: modules/rating

Type: int

Numbers of pictures on the top rated pictures page

Default value: 10

picture_link_action

Category: display/layout (Advanced)

Action when clicking on a picture (lowres/highres) in display mode 'nextpic' Jump to the next picture of the current directory (or a random one when in random mode) 'switchres' Switch between High Resolution and Low Resolution pictures. Note that access to High Resolution pictures is limited by highres_min_level, such if the user hasn't sufficients privileges, the link won't even be displayed.

Default value: nextpic

pictures_dir

Category: main/path (Advanced)

Type: string

Path to your pictures (with a trailing slash '/'), replace the old $root_config variable

Example: "pictures/" or "/home/http/htdocs/pictures/" or "../pictures/")

Default value: pictures/

postcomment_min_level

Category: modules/comments

Type: int

Minimum level required to post comments on images. 0 means that everybody (including non authenticated visitors) can post comments. Any value greater than 0 means that you need to be authenticated will a level at least equal to the one specified here.

rating_pre_votes

Category: modules/rating (Advanced)

Type: int

When using 'average' as rating_score_mode, add some default votes with an average rating, this is to avoid that a picture with a single vote of 5 get a highest final rating than a picture with 4 votes of 5 and 1 vote of 4. It can be assimilated to a counter-balance. Value is a integer between 0 and 9.

Default value: 3

rating_score_mode

Category: modules/rating

Choose the way the global rating (score) is calculated for a picture. 'average' - Add the sum of all votes plus the rating_pre_votes and divide by the number of votes 'formula' - Use a formula that will compute average rating and number of votes to give a score. This method give a better thought as the number of votes as a real impact on the final score.

Default value: average

root_dir

Type: string

Obsolete since version: 0.9.11

Replaced by: pictures_dir

Path to your pictures (with trailing '/').

Example: "pictures/" or "/home/http/htdocs/pictures/" or "../pictures/")

rotate_tool

Category: main/imagetools

Tool used to losslessly rotate your pictures. You can choose between "exiftran" and "jpegtran", both require exec() permission and of course the choosen binary need to be accessible from php. "manual" is an equivalent to disabled as it will hide the rotate options. note: "auto" is obsolete since 0.9.11

Default value: manual

rotate_tool_args

Category: main/imagetools (Advanced)

Type: string

Use this variable to redefine default arguments passed to rotate_tool, change this with care, default should be fine in most cases.

Example: for jpegtran, "-copy all -perfect"

rotate_tool_path

Category: main/imagetools (Advanced)

Type: string

If you've setup a rotate_tool and it doesn't work, you might need to specify its path here.

Example: "/usr/bin/exiftran"

script_name

Category: main/behavior (Advanced)

Type: string

Use *ONLY* if you have problem with forms. On some PHP installation, the global variable SCRIPT_NAME is filled with erronous values. It should normally contain the path to access your page like "/phpgraphy/index.php" or "index.php" but in some cases it get filled in with values like "/cgi-bin/php" If you're in this case, use this directive to correct the problem.

Example: "index.php" or "/phpgraphy/index.php"

theme

Category: display/layout

Name of the active theme (located under themes/ with a valid theme structure)

Example: "default", "mytheme"

Default value: default

thumb_aspect

Category: display/pictures

Aspect of generated thumbnails. 'normal' (default) preserve the ratio between width and height, the largest side won't be larger than the one specified in thumb_res. 'square' picture is cropped in the center, also note that only the left number of thumb_res is used.

Default value: normal

thumb_generator

Category: main/imagetools

Tool used to generate thumbnails/lowresolution pictures. "gd" is the default and recommended choice. "convert" requires exec() permission and the ImageMagick to be installed and accessible from php. "manual" is a fallback choice if you want to handle thumbnails and low res images yourself. note: The "auto" option is obsolete since version 0.9.11

Default value: gd

thumb_generator_path

Category: main/imagetools (Advanced)

Type: string

If you use convert as 'thumb_generator', you may have to specify its path using this directive if it's not autodetected (ie: not in the $PATH, %PATH%). note: This directive replace the old 'convert_path' one

Example: "/usr/bin/convert" or "C:\ImageMagick\convert.exe"

thumb_quality

Category: display/pictures (Advanced)

Quality (from 10 to 100) of the generated thumbnails

Default value: 60

thumb_res

Category: display/pictures

Type: string

Size (in pixels) of the generated thumbnails, width per height. Note that thumb_aspect will influes on the final dimensions by preserving or not the aspect ratio.

Example: "100x100"

Default value: 100x100

thumbs_order

Category: display/layout (Advanced)

Set the order to display the thumbnails L2R (left to right starting from the top), T2B (top to bottom starting from the left), R2L (right to left starting from the top)

Example: "L2R" mean that you'll get the first picture on the top left corner and

Default value: T2B

use_comments

Category: modules/comments

Enable/Disable the use of the comments system

Default value: 1

use_direct_urls

Category: main/behavior (Advanced)

Type: int

WARNING - Read very carefully what will happen if you enable this feature. If set to 1, phpGraphy will try to use whenever possible direct links to pictures. This is a huge benefit performance wise, however than means that people can browse through your pictures directory directly (without the phpGraphy interface). It is not recommended to use the flat file database along with this option as people will be able to see some data files stored in the pictures directory. To summarize, enabling this option completely disable any "security level" feature of phpGraphy. Note that you need to remove the default .htaccess file located in the pictures/ directory so that pictures become directly accessible (such direct_urls name). This option is recommended for popular public sites along with mysql as backend database.

use_exif

Category: modules/metadata

Enable/Disable the use of the EXIF metadata. If enabled, EXIF metadata will be displayed under each picture that contains such information. Note that you can customize the display of thoses informations by using your own custom language file.

Default value: 1

use_flock

Category: main/behavior (Advanced)

Enable/Disable "File Locking" mechanism. This option is only used with the flat file database backend and is HIGHLY recommended to avoid data loss due to concurrents writing access. It may be turned off on small sites but if you've have to turn it off, I would rather recommend you to use MySQL.

Default value: 1

use_iptc

Category: modules/metadata

Enable/Disable the use of the IPTC metadata. If enabled, IPTC metadata will be displayed under each picture that contains such information.

Default value: 1

use_ob

Category: main/behavior (Advanced)

Enable/Disable "Output Buffering". You can improve performance by more than 20% if enabled but you might also have some border effects in some very specific cases.

use_rating

Category: modules/rating

Enable/Disable the use of the rating system

Default value: 1

use_sem

Category: main/behavior (Advanced)

Enable/Disable "Semaphore" mechanism. This option is only used when you've choosen 'convert' as thumb_generator. It allow to restrict the number of simultaneous processes and such will limit the use of your CPU when generating all thumbnails/lowresolution pictures. This feature is still experimental, use it carrefully.

use_session

Category: main/behavior (Advanced)

Enable/Disable session authentication scheme. On some servers, it's not available/possible, and such you won't have the choice but to use the default cookie authentication mechanism. If use_session is enable, checking the 'remember me' box on the login page will use cookie instead of session authentication scheme.

Default value: 1