System information
An Introduction to PHP3
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 26
4.2 PHP3 script examples
The complete PHP3 scripts shown here can be used for the most common applications. The
scripts can also be downloaded from the Axis web site at www.axis.com.
PHP Scripting Tips
• To use a browser for debugging your scripts, write the log messages as html.
• To log a message to syslog (enabled by default), include in the script:
log_error(mymessage,0);
• To disable logging, include the row: error_reporting (E,0);
• To enable it again, include: error_reporting (E,ALL);
4.2.1 Example 1 – PTZ Control
The purpose of this example is to make a PHP3 driver for a pan-tilt unit. An html interface is
used to control the camera. The example is written for the Axis 2400/2401Video Server and a
Pelco pan-tilt unit, and will, with minor changes, work on most pan-tilt units.
All the files in this example are available on the Axis website. We will only show the script parts
that are important to understanding the example.