Simon Laws wrote:
> On 9/12/06, Jean-Sebastien Delfino <[EMAIL PROTECTED]> wrote:
>>
>> Simon Laws wrote:
>> > On 9/8/06, Simon Laws <[EMAIL PROTECTED]> wrote:
>> >>
>> >>
>> >>
>> >> On 9/8/06, Jean-Sebastien Delfino <[EMAIL PROTECTED]> wrote:
>> >> >
>> >> > Simon Laws wrote:
>> >> > > Earlier I created a patch for a first pass at a PHP extension
for
>> >> C++
>> >> > > SCA (
>> >> > > http://issues.apache.org/jira/browse/TUSCANY-698 )
>> >> > >
>> >> > > This follows the pattern layed down by Andy with the Python
>> >> extension
>> >> > and
>> >> > > has many limitations::
>> >> > >
>> >> > > Services only. No references.
>> >> > > Basic input types only. No arrays or SDOs
>> >> > > Single valued return values only. No arrays or SDOs
>> >> > > C++ .h interface
>> >> > > Error handling is not properly tied into SCA
>> >> > >
>> >> > > I used this as an exercise to understand what Pete/Andy had
done.
>> As
>> >> > > such I
>> >> > > have taken the most basic approach to integrating with PHP
>> possible.
>> >> > > This is
>> >> > > not the way I recommend doing it in the long term. In the
>> future I
>> >> > would
>> >> > > want to change at least the following.
>> >> > >
>> >> > > The embed API needs to be replaced with the PHP SAPI
>> >> > > References should be supported using annotations and
injection
>> >> > > SDO should be supported as a databinding
>> >> > > I would prefer to go to using WSDL interface descriptions
>> >> > >
>> >> > > I have currently followed the pattern and gone with the
following
>> >> > > implementation descriptions:
>> >> > >
>> >> > > When the script just has functions
>> >> > > <implementation.phpmodule="DivideServiceImpl"/>
>> >> > >
>> >> > > When the script has classes and functions
>> >> > > <implementation.phpmodule="DivideServiceImpl"
>> class="DivideClass"/>
>> >> > >
>> >> > > I wanted to go with module="DivideServiceImpl" but the code at
>> >> present
>> >> >
>> >> > > adds
>> >> > > .componentType to the end of the module name to get the
component
>> >> type
>> >> > > information. I didn;t feel that
>> >> DivideServiceImpl.php.componentTypewas
>> >> > > right but I'm prepared to be convinced.
>> >> > >
>> >> > > In the longer term I think it may be sensible to ditch the
>> function
>> >> > only
>> >> > > approach as it makes the reference handling less obvious.
>> >> > >
>> >> > > I haven't included the build file at present because we
need to
>> sort
>> >> > > out the
>> >> > > windows build system and me adding yet another flavour of dev
>> studio
>> >> > will
>> >> > > not help. I have though included Calculator sample files that
use
>> >> the
>> >> > > extension as per Andy's sample so you can look even if you
can't
>> >> run.
>> >> > >
>> >> > > Lots more work to do but it's a start.
>> >> > >
>> >> > > Simon
>> >> > >
>> >> >
>> >> > Simon,
>> >> >
>> >> > I adjusted our Linux build to integrate your PHP extension, it
>> >> builds OK
>> >> > for me on Linux using a php-devel-5.0.4-10.5.rpm after a few
>> >> changes to
>> >> > Makefile.am (I also made a minor change to remove the dependency
on
>> >> > CPPInterface like we did in the other extensions).
>> >> >
>> >> > The build requires the following environment variables:
>> >> > PHP_INCLUDE=/usr/include/php
>> >> > PHP_LIB=/usr/lib/httpd/modules
>> >> >
>> >> > Which version of PHP did you use on Windows? I tried PHP
>> 5.1.6-2first
>> >> > but I'm guessing that you used an older PHP level on Windows
since
>> >> your
>> >> > code uses php_embed.h, which does not seem to exist anymore on
>> >> 5.1.6.2.
>> >> >
>> >> > I'm OK to stay on that older level if it's simpler for you on
>> Windows
>> >> > for now, or help build and test on a newer level. Let me know...
>> >> Thanks.
>> >> >
>> >> >
>> >> > --
>> >> > Jean-Sebastien
>> >> >
>> >> >
>> >> >
>> ---------------------------------------------------------------------
>> >> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >> >
>> >> > Hi Sebastien
>> >>
>> >> Thanks for doing the linux build and for fixing up the
dependency on
>> the
>> >> C++ extension. I really need to make a README describing how to
build
>> >> it.
>> >> The detail is a little opaque as I haven't made a patch for the
>> windows
>> >> build files yet. I'm having a little difficulty in getting the
right
>> >> version
>> >> of the Microsoft Developer Tools. Anyhow...
>> >>
>> >> I'm using PHP5.1.4 on Windows but 5.1.6 should be OK. On
windows you
>> >> will
>> >> have to get the source to get the headers but php5embed.lib is
>> provided.
>> >> Strange huh.
>> >>
>> >> To run the calculator sample you need to do a couple of things
>> >> 1/ make sure that the directory holding php5embed.lib is on the
path,
>> >> for
>> >> example, create a version of runclient.bat with
>> >> ...
>> >> set PHP_HOME= where ever PHP is installed
>> >> set
>> >>
>>
PATH=%PHP_HOME%;%TUSCANY_SCACPP%\bin;%TUSCANY_SCACPP%\extensions\cpp\bin;%TUSCANY_SDOCPP%\bin;%AXIS2C_HOME%\lib;%PATH%
>>
>> >>
>> >>
>> >> Client.exe %*
>> >>
>> >> 2/ make sure that php.ini includes a reference to the directory
which
>> >> holds the .php file you are going to run as a component, for
example,
>> my
>> >> php.ini is in the same directory as the php.exe and at the end of
the
>> >> file
>> >> I have
>> >>
>> >>
>>
>> >>
>>
include_path=".;C:\simon\Projects\Eclipse3.2\cpp\sca\samples\Calculator\deploy\packages\CalculatorComposite"
>>
>> >>
>> >>
>> >> you can use php -i to find where php is looking for you php.ini
>> >> files. 4th
>> >> or 5th line down should tell you.
>> >>
>> >> Apologies again for not yet providing a README that describes all
>> this.
>> >> I'll get to it shortly. Let me know if this doesn't help.
>> >>
>> >> Regards
>> >>
>> >> Simon
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> I should add to the wording of step "1/ make sure that the
directory
>> > holding php5embed.lib is on the path" a little more detail, i.e.
>> > "because
>> > this is the place that you will also find php5ts.dll wich is the
>> shared
>> > library that php5embed.lib provides a front end to and which
actually
>> > implements the PHP engine"
>> >
>> > S
>> >
>>
>> Simon,
>>
>> I am trying to load the PHP extension shared library on Linux and
>> getting the following error:
>> Unable to load library:
>>
>>
/home/delfinoj/Tuscany/apache-deploy/cpp/sca/extensions/php/lib/libtuscany_sca_php.so:
>>
>> /usr/lib/httpd/modules/libphp5.so: undefined symbol:
ap_loaded_modules
>>
>> Does that ring a bell? I linked libtuscany_sca_php.so with
libphp5.so,
>> am I missing a library?
>>
>> Thanks,
>>
>> --
>> Jean-Sebastien
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>> Mmmm, that's not good. The ap_loaded_modules is an HTTPD symbol. PHP
>> uses
> this in its HTTPD SAPI to find what HTTPD modules are loaded I
> believe. Not
> sure why its complaining about it in this situation as we shouldn't be
> using
> the HTTPD SAPI. Can you tell me what version of PHP you are using and
> where
> you got it from?
>
> Regards
>
> Simon
>
I was trying PHP5 1.4.10 and 1.5.6 RPMs for Linux Redhat Fedora Core
from rpm.pbone.net, then I tried to rebuild both PHP5 1.5.6 and HTTP
2.2.3 fresh from source on my machine... and still got the same problem.
I finally found the right set of build configure options to get around
this:
If I build PHP with ./configure --with-apxs2=/usr/local/apache2/bin/apxs
(like the example in the PHP INSTALL doc showing how to build to
integrate with Apache 2.0) then I get these ap_* undefined symbol
errors.
If I build PHP without the Apache 2.0 integration then the
tuscany_sca_php.so loads OK without the ap_* undefined symbol errors.
So I'm doing that for now, but what if I want to use PHP scripts in my
Apache 2.0 server now? am I just left with CGI integration?
--
Jean-Sebastien
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
I would have to try it for sure but it maybe it'l will work OK when you