OFS Installation

Installation of Open Food Source software


The OFS software is available on this site as a set of two downloadable archives – one containing the necessary files and the other containing queries to generate and populate the MySQL database.

This software is open source, licensed under the GNU General Public License, but we would like to know where it is being used so that we can provide the very best support possible. So we ask that you register and login on the current website (openfoodsource.org) in order to gain access to the download links. Once you are logged in, the download link will be available from the OFS Software menu.

Installation instructions

With the files downloaded, you will be ready to proceed as follows:

  1. Extract the openfoodsource-fs-[version].tgz archive into your filesystem just above document root. This would normally be in a directory like “/home/[sitename]/ The archive expects document root to be named public_html, so you may need to rename that directory if a different directory is expected by the web server. Additionally, an include directory “ofs_includes” will be generated above document root.
  2. Extract the openfoodsource-db-[version].tgz archive and use the SCHEMA-openfoodsource.sql query to generate the required database tables. The default setup (after v1.0.0) will preface all database tables with “ofs_”. If you need to change that value, you will need to edit all of the queries to reflect your changes. Use the DATA-[tablename].sql files to populate the various tables with some baseline and/or sample data.
  3. There are three configuration files in the ofs_includes/ directory. You must enter basic database configuration information into the config_openfood.php file. If using a WordPress front-end for your site, you may want to move your WordPress configuration into the config_wordpress.php file and include it from the standard wp-config.php in WordPress. This will provide some ability of OFS to interface with your WordPress installation. Finally, the config_override.php file should be deleted unless installed on a test server, where it provides a static set of configurations that are different between the production and test servers.
  4. For hosts where PHP is runing as an Apache module, do the following steps:
    1. Modify the .htaccess files to reflect the actual path to your ofs_includes/ directory.
    2. Ensure the product_images/ directory has write permission for the web server. It may be simplest jus to open all permissions on that directory for read/write/execute for all/user/group.
    3. Ensure the file for logging errors (errors.html, or whatever file is configured for error reporting) is writable by the web server. Give it permissions like read/write for all/user/group.
  5. For hosts where PHP is running as CGI on the server, do the following steps:
    1. Remove the “include” directive from the .htaccess file(s), either by deleting the line or commenting it out. Note: Failure to remove this line will probably cause an internal server 500 error. If entirely blank pages are loading, this could be the cause.
    2. Configure the “include” directive in a php.ini file. It will look something like this:include_path = '/home/openfoodsource/ofs_includes/:.'You might already have a php.ini file on the server, or you will need to add one in the same locations where the .htaccess files are located with the OFS distribution.
    3. There should be no need to modify permissions on the product_images/ directory or the errors.html file.

More installation details will be provided in the future. Please contact us with any questions or challenges you encounter.

Leave a Reply