What is the easiest way to distribute a PHP extension written in C

I created the extension for djondb, this is a wrapper for the library, which is a C ++ library, I compiled it, and it is available for download from the djondb website, I am not a PHP expert, and I have some problems with the distribution, basically I understand that I need to do each compilation for each platform and create an installer for each of them, which takes a lot of time, that I want it to attribute the source code and allow the user to install it in the easiest way,

What I already tried:

  • Using phpize, configure, make, sudo make install, the user can easily install the library on Linux and Mac, the problem is that users need to install g ++, make, etc. to your computers, and this installation process does not work on Windows.
  • Compile for each platform (Linux x86, x64, Mac, Windows, etc.) and upload each tar.gz to the site, upload it and put each file in the right folder. the problem is that the configuration is too manual, and users tend to skip a step, and this is not convenient. Another problem is that I need to compile each version using a virtual machine and take a lot of time. (Now I would include versions for PHP 5.3 and 5.4, which means 8 virtual machines to create all the binary files)
  • I tried to create an account on PEAR, but the registration screen always said that I did not need an account for the purpose I was creating ... (it seems that this is a common problem in the PEAR system, but could not find how to create to offer a package )
  • Was there a PECL proposal, but no one answered the mailing list, it seems that this is also very common.

So, I was stuck at this moment with 1 and 2 distribution methods, what is the best way to distribute a PHP extension created using C ++ in a user-friendly form and easy to install?

Thanks in advance, you can see the project code https://github.com/djondb/djondb_phpext if you have additional questions about how the project is structured or a full explanation of phpize / configure / make.

+6
source share
2 answers

As a PHP developer who supports the extensions we use in our company, PERFECTLY perfectly only provides the source code and expects users to compile it on their machines.

If you want to be beautiful, compiling a version for each machine that you support yourself is also a common way (see, for example, Zend) and leave it to download somewhere (for example, sourceforge / github, etc.).

Then just listen to users and improve your (graduation) system when you go.

+2
source

Take the middle road. Distribute the source for Linux / OS X users who can create them on their own and offer compiled DLLs for Windows users. This will at least limit the number of versions you need to compile.

+3
source

All Articles