Jump to content

Archived

This topic is now archived and is closed to further replies.

wreckman

Requierements 4 PHP Modules Writting

Recommended Posts

Hi !

I have to write an external module for PHP....

I wanted to do it under windows first, and then port it under linux...

 

I've found a shell script called ext_skel_win32.php, and I can't make it work...

 

1) If somebody knows an other way to it, please let me know...

 

I also tried to built it under linux (Mandrake 9.1)

But I'm not sure to have a "full" working environement (I have PHP-4.3.4 sources, Bison & Flex)

 

2) What tools are needed ?

 

3) How to build an empty project ? (I think it's a good start ?!)

 

I can't even generate an empty module, here is what I did :

 

php/ext> ./ext_skel monmodule // Creates empty files

 

PHP_ARG_ENABLE(monmodule, for module support,

[--with-my-module ...

PHP_NEW_EXTENTION(monmodule, monmodule.c, $ext_shared)

// Uncommented these lines of the .m4 file

 

./buildconf --force // re-generates the .m4 file 4 configure

 

Then make fails..... (the only function inside should be the module's compilation function check)

 

(4) DID I DO SOMETHING WRONG ?

 

PLEASE GIVE ME AN ANSWER !

THANKS!!!

PS : I'm not very familiar with Zend & PHP : so don't blame me !

PS2 : Send any comments if you want to romain.fabbri@caramail.com

Share this post


Link to post
Share on other sites

First, I suggest you not use AOLbonics like '4' in place of 'for' and others as laziness is one of the attributes a programmer can _not_ afford to have.

 

Second, don't use caps, it's offensive and your question is _not_ that important.

 

Third, there are many entries on the php-dev mailing list about the basics of extension building for windows, and my ext_skel replacement will help you quite a bit.

 

Happy Hacking,

Lord Daeken M. BlackBlade

(Cody Brocious)

Share this post


Link to post
Share on other sites

Sorry, I was a bit stressed by that first big project I have to do both for work & school, (I'm a french alternating student).

 

But, thanks a lot, I'll try to take care about your advice.

Share this post


Link to post
Share on other sites
Sorry, I was a bit stressed by that first big project I have to do both for work & school, (I'm a french alternating student).

 

But, thanks a lot, I'll try to take care about your advice.

I picked up that you were not a native english speaker. I understand Cody's points, but I also get the feeling you were not trying to use "Dewdspeak" or any of the other annoying things that often help indicate that the person is just going to end up wasting our time. Also, we did outline in our forum posting guidelines that it is never ok here to mention your urgency. Nobody here could care less about the deadlines of people asking for free help.

 

With that said, one key point not to overlook, is the availability of Cody's ext_skel replacement, that he rather humbly mentioned. Read the past messages in this forum for more details.

 

Best of luck.

Share this post


Link to post
Share on other sites

:ph34r: Obviously modules are written in C (as PHP itself is written in C), but you can also use C++. You don't need anything "extra" to write modules, and don't even need CVS access if you want it to be released with core, as you can send in patches to the mailing lists for others to commit. You don't need any special software, other than a compiler (heh), and there isn't anything 'special' required besides the header files and libraries in the php core (unless you're wrapping other software, of course). Most of the times, if you write it for linux it will work in windows (if you're careful). Just try not to use libraries and such that aren't available in windows and vice versa.

 

:ph34r:

Share this post


Link to post
Share on other sites

Note: If you write a module in C++ for PHP (using VC6>), make sure you're still using the C naming conventions (/c), as not doing so will cause massive memory leaks and an ultimately failed compile.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.