System information

Embedded Scripts
Axis Communications AB provides NO support for application development of any kind. The information
here is provided "as is", and there is no guarantee that any of the examples shown will work in your
particular application.
Revision 1.02 October 2002 6
2 Embedded Scripts
The embedded scripts that can be used in Axis camera and video server products can be of 2
different types: shell scripts or PHP3 scripts. These scripts can be used for many different
purposes and can, for example, start the buffering of images or the uploading of files via FTP or
SMTP.
Scripts can be run in several different ways. One example is when the built-in Task Scheduler in
the Axis products is used to start programs or scripts when certain events occur. Another
example is when a script is run via a web page, for e.g. controlling a pan-tilt unit.
The Axis products that currently support the use of these scripts are as follows:
Product Firmware Version Shell Support PHP3 Support
AXIS 2100 2.30 or higher Yes No
AXIS 2120 2.30 or higher Yes No
AXIS 2420 2.12 Yes (from 2.20) Yes
AXIS 2400 2.20 Yes Yes
AXIS 2401 2.20 Yes Yes
2.1 PHP
PHP (Hypertext Preprocessor) was chosen as one of the scripting languages to use in Axis
camera/video products for the following reasons:
PHP is a well known and widely used scripting language. In February 2001, an estimated
23% of all Internet web servers were using PHP. (The closest "competing" script language
was Perl, which was used on about 7% of the servers).
The language syntax closely resembles Java, Perl and C, making it easy to learn for anyone
with basic programming skills.
Version 3, PHP3, can easily be scaled down to the smaller footprint required for embedded
devices.
PHP allows the rapid creation of dynamic web pages; the PHP code is simply embedded
into the HTML code. At the most basic level, PHP can do anything that any other scripting
language or CGI program can do, such as collect HTML form data and generate dynamic
page content.
PHP is a complete scripting language, with functionality such as file operations, network
sockets, an e-mail client (SMTP) and an FTP client, all of which are very useful in network
camera/video server applications.
The combination of integrated event handling in Axis Video products and a powerful scripting
language such as PHP, provides skilled developers with endless opportunities to tailor the
functionality of Axis camera/video products to fit their specific needs.
Axis has removed some of the functions from the standard PHP3, and also created some
additional functions to suit our products. The Axis modified version of PHP3 is called
PHP3-Lite. Among the functions removed are those that handle:
Database functions