System requirements

To install OpenX you will need:

  • A web server which has support for PHP; and
  • A database server, either MySQL or PostgreSQL.

This page describes the following requirements:

Web Server

OpenX is tested with an Apache web server in a Linux environment. OpenX will work with other web servers that support PHP but these are not tested or supported by OpenX.

PHP Support

OpenX is fully compatible with PHP 4.3.11 and higher, including when the "register_globals" setting is turned on.

PHP versions

PHP version Supported RAM required Comments
4.3.11 Yes 16 MB Security issues
4.4.2 Yes 16 MB Recommended
5 Yes 16 MB Recommended
5.1 Yes 24 MB Recommended
5.2 Yes 24 MB Recommended

PHP modes

You can install and run PHP in different modes, depending on your web server.

Run PHP as an Apache module (Mod PHP), which is more efficient than running in CGI-binary mode.

Microsoft IIS is not supported. Users report success using IIS 5.1 and IIS 6.0 with PHP running in Fast CGI mode.

PHP configurations

OpenX uses the default PHP settings. However, server administrators sometimes change these settings. Before you install OpenX check that the following settings are correct:

  • magic_quotes_runtime must be off
  • safe_mode must be off
  • register_argc_argv must be on if you want to run maintenance via command line
  • file_uploads need to be turned on to allow HTTP file uploads

OpenX requires the following PHP extensions:

  • Either the "mysql" extension, or the "pgsql". The "mysqli" extension is not supported.
  • OpenX needs the ZLib extension to convert links inside compressed Flash files generated by Flash MX.
  • OpenX uses the FTP extension. If the FTP extension is not present, OpenX will try to simulate it, which can be less stable.
  • OpenX 2.6 requires the GD extension to generate graphs on the Home page. If the extension is not enabled you will not be able to view graphs or statistics on your Home page.
  • To log on to the Home page, you require either the openssl extension or an SSL-enabled curl extension. If SSL is not enabled you will receive an error message in the Home page, but there is no impact on operations.

If you intend to target delivery based on browser or operating system, then you must enable phpSniff.

PHP time zone configuration

OpenX performs many time-based operations which rely upon the server time zone. You can configure this in PHP:

  • If you are using PHP 5.1 or 5.2 set the correct timezone in your php.ini file:
date.timezone = Europe/London
  • If you are using PHP 4.3, 4.4 or 5.0 export the TZ environment variable in your web server configuration. If you are using an Apache web server, do this using the SetEnv directive in httpd.conf:
SetEnv TZ Europe/London
  • If you do not have access to set the time zone on your server, ask your system administrator or your hosting provider to set this up for you.
  • Alternatively, you can call "date_timezone_default_set()" on PHP 5.1 and PHP 5.2 or you can set "date.timezone" in a .htaccess file.

OpenX can be installed without the PHP time zone setup. OpenX will make a best guess about which time zone your server is in. You can then select a time zone manually if it is wrong. However, OpenX strongly recommends that you set up the time zone in PHP correctly.

Accurate timing is especially important if you are running OpenX on more than one server. Configure you server with a NTP (Network Time Protocol) service to ensure that your server clocks are synchronized. See your operating system documentation for more information.

Database Server

OpenX supports being installed with either MySQL or PostgreSQL.

N.B. We recommend that you install OpenX on a database with UTF-8 encoding.

Database Account

You can set up your database for OpenX in any of the following ways:

  • Create a new database for OpenX.
  • Create a new database account for OpenX.
  • Use an existing database account and prefix the OpenX tables to distinguish them from other tables. This approach is not recommended.
    OpenX recommends that you create a database account specifically for use with OpenX.

MySQL

Database versions

OpenX is tested on the three latest versions of MySQL.

  • The latest stable version of MySQL (currently version 5.0) is recommended.
  • The earliest supported version of MySQL is 4.0.18.
  • MySQL 3.x is not supported.

Database Permissions

When installing on MySQL, the following database permissions are required:

  • SELECT
  • INSERT
  • UPDATE
  • DELETE
  • CREATE TABLE
  • CREATE TEMPORARY TABLE*
  • DROP TABLE
  • CREATE INDEX
  • DROP INDEX
  • LOCK TABLES

* - Some hosts do not grant the Temporary Table permissions by default. Please check with your server administrator first.

Table Types

OpenX can use either the MyISAM or InnoDB table types. Please see the documentation on the different supported MySQL Table Types, to ensure that you select a table type that is appropriate for your installation.

PostgreSQL

Database versions

OpenX is tested on the three latest versions of PostgreSQL.

  • The latest stable version of PostgreSQL. (currently version 8.3) is recommended.

Database permissions

To install OpenX on PostgreSQL the following database permissions are required:

