Extensions

The Zend Core Extensions screen provides a convenient way to view and configure extensions.

Configuration Tab Extension Configuration

System Administrators may prefer to control the extensions loaded in their environment to make sure that only necessary extensions are loaded.

A PHP extension is a set of instructions that adds functionality to PHP. Extensions can also be employed to recycle frequently used code. You can place a set of functions into one extension and instruct your projects to utilize the extension. Another use for PHP extensions is to improve efficiency and/or speed. Some processor intensive functions can be better coded as an extension rather than straight PHP code.

Note:

The purpose of the load/unload extension option is to configure php.ini according to the extensions you would like loaded.

The Extensions screen is a configurable list of extensions built in with the Zend Core installation or extensions added to php.ini by the user. It allows you to view the status of all your extensions and enables you to quickly and easily load and unload extensions.

 

In addition, you can also configure directives associated with certain extensions. Extensions with configurable directives will have a Plus Icon [+] next to them. Click the Plus Icon [+] to expose a list of the different configurable directives associated with a particular extension.

 

When applicable, click the Reference Icon to the right of an extension to display information about the extension in the PHP manual.

When applicable, click the Help icon to view information about a particular directive.

Note:

The search directives box at the top of the screen allows you to search all the Configuration tabs for a required directive. The result will be displayed in the relevant Configuration tab. If there is more than one result, relevant results will be presented in a drop-down list to the right of the Search directives box. Selecting a directive from the drop-down list will take you to the relevant tab.

Extension Status

Extensions can have one of three different statuses:

Hovering over the lightbulb icon will display a tooltip indicating whether the status is unloaded, loaded or built in.

Note:

Extensions marked with an '!' indicate that an inconsistency occurred between the server state and the php.ini state. Possible causes are that the php.ini was changed earlier and the server was not restarted, or that the extension failed to load. To test this, try to restart the server.
Extensions and directives marked '*' have different values (or loaded/unloaded states in case of Extensions) in the php.ini file and in the running server instance. To synchronize their state/value, restart the Web Server.

 

 

Instructions on how to complete a procedure

