[fpc-pascal] FPC to create PHP extensions for Linux

md at rpzdesign.com md at rpzdesign.com
Sun Jun 2 15:04:41 CEST 2013


Ok:

After a night of dwelling on the problem, the easiest solution is to create
your linux dynamic libraries as a standalone separate lib.so library in 
free pascal
and then use C to create the php extension and link it to the freepascal 
library.

Trying to keep up with all of the PHP headers is a real pain in the ass 
so just
use the extension environment to wrap the Pascal library is the best way.

This is identical to the mysqli interface where the extension links in 
the libmysqlclient.so.xx library
into the php binary.

Hope this helps anyone doing this sort of thing.

md

On 6/1/2013 6:45 PM, md at rpzdesign.com wrote:
> Anybody have an opinion about writing dynamic extensions for PHP in 
> free pascal?
>
> The samples and discussion at:
>
> http://community.freepascal.org/bboards/message?message_id=342130&forum_id=24082 
>
>
> Indicates PHPToolkit, but all of the definitions inside these file are 
> way out of date.
>
> My current PHP version is 5.4.10 and the compiler directives deal with 
> 5.2.x at the highest.
>
> And the API version is 2001xxxx while the current is 20100525 and higher.
>
> So either I have to inspect the header files in PHP to see what 
> changes have been made
> and then do a bunch of testing on struct sizes so I have the header 
> files ported correctly.
>
> And it also does not seem to handle 64 bit linux that well since there 
> are a lot of records with
> Word sizes (16 bit) but I need unsigned long int values. (Cardinal)
>
> So if anybody has done anything recent with this on a more recent 
> version of PHP, pass along
> a shout out.
>
> Thanks for any answer,
>
> md
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>




More information about the fpc-pascal mailing list