ChartDirector 7.0 (PHP Edition)

Appendix - PHP Concepts


This document introduces some PHP concepts and features that may be useful for ChartDirector installation.

phpinfo - Obtaining PHP Configuration Information

phpinfo is a standard PHP function for obtain detail information about the PHP system. To use it, simply create a PHP file on the web server that contains only one line as follows:

<?php phpinfo() ?>

When the above PHP file is accessed with a browser, and it will display the PHP configuration.

php.ini - PHP Configuration File

PHP configurations are stored in a text file called the PHP configuration file. The filename is usually "php.ini" but sometimes a different file name is used. You may use phpinfo to find out the exact location and name of your PHP configuration file.

Considerations for Shared Hosting

If you are using shared hosting, you may not have write access to the system "php.ini" file. Many hosting companies nowadays allow the web site owner to set up custom "php.ini" that applies to the web site only.

The exact details of custom "php.ini" depends on the hosting service. It may be just a file "php.ini" in the web site document root or in the directory that contains the PHP scripts. Some hosting services may use a different directory or file name. Some hosting companies may not advertise this feature, and you may need to ask for it, or check the forum or FAQ of the hosting company for information.

In some cases, the "php.ini" is non-writable, but internally it loads another file that is writable to allow customization. Since the "php.ini" is almost always readable, you can examine the "php.ini" to determine if it includes such a file. If you cannot access the file with FTP or the command shell, you can always write a PHP script to read and display the file.

If you have not yet decided on a hosting company, it is suggested you choose one that supports custom "php.ini". You may also choose a hosting plan that allows root or superuser access, such as various types of "virtual private server" hosting.

PHP Extension Directory

The PHP extension directory is the default directory for storing PHP extension DLLs or shared objects. It is configured using the "extension_dir" statement in php.ini. You may use phpinfo to find out where is your PHP extension directory.

If a PHP extension DLL or shared object is configured by providing just a filename, PHP will assume it is located in the PHP extension directory. If an an absolute pathname is used, PHP will use the absolute pathname instead.

If the PHP extension directory itself is set to a relative path (such as "./"), it will be confusing where the PHP extension directory is relative to. Depending on how the PHP system is set up, it can be relative to the PHP script directory, the PHP interpreter directory, the web server executable directory or other directory. To avoid confusion, it is best to configure the PHP extension directory with an absolute path.