To be fully defined. For now it's safest to use the "root" PostgreSQL user.
OpenX requires that the PL/PgSQL language be installed onto the database you are going to use. Otherwise you need to install using the "root" PostgreSQL user so that this language can be created.

MySQL table types

It is important for users of OpenX to ask the question: if I run OpenX on MySQL, is it best to use the MyISAM or the InnoDB storage engine?

General recommendation

In general, using the MyISAM storage engine is recommended.

However, if performance is important to you and you want to get the most out of your OpenX installation, some knowledge and thought is required. The aim of this section is to provide OpenX administrators with all the information required to make an informed decision regarding which MySQL storage engine to use.

The MyISAM storage engine

The MyISAM storage engine has one big advantage over InnoDB - speed. The MyISAM storage engine is about as fast as it gets, which makes it ideal for simple databases where you want to read and write data very quickly. This is obviously a good thing for OpenX, because fast read speeds mean that data relating to banner delivery can be obtained quickly. Fast write speeds mean that banner delivery logging is quick as well. Both of these add up to fast banner delivery to your web site(s).

However, this speed comes at a cost. Specifically:

  • There is no transaction support; and
  • Write operations result in table-level locking.

Transaction Support Issues

As a general rule, OpenX has been written to operate without needing transaction support. In areas of the code where they would normally be employed, the code itself has been written to emulate transactions as far as is possible when using the MyISAM storage engine.

However, if you are using the MyISAM storage engine for your OpenX tables and your database crashes while the maintenance script is running, this might result in a situation where the statistics and priority values are inconsistent. If this occurs, once the database is running again delivery may not work correctly until the next time maintenance runs.

N.B. if your database crashes you already have problems with your server. Perfect delivery isn't something that can be guaranteed in this situation.

Table-Level Locking

The issue of table-level locking is the main downside to using the MyISAM storage engine for OpenX. Whenever OpenX needs to write to a table that table is locked, and no other writes can be made to the table at the same time. This means:

  • When a banner is being delivered and the impression is being logged to the database, all other banners being delivered at the same time will have to wait before they can try to log their impression to the database. Thus, as you deliver higher and higher volumes of banners the speed of delivery will decrease, as more and more banners have to wait for their turn to write to the database.
  • More importantly, when the maintenance engine runs to summarise your delivery statistics all banner delivery will be delayed while the maintenance engine has the raw logging table(s) locked. If the maintenance engine takes minutes to run, especially when summarising your statistics or performing conversion tracking, then your OpenX ad server may effectively be "down" for this period!

Of course, for the average OpenX installation this will never be an issue. Most OpenX installations don't deliver enough banners per second to see the effect of table-level locking, and their maintenance script only takes a few seconds to summarise their statistics. In these instances banner delivery is barely affected when maintenance runs.

This is why it is recommended that the average OpenX user use the MyISAM storage engine.

Further Reading

It is possible to perform appropriate performance monitoring of your server(s) and tuning of OpenX to ensure that, for example, the maintenance engine does not take too long to run. If you intend to use the MyISAM storage engine it is recommended that you read our Performance Tuning section.

See also the MySQL documentation regarding the MyISAM storage engine.

The InnoDB Storage Engine

Reading and writing using the InnoDB storage engine is much slower than with MyISAM. However, there are still some good reasons to consider using InnoDB for your OpenX database tables:

  • With appropriate hardware (plenty of power and fast disk drives, preferably in a striped RAID configuration) InnoDB can be more than fast enough for rapid banner delivery, albeit at increased hardware cost compared with using the MyISAM storage engine.
  • The fact that InnoDB supports row-level locking means that delivery of banners from OpenX will not suffer in the event that the maintenance process takes a "long" time to run. See the discussion on table-level locking above (in the MyISAM section).

If you intend to run an OpenX installation that is going to:

  • Serve several million banner impressions per day;
  • Will have a dedicated database server attached to a cluster of web servers; or
  • Will be used to carry out conversion tracking

then it is recommended that you consider whether the InnoDB storage engine might be more suitable for your needs.

Ultimately, if you are going to be running a high volume system it is recommended that you prepare a staging environment. This will allow you to experiment with both storage engines alongside your hardware and your delivery configuration to see how well they perform for you.

Further Reading

See the MySQL documentation regarding the InnoDB storage engine.

Has the Recommended Type Changed?

The InnoDB storage engine used to be recommended for "Max Media Manager" users, as earlier versions of OpenX were only intended for very high volume installations. Now that "Max Media Manager" has been merged into the main OpenX branded code base and released to the general public for use by the OpenX community, the recommended table type has been updated to take the average user's requirements into account.

If you are a high volume user please read the section above on the InnoDB storage engine, as you might find that the default recommendation does not meet your needs.