Hello,

I'm working with a real simple (test) PHP extension, however I've run into
some problems when trying to build it.

My situation, on a RH 7.3 box, is that of Apache 2/PHP 4 (which has run
flawlessly for months, with MySQL 4, by the way) and a CVS snapshot (from
last night).  I have two seperate source trees (ie, one for Apache DSO,
/root/build/php-4.2.3 and one local to my user, as a CLI, ie /home/me/php4/).
 Both build and install/work fine (DSO to /usr/local/php/ and CLI to
/home/me/psh/)

Using /home/me/php4/, I followed the instructions at php.net/zend for
creating and building a sample extension (./ext_skel, ... etc) which
successfully built and worked - no problems.  However, I now want to attempt
to load that into the DSO version, under Apache.  Apache throws:

Module compiled with module API=20020429, debug=0, thread-safety=0
PHP    compiled with module API=20020429, debug=0, thread-safety=1

Now I realize I'm in the wrong (I should build the extension against the same
source tree as PHP itself is from), however I'm confused about somethings
(especially since, all things apparently equal, thread-safety is the only
issue here):

-- From reading php.net/zend it appears that when using the ./ext_skel
method, followed by a ./configure and a make, that I'm rebuilding all of PHP.
 Is this true, and/or is this the Best Way to development portable,
production quality modules?

-- So, I've come across the ./phpize method, which when given a generic
config.m4 file and some source, will create streamlined ./configure and
support files.  Then, just a ./configure --enable-mything
--with-php-config=/somehwere builds a nice loadable object.  But, is this
method deprecated?

-- It seems, that the only reason Apache couldn't load my extension, was
because of thread safety.  Since I've been using the php4 CVS source tree, I
had recompiled it --with-tsrm-pthreads (and as CLI - does this make sense?),
in the hopes that when building my extension against it, thread-safety would
be 1.  No luck.

-- Is it possible to explicitly tell an extension to compile thread-safe? 
Using either the phpize or ext_skel methods?

Clarification on these seemingly "different" build methods, which is best
going forward for portable, production quality extensions, and whether it's
possible to force an extension into qualifying as thread-safe, would be
appreciated.  [ The fact that an extension is truely thread-safe or not, I
realize is entirely different - I'm speaking of thread-safety=1 as a PHP
check ]

Thank you much,


=====
Hans Zaunere
New York PHP
http://nyphp.org
[EMAIL PROTECTED]

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to