Jump to content


Photo

Requierements 4 PHP Modules Writting


  • Please log in to reply
5 replies to this topic

#1 wreckman

wreckman
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 29 January 2004 - 04:28 PM

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

#2 daeken

daeken
  • Members
  • PipPip
  • Member
  • 22 posts
  • LocationChambersburg, PA

Posted 29 January 2004 - 11:51 PM

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)
Black and white are all I see in my infancy.

#3 wreckman

wreckman
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 30 January 2004 - 08:26 AM

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.

#4 gizmola

gizmola
  • Administrators
  • Advanced Member
  • 4,664 posts
  • LocationLos Angeles, CA USA

Posted 30 January 2004 - 08:44 AM

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.

#5 Derek

Derek
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts
  • LocationTennessee

Posted 11 February 2004 - 02:31 PM

: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:
function comment(s)

{

	if (i_know_what_to_do_shut_up_i_dont_need_your_help_mode) {
   return  	} else {    return s  	}  }
ext/skeleton/create_stubs, lines 40-47. - PHP Core

#6 Fordiman

Fordiman
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 11 November 2004 - 02:58 PM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users