Editing local.php

EMPS doesn't use any .yaml or .ini files to define the local configuration settings of the app. All configuration is done within the ./htdocs/local/local.php config file.

This file is excluded from the git repository, it is added to the .gitignore list, so that you don't accidentally send your local settings to a remote server and don't accidentaly include passwords and API keys into your git repository which might be public or readable by other people who are not supposed to know the secret keys.

Please note! If your app is managed by EMPS Factory on a server, you should edit the settings through the EMPS Factory. It will modify the file to include your settings and additional PHP code. If you modify the local.php file manually, it can be overwritten by EMPS Factory later.

Here is a sample local.php file in the EMPS6 repository:

Copy that file to ./htdocs/local/local.php and edit to fit your environment.

In all cases, you have to specifically set the following constants and variables:

  • EMPS_HOST_NAME, line 7 - set it to the domain name of your app (used for internal links, EMPS has to be aware of the domain name on which it runs)
  • EMPS_SCRIPT_PATH, line 19 - set it to the full absolute path to your app's htdocs folder.
  • EMPS_TZ, line 28 - the time zone of your web app (used in date/time parsing and formatting).
  • EMPS_SESSION_COOKIE_LIFETIME, line 42 - if you wish, you can change the default expiry time for session cookies. If a person doesn't come back after that number of seconds, his PHP session cookie will expire.
  • EMPS_PHOTO_SIZE, line 49 - if you plan to use the built-in image uploader for web pages and any other objects, you can set the maximum image size in this setting. The value 1920x1920|100x100|inner means: an uploaded picture should be downsized to fit a square of size 1920x1920, the default thumbnail should have the size of 100x100, when downsizing the image apply the inner calculation (the resulting image size should fit into the set dimensions). Code on GitHub →
  • $emps_db_config, line 54 - an array of MySQL database connection settings. Modify according to your server setup.
  • $emps_lang, line 72 - the default language of your web app. If you set it to, for example, de, then the template resolver will first look for *.de.htm files, and only then, if not found, will looks for *.nn.htm files. See File Structure.
  • $emps_custom_session_handler = true;, optional - add this line to enable a custom PHP session handler. Your PHP $_SESSION data will be stored in a special database table, safe from the default PHP session purges.
  • $emps_localhost_mode = true;, optional, but required for localhost setups - if the domain name which runs this app resolves to localhost (your are running this project locally on your PC), you have to enable this option, because otherwise EMPS will not let you create PHP sessions (EMPS optimizes PHP sessions on a production server - curl calls from internal heartbeat requests do not create new PHP sessions).
  • $emps_smtp_params and $emps_smtp_data - those are obsolete settings for sending e-mail messages from the server. You can either use these and the common mail/mail.class (Code on GitHub → ) or just use your own solution.
  • At the end of the file, add any other locally specific information, define constants or set variables for API keys, passwords, endpoint URLs, etc.