Table of Contents

PHP extension

This page is about the development of PHP extension in C++.

The official documentation about extensions on the official PHP web site is only about PHP 5, not PHP 7. The examples may compile properly under PHP 7, but they will not work properly.

See http://wiki.php.net/phpng-upgrading.

Installation

Compilation

In the C/C++ source files you may found on the web, if there is a compilation error on function_entry, replace it with zend_function_entry.

Macros

Windows

Macros definitions which seems to be needed for compilation under Windows :

The last one is only needed to compile in TS mode, not for the NTS mode.

Linking

Windows

You have to link against <php>/Release_TS/php5ts.lib (obviously for the thread-safe version).

Activation

You have to :

In order for the extension yo be recognized, verify that :

Misc