What are first steps creating a loadable DLL module extension for PHP to create native support for my own library on Windows?
Would it require re-compiling PHP on windows? What are the tools needed? I don't want to have to use exec and the command line.
On Windows, you have two ways to load a PHP extension: either compile it into PHP, or load the DLL. Loading a pre-compiled extension is the easiest and preferred way. To load an extension, you need to have it available as a ". dll" file on your system.
php file extension refers to the name of a file with a PHP script or source code that has a ". PHP" extension at the end of it. It's similar to a Word file with a . doc file extension.
extension_dir = <PATH TO EXTENSIONS>: The extension_dir points to the directory where the PHP extensions are stored. The path can be fully qualified (for example, C:\PHP\ext ) or relative (for example, . \ext).
See for the basic steps to compile PHP or PHP extensions:
https://wiki.php.net/internals/windows/stepbystepbuild
Q. Would it require re-compiling PHP on windows?
A. Not necessarily, but it is the simplest way.
The command line is your best friend (apple, after years of GUI improved MACOS by ... readding the shell back)
I would try the following:
A. Setup a mingw-msys build system on win.
B. Follow PHP Extension Manual:
1. Download PHP Source code
2. Build PHP for Extension Development using the above MSYS
3. Generate a extension skeleton using ext_skel your extension will reside in ext/ directory
4. Edit the config.w32 (is a javascript macro system for Makefile generation similar to m4)
...
Continue by following these:
http://www.php.net/manual/en/internals2.php
http://talks.somabo.de/200610_zend_conf_php_extension_development.pdf
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With