asgrim / example-pie-extension
Example PIE extension
Installs: 1 029
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 1
Open Issues: 0
Language:C
Type:php-ext
Requires
- php: >=7.4,^8.0
Replaces
- ext-example_pie_extension: *
This package is auto-updated.
Last update: 2024-10-09 08:44:33 UTC
README
This an example PHP module that can be installed using PIE.
Build it
Linux
The usual process applies...
PHPIZE=/usr/bin/phpize7.1
PHP_CONFIG=/usr/bin/php-config7.1
make clean
$PHPIZE --clean
$PHPIZE --force
./configure --enable-example-pie-extension --with-php-config=$PHP_CONFIG
make
make test
Windows
Prepare Windows build environment:
- Read this guide to put below into context: https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2
- Read this guide to help get the environment set up: https://gist.github.com/cmb69/47b8c7fb392f5d79b245c74ac496632c
- PHP Binary tools - use https://github.com/php/php-sdk-binary-tools (not the Microsoft one as it is not maintained)
- Once the VS tools + php-sdk-binary-tools is installed, everything is done in this shell:
- Start >
Developer Command Prompt for VS 2019
- Then
cd C:\php-sdk
- Then
phpsdk-vs16-x64.bat
- you should now have a prompt$
- Start >
- Install PHP from https://windows.php.net/download/
- Download, e.g. ZTS build, https://windows.php.net/downloads/releases/php-8.3.6-Win32-vs16-x64.zip
- Extract into
C:\php
for example
- Prepare to compile the ext
- Download "Development package" from https://windows.php.net/download/ - make sure TS/NTS depending on above compilation
- Extract to
C:\php-sdk\php-8.3.6-devel-vs16-x64
- Add
C:\php-sdk\php-8.3.6-devel-vs16-x64
to your PATH (Start >env
> Environment variables > "Path" > New) - restart the shell
Compile the extension
phpize
configure --enable-example-pie-extension --enable-debug --with-php-build="C:\php-sdk\phpdev\vs16\x64\deps" --with-prefix="C:\php\"
nmake
nmake run ARGS="-m"