microsoft / php-sdk-binary-tools

Tool kit for building PHP under Windows
BSD 2-Clause "Simplified" License
270 stars 79 forks source link

README: add phpize and examples about extension #48

Closed vjardin closed 5 years ago

vjardin commented 5 years ago

Another benefit of this nice framework is to be able to generate and then to compile any standalone PHP extension (module).

It is mostly thanks to the phpize.bat tool that has been made available.

TBC: should we add ext_skel.php and its template into the deliverable of this SDK (c:\php\SDK\TBD) ?

msftclas commented 5 years ago

CLA assistant check
All CLA requirements met.

vjardin commented 5 years ago

Please, what is the process to get the integration of this pull request ?

pierrejoye commented 5 years ago

I am not sure how this happens but this is not what happens for the php-sdk tools (which I wrote) and scripts.

On Thu, Jan 3, 2019, 8:51 PM Microsoft Contribution License Agreements < notifications@github.com wrote:

[image: CLA assistant check] https://cla.opensource.microsoft.com/Microsoft/php-sdk-binary-tools?pullRequest=48 Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement https://cla.opensource.microsoft.com/Microsoft/php-sdk-binary-tools?pullRequest=48 before we can accept your contribution.

❌ vjardin sign now https://cla.opensource.microsoft.com/Microsoft/php-sdk-binary-tools?pullRequest=48 You have signed the CLA already but the status is still pending? Let us recheck https://cla.opensource.microsoft.com/check/Microsoft/php-sdk-binary-tools?pullRequest=48 it.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Microsoft/php-sdk-binary-tools/pull/48#issuecomment-451148330, or mute the thread https://github.com/notifications/unsubscribe-auth/AARPKAkCaESa5FDn3prXSP5dicxW5Ivlks5u_gr-gaJpZM4ZoH32 .

weltling commented 5 years ago

@vjardin thanks for the PR, I just came to review it. While it might work the way you do it, it was never intended. The way it should be done involves the usage of the development packages provided with the https://windows.php.net/downloads/releases/. It should not be necessary to compile the PHP core for that, that's the basic principle. To generate an extension one currently indeed needs the core to be checked out. Otherwise, phpize say on Linux never require to have the whole php-src. Of course, on a more advanced level it could be done, say by using a custom php installed into a prefix. However that's not the basic case that is concerned.

Also I think it's great that you go for making a sample extension and documenting some ways to compile it. However IMO this effort should go into the php.net documentation and not be spread over random resources on GitHub or elsewhere. Also with the regard to the binary SDK - it only provides a toolset, the actual documentation for building PHP on Windows is located under https://wiki.php.net/internals/windows. That's where the efforts should go.

Thanks.

vjardin commented 5 years ago

Thanks for all the advises since I am quite new with the community. I'll review them carefully and I'll check how to apply them.

vjardin commented 5 years ago

Regarding an out of tree compilation of the extensions, I feel that https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2 does not provide the complete solutions. Can I add phpize tips on this page ?

weltling commented 5 years ago

@vjardin contributions in this area are actually quite badly wanted. Specifically the documentation wrt. Windows build and ecosystem. These efforts are always welcome. FYI there are also specific mailing lists where things can be discussed, for Windows there's also #winphp-dev channel on freenode. Tthanks!

weltling commented 5 years ago

@vjardin oh, and regarding your second comment - perhaps it would make sense to create a new page for that. The stepbystep one is about the core build, so that's fine as it is. Please put some draft to discuss on the Windows mailing lists first, so more people are involved.

Thanks.

vjardin commented 5 years ago

Got it. But which mailing list https://pecl.php.net/support.php#lists ?

weltling commented 5 years ago

There are some here http://php.net/mailing-lists.php, but i think internals-win@ would be appropriate in first place.

Thanks.

weltling commented 5 years ago

@vjardin perhaps more to illustrate here https://github.com/krakjoe/sandbox/blob/develop/.appveyor.yml.

Thanks.

vjardin commented 5 years ago

@weltling Anatol: I'll update the PHP wiki, but first I need to make sure that I get it right. Per your advise, I was able to describe how to build any PHP module without recompiling PHP source code too. I made an update to my notes here, but I need to hack the configure.js in order to avoid the checks for re2c, bison, etc. which are not mandatory in fact. Is there a better way ?