To change an extension's status:

  1. Click the Enable or Disable Extension Switch next to the required extension.
    Built-in extensions cannot be disabled and so will not have an Extension Switch displayed.
    A notice will appear to restart the server.

  2. You can enable/disable several extensions at once.

  3. Click the Save Settings button at the top right-corner of the screen to save the changes or click the Discard Changes button to undo all changes made since the last save.

  4. To apply the changes restart the server.

    To restart your web server:
    Under Windows
    :
    Open your Apache Monitor (by default located in C:\Program Files\Zend\Apache2\bin\ApacheMonitor.exe if you installed Zend Core's bundled Apache) and select Restart.
    Under Windows Vista, you must restart the server from your Services Manager.
    Under Linux/Unix
    :
    Click the Restart Server button, found in the top-right of the Zend Core Administration GUI.

Changes will be updated in the Extension Configuration screen and will also be made in the php.ini file.

 

 

Instructions on how to complete a procedure

To configure a directive associated with an extension:

  1. Expand the list or use the search directive box to find the relevant directive.

  2. Configure the directive as required.
    You can configure multiple directives before saving.

  3. Click the Save Settings button at the top right corner of the screen to save all the changes made or use the Discard Changes button to undo all the changes made since the last save.

  4. To apply the changes restart the server.

    To restart your web server:
    Under Windows
    :
    Open your Apache Monitor (by default located in C:\Program Files\Zend\Apache2\bin\ApacheMonitor.exe if you installed Zend Core's bundled Apache) and select Restart.
    Under Windows Vista, you must restart the server from your Services Manager.
    Under Linux/Unix
    :
    Click the Restart Server button, found in the top-right of the Zend Core Administration GUI.

Changes will be updated in the Extension Configuration screen and will also be made in the php.ini file.

Note:

Directives of both loaded and unloaded extensions can be configured through the Extension configuration screen.

For a full list of extensions and their descriptions, see Appendix C - Zend Core Extensions.

Note:

Some extensions have dependencies on certain libraries.
For a full list of libraries installed with Zend Core, see Appendix D - Libraries.

Adding Extensions to Zend Core

Zend Core users can benefit from extension management capabilities for third party extensions as well as for Zend extensions. This enables users to load and unload all extensions directly from the Zend Core Configuration tab.

Disclaimer:

Zend Technologies does not provide support for third party products, including extensions. Therefore, if an issue for support arises, please remove all third party extensions by commenting out the reference to them in your php.ini before contacting the Zend Support team.

There are two types of extensions: PHP extensions and Zend extensions. The extension provider should supply information regarding the extension type (Zend or PHP). Make sure to also check the provider's documentation for possible compatibility issues, PHP version compatibility and any other additional configurations that may be required.

Note:

Zend Product extensions are managed by the Extension Manager by using the directive "zend_extension_manager.<my_extension_name>=<full_path_to_extension_location>".
Ensure that <full_path_to_extension_location> is replaced with the path to your extension's location and <my_extension_name> is replaced with your extension's name.

Operating System Compatibility:

Windows users should only use binaries compiled in non thread-safe (NTS).

 

 

Instructions on how to complete a procedure

To Add Zend Extensions:

  1. Download the extension.

  2. Place the extension in your extensions directory.
    To locate the extensions directory, open your php.ini and check the value for the directive extension_dir=.
    By default, your extensions directory will be located in:
    Windows
    :
    C:\Program Files\Zend\Core
    \lib\phpext
    Unix/Linux
    :
    /usr/local/Zend/Core/lib/php/20060613

  3. Add the following line to your php.ini:
    Windows
    : zend_extension_manager.<my_extension_name>=
    <full_path_to_extension_location>\<my_extension_name>

    Unix/Linux
    :
    zend_extension_manager.<my_extension_name>=
    <full_path_to_extension_location>/<my_extension_name>

  4. Ensure that you have replaced <full_path_to_extension_location> with the path to your extension's location and <my_extension_name> with your extension's name.

  5. Restart your web server.

    To restart your web server:
    Under Windows
    :
    Open your Apache Monitor (by default located in C:\Program Files\Zend\Apache2\bin\ApacheMonitor.exe if you installed Zend Core's bundled Apache) and select Restart.
    Under Windows Vista, you must restart the server from your Services Manager.
    Under Linux/Unix
    :
    Click the Restart Server button, found in the top-right of the Zend Core Administration GUI.

  6. Ensure that the extension is properly loaded by checking the output of PHPInfo by going to the Control Center | PHPinfo tab in Zend Core.

Note:

If you try to load a PHP extension as a Zend extension, in Linux you will receive the following error message in your server's error log: "<extension_name> doesn't appear to be a valid Zend extension."
In this case, remove it and add it as a PHP extension following the instructions under "To Add PHP Extensions", below.

 

 

Instructions on how to complete a procedure

To Add PHP Extensions

  1. Download the third party extension. Many third party extensions can be found through at http://pecl.php.net.
    Extensions are obtained directly from external web repositories.

  2. Place the PHP extension in your extensions directory.
    To locate the extensions directory, open your php.ini and check the value for the directive extension_dir=.
    By default, your extensions directory will be located in:
    Windows
    :
    C:\Program Files\Zend\Core
    \lib\phpext
    Unix/Linux
    :
    /usr/local/Zend/Core/lib/php/20060613

  3. Add the following line to your php.ini:
    Windows
    : extension=php_<my_extension_name>.dll
    Unix/Linux
    :  extension=<my_extension_name>.so
    Ensure that you replace <my_extension_name> with your extension's name.

  4. Restart your web server.

    To restart your web server:
    Under Windows
    :
    Open your Apache Monitor (by default located in C:\Program Files\Zend\Apache2\bin\ApacheMonitor.exe if you installed Zend Core's bundled Apache) and select Restart.
    Under Windows Vista, you must restart the server from your Services Manager.
    Under Linux/Unix
    :
    Click the Restart Server button, found in the top-right of the Zend Core Administration GUI.

  5. Ensure that the extension is properly loaded by checking the output of PHPInfo by going to the Control Center | PHPinfo tab in Zend Core.

 

The extensions will now appear in your Zend Core Web Administration GUI under the Extensions tab and you will be able to use the Web GUI to load and unload the extension.

Compiling extensions

Under Unix/Linux operating systems you can also create and compile your own extensions using the phpize command.

Disclaimer:

External extensions are not supported by Zend. If you encounter a problem, remove any additional extensions before contacting Zend Support.

Building PHP extensions from source requires basic UNIX skills as well as several build tools, among others:

 

 

Instructions on how to complete a procedure

To compile extensions from source:

  1. Download and extract the extension's source.

  2. Change into the extension source directory, (by default located in /usr/local/Zend/Core/lib/phpext) and run the following commands:

cd <your_extension_directory>

/usr/local/Zend/Core/bin/phpize

Ensure that you replace <your_extension_directory> with your extension directory's name.

  1. Run the ./configure command to prepare the source for compilation. You will need to include the "php-config" and "enable-shared" flags as follows:

./configure --with-php-config=/usr/local/Zend/Core/bin/php-config\

            --enable-shared

Note:

Some extensions will need additional configuration flags. It is therefore advised to run "./configure --help" and review the possible flags before compiling.

  1. Compile and install the extension binaries by running the following commands:

make

make install

Make install should install the new .so extension binary in Zend Core's extension directory.

  1. Add the following line to your php.ini to load your new extension:  

extension=<my_extension_name>.so

Replace <my_extension_name> with your extension's binary name.

  1. Restart your web server.

  2. Ensure that the extension is properly loaded by checking the output of PHPInfo. This can be viewed in the Control Center | PHPinfo tab in Zend Core.

The extension will now appear in your Zend Core Web Administration GUI under the Extensions tab and you will be able to use Zend Core Web GUI to load and unload the extension.

 

 

Related Links

Related Links:
Configuration

Appendix C - Zend Core Extensions

Appendix D - Libraries

PHP

PHPinfo

Misc. Directives

Extensions