public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: PHP Apache module with PostgreSQL support
       [not found] <IOEFIOCBAFPGBCJCLFMECEAMCDAA.news.Andreas@gmx.net>
@ 2002-09-07  9:07 ` cygwin
  2002-09-07 13:03 ` Jason Tishler
  1 sibling, 0 replies; 10+ messages in thread
From: cygwin @ 2002-09-07  9:07 UTC (permalink / raw)
  To: cygwin-apps; +Cc: cygwin

Redirecting to the proper mailing list.

On Sat, Sep 07, 2002 at 12:34:01PM +0200, Andreas wrote:
>Hello list!
>
>I downloaded the mod_php4 package and modified Apache's httpd.conf file but
>was not able to start Apache properly:
>API module structure 'php4_module' in file
>/usr/local/apache/libexec/libphp4.dll is garbled - perhaps this is not an
>Apache module DSO?
>
>After this I decided to build PHP from source but a problem appeared during
>the installation described below. I followed the steps pointed out in
>php-4.2.0-1.README that are:
>
>  tar xjvf apache-php-X-Y-src.tar.bz2			[1]
>  patch -p0 < php-X-Y/CYGWIN-PATCHES/php-X-Y.patch	[2]
>  cd php-X-Y							[3]
>  autoconf								[4]
>  ./configure --with-apxs					[5]
>  make								[6]
>  cd sapi/apache/.libs						[7]
>  ../../../CYGIN-PATCHES/mkdll.sh libsapi.la \
>    -L ../../../.libs -lphp4 \
>    /usr/bin/cyghttpd.dll					[8]
>  mv cygsapi.dll libphp4.dll					[9]
>  /usr/sbin/apxs -i -a -n php4 libphp4.dll  		[10]
>
>The process of creating the cygsapi.dll [8] stopps after a list of
>"undefined reference to..." messages with following error:
>collect2: ld returned 1 exit status
>
>It would be great if someone could give me a hint in order to bring the PHP
>module up and running.
>
>In fact I want to implement PostgreSQL support for PHP. I also tried to
>configure PHP with the required options:
>./configure --with-apxs --without-mysql --with-pgsql
>
>This process terminates with:
>...
>checking for PostgreSQL support... yes
>configure: error: Cannot find libpq.so. Please specify correct PostgreSQL
>installation path
>
>Of course there are no *.so files available under Cygwin. Is there a patch
>to fix that, or under which topic I should search  for in the mailing list?
>
>All packages are installed with Cygwin's setup.exe. Additionally the sources
>of Apache and PostgreSQL are hosted in:
>/usr/src/apache_1.3.24-5
>/usr/src/postgresql-7.2.1-2
>
>Are there any further steps necessary for the combination
>Apache/PHP/PostgreSQL under Cygwin?
>
>Thank you in advance!
>Regards, Andreas
>

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: PHP Apache module with PostgreSQL support
       [not found] <IOEFIOCBAFPGBCJCLFMECEAMCDAA.news.Andreas@gmx.net>
  2002-09-07  9:07 ` PHP Apache module with PostgreSQL support cygwin
@ 2002-09-07 13:03 ` Jason Tishler
  1 sibling, 0 replies; 10+ messages in thread
From: Jason Tishler @ 2002-09-07 13:03 UTC (permalink / raw)
  To: cygwin

Andreas,

On Sat, Sep 07, 2002 at 12:34:01PM +0200, Andreas wrote:
> In fact I want to implement PostgreSQL support for PHP. I also tried
> to configure PHP with the required options:
> ./configure --with-apxs --without-mysql --with-pgsql
> 
> This process terminates with:
> ...
> checking for PostgreSQL support... yes
> configure: error: Cannot find libpq.so. Please specify correct PostgreSQL
> installation path
> 
> Of course there are no *.so files available under Cygwin. Is there a
> patch to fix that, or under which topic I should search  for in the
> mailing list?

None that I know of, but I never really looked...

> Are there any further steps necessary for the combination
> Apache/PHP/PostgreSQL under Cygwin?

I would try pgsql-cygwin@postgresql.org -- someone there may be able to
help.

Jason

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: PHP Apache module with PostgreSQL support
  2002-09-18 14:56                 ` AW: " Andreas
@ 2002-09-20  4:29                   ` Jason Tishler
  0 siblings, 0 replies; 10+ messages in thread
From: Jason Tishler @ 2002-09-20  4:29 UTC (permalink / raw)
  To: Andreas; +Cc: cygwin

Andreas,

On Wed, Sep 18, 2002 at 11:04:03PM +0200, Andreas wrote:
> It won't work with the flag -lxml. What flag should I specify instead?

I don't know and wouldn't without trying it myself.  Sorry, but I have
helped you as much as I can.

Jason

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: PHP Apache module with PostgreSQL support
       [not found] <7424935D9B6CD311B72800508B108FD20D1767A5@emss03m08.orl.lmco.com>
@ 2002-09-19  9:44 ` Andreas
  0 siblings, 0 replies; 10+ messages in thread
From: Andreas @ 2002-09-19  9:44 UTC (permalink / raw)
  To: Zieg, Mark, cygwin

> > The error about crypt doesn't appear any more just lines complaining
> > undefined references to the xml extension.
> > ...
> > It won't work with the flag -lxml. What flag should I specify instead?
>
> I don't actually know -- I'm not into PHP -- but on a guess you might try
> installing "expat" from the Libs section and using -lexpat.  That's the
> "standard" XML library, AFAIK.

It doesn't work. The same output occurs like without the -lexpat flag.

The expat package (1.95.4-1) was installed with Cygwin's setup.exe. There's
no libexpat.dll (but a (/usr/bin/)cygexpat-0.dll)...

Does it require to rerun configure (with the provided --with-expat-dir
option)?
<config.log without expat option contains>
...
configure:73895: checking whether to enable XML support
configure:73934: result: yes
configure:73944: checking external libexpat install dir
configure:73984: result: no
configure:74689: checking for XMLRPC-EPI support
configure:74729: result: no
configure:74739: checking libexpat dir for XMLRPC-EPI
configure:74779: result: no
configure:77862: checking whether to enable xslt support
configure:77901: result: no
configure:77911: checking for XSLT Sablotron backend
configure:77951: result: no
configure:77961: checking libexpat dir for Sablotron XSL support
configure:78001: result: no
...

Output with configure option --with-expat-dir:
...
checking external libexpat install dir... yes
configure: error: not found. Please reinstall the expat distribution.

Should I do this by using setup.exe or...
Following files are available:
/lib/libexpat.a
/lib/libexpat.dll.a
/lib/libexpat.la
/usr/include/expat.h
/usr/bin/cygexpat-0.dll
/bin/xmlwf.exe

Regards,
Andreas



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: PHP Apache module with PostgreSQL support
  2002-09-18 13:05             ` Andreas
@ 2002-09-18 14:01               ` Jason Tishler
  2002-09-18 14:56                 ` AW: " Andreas
  0 siblings, 1 reply; 10+ messages in thread
From: Jason Tishler @ 2002-09-18 14:01 UTC (permalink / raw)
  To: cygwin

Andreas,

On Wed, Sep 18, 2002 at 09:38:12PM +0200, Andreas wrote:
> I read this in (/usr/doc/Cygwin/)php-4.2.0-1.README:
>   ../../../CYGIN-PATCHES/mkdll.sh libsapi.la \
>     -L ../../../.libs -lphp4 \
>     [addional -lfoobar ld flags] \
                ^^^^^^^^

The above seems important.

>     /usr/bin/cyghttpd.dll
> 
> I tried:
>   ../../../CYGIN-PATCHES/mkdll.sh libsapi.la \
>     -L ../../../.libs -lphp4 -lpq \
>     /usr/bin/cyghttpd.dll
> 
> output:
> gcc -shared -o
> cygsapi.dll -Wl,--out-implib=libsapi.dll.a -Wl,--export-all-symbols -Wl,--wh
> ole-archive libsapi.al -Wl,--no-whole-archive -L ../../../.libs -lphp4 -lpq
> /usr/bin/cyghttpd.dll
> Creating library file: libsapi.dll.a
> ../../../.libs/libphp4.a(crypt.lo): In function 'zif_crypt':
> /usr/src/php-4.2.0-1/ext/standard/crypt.c:161: undefined reference to
> 'crypt'

The above implies that you need -lcrypt.

> ../../../.libs/libphp4.a(xml.lo): In function 'zm_info_xml':
> /usr/src/php-4.2.0-1/ext/xml/xml.c:236: undefined reference to
> '_imp__php_XML_ExpatVersion'
> ...

The above implies that you need more -l options.

Jason

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: PHP Apache module with PostgreSQL support
  2002-09-18  5:24           ` Jason Tishler
@ 2002-09-18 13:05             ` Andreas
  2002-09-18 14:01               ` Jason Tishler
  0 siblings, 1 reply; 10+ messages in thread
From: Andreas @ 2002-09-18 13:05 UTC (permalink / raw)
  To: cygwin

> > It doesn't work that way:
> >   ../../../CYGIN-PATCHES/mkdll.sh libsapi.la \
> >     -L ../../../.libs -lphp4 \
> >     /usr/bin/cyghttpd.dll /usr/bin/pq.dll		[8]
>                             ^^^^^^^^^^^^^^^
>
> One should *not* link against DLLs directly -- one should link against
> the corresponding import libraries instead.  Use "-lpq" instead of
> "/usr/bin/pq.dll" above.  BTW, the "/usr/bin/cyghttpd.dll" is suspect
> too.

I read this in (/usr/doc/Cygwin/)php-4.2.0-1.README:
  ../../../CYGIN-PATCHES/mkdll.sh libsapi.la \
    -L ../../../.libs -lphp4 \
    [addional -lfoobar ld flags] \
    /usr/bin/cyghttpd.dll

I tried:
  ../../../CYGIN-PATCHES/mkdll.sh libsapi.la \
    -L ../../../.libs -lphp4 -lpq \
    /usr/bin/cyghttpd.dll

output:
gcc -shared -o
cygsapi.dll -Wl,--out-implib=libsapi.dll.a -Wl,--export-all-symbols -Wl,--wh
ole-archive libsapi.al -Wl,--no-whole-archive -L ../../../.libs -lphp4 -lpq
/usr/bin/cyghttpd.dll
Creating library file: libsapi.dll.a
../../../.libs/libphp4.a(crypt.lo): In function 'zif_crypt':
/usr/src/php-4.2.0-1/ext/standard/crypt.c:161: undefined reference to
'crypt'
../../../.libs/libphp4.a(xml.lo): In function 'zm_info_xml':
/usr/src/php-4.2.0-1/ext/xml/xml.c:236: undefined reference to
'_imp__php_XML_ExpatVersion'
...
...
...
collect2: ld returned 1 exit status

How can I perform that step?

Andreas



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: PHP Apache module with PostgreSQL support
  2002-09-17 10:20         ` AW: " Andreas
@ 2002-09-18  5:24           ` Jason Tishler
  2002-09-18 13:05             ` Andreas
  0 siblings, 1 reply; 10+ messages in thread
From: Jason Tishler @ 2002-09-18  5:24 UTC (permalink / raw)
  To: Andreas; +Cc: cygwin

Andreas,

On Tue, Sep 17, 2002 at 05:51:43PM +0200, Andreas wrote:
> > Then you may need to patch config.m4 instead (again, I have not
> > checked the source).  The bottom line is that under Cygwin the check
> > for the existence of the pq library must look for either libpq.a
> > (i.e., import library) or pq.dll (i.e., shared library).  Choose the
> > one that minimizes the patch.
> 
> Thanks a lot Jason! That's it!

You are welcome.

> I thought the applied patch will modify the configure script to make it
> cygwin compatible...

I believe (again, without checking the source) that it does or will...

> In case that someone is interested in how to deal with this:
>   apply the patch:
>     patch -p0 < php-X-Y/CYGWIN-PATCHES/php-4.2.0-1.patch	[2]
>   search for libpq.so in the configure script and simply rename it to
> libpq.a.

The above is *not* the right way to do it!  configure is a generated
file and should not be hand edited.

> The php-4.2.0-1.patch contains lines that check for libpq.a but they
> have no effect on the configure script.

My WAG is that you need to rerun autoconf.  That is the right way to
"change" (i.e., regenerate) configure.

> The next hurdle is the mkdll.sh command. I don't know how to add the
> dependent pq.dll (/usr/bin) to the following command:

Sorry, I don't know either, but...

>   ../../../CYGIN-PATCHES/mkdll.sh libsapi.la \
>     -L ../../../.libs -lphp4 \
>     /usr/bin/cyghttpd.dll				[8]
> 
> It doesn't work that way:
>   ../../../CYGIN-PATCHES/mkdll.sh libsapi.la \
>     -L ../../../.libs -lphp4 \
>     /usr/bin/cyghttpd.dll /usr/bin/pq.dll		[8]
                            ^^^^^^^^^^^^^^^

One should *not* link against DLLs directly -- one should link against
the corresponding import libraries instead.  Use "-lpq" instead of
"/usr/bin/pq.dll" above.  BTW, the "/usr/bin/cyghttpd.dll" is suspect
too.

Jason

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: PHP Apache module with PostgreSQL support
  2002-09-17  4:20     ` AW: " Andreas
@ 2002-09-17  6:50       ` Jason Tishler
  2002-09-17 10:20         ` AW: " Andreas
  0 siblings, 1 reply; 10+ messages in thread
From: Jason Tishler @ 2002-09-17  6:50 UTC (permalink / raw)
  To: Andreas; +Cc: cygwin

Andreas,

On Tue, Sep 17, 2002 at 01:11:47PM +0200, Andreas wrote:
> > > Step [5] breaks with:
> > > ...
> > > checking for PostgreSQL support... yes
> > > configure: error: Cannot find libpq.so. Please specify correct
> > PostgreSQL installation path
> >
> > My WAG (without checking the source) is that you will need to patch
> > configure.in to deal with the Cygwin platform.
> 
> Thank you!

You are welcome, but I only stated the obvious above.

> Is this something different? (I did the similar with pgsql before I
> installed pgsql from source.) The output of the above line is:
> ...
> patching file 'php-4.2.0-1/ext/pgsql/config.m4
> ...
> 
> libpq.so is mentioned in the config.m4.
> 
> Could you explain what should be patched in the configure.in script,
> please?

Then you may need to patch config.m4 instead (again, I have not checked
the source).  The bottom line is that under Cygwin the check for the
existence of the pq library must look for either libpq.a (i.e., import
library) or pq.dll (i.e., shared library).  Choose the one that
minimizes the patch.

Jason

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: PHP Apache module with PostgreSQL support
  2002-09-15 11:51 ` Andreas
@ 2002-09-16 11:21   ` Jason Tishler
  2002-09-17  4:20     ` AW: " Andreas
  0 siblings, 1 reply; 10+ messages in thread
From: Jason Tishler @ 2002-09-16 11:21 UTC (permalink / raw)
  To: cygwin

Andreas,

On Sun, Sep 15, 2002 at 08:28:57PM +0200, Andreas wrote:
> Step [5] breaks with:
> ...
> checking for PostgreSQL support... yes
> configure: error: Cannot find libpq.so. Please specify correct PostgreSQL installation path

My WAG (without checking the source) is that you will need to patch
configure.in to deal with the Cygwin platform.

Jason

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: PHP Apache module with PostgreSQL support
       [not found] <3D8447C6.35A64055@wapme-systems.de>
@ 2002-09-15 11:51 ` Andreas
  2002-09-16 11:21   ` Jason Tishler
  0 siblings, 1 reply; 10+ messages in thread
From: Andreas @ 2002-09-15 11:51 UTC (permalink / raw)
  To: cygwin

> if you want PostgreSQL support build in php you will have to tell
> php's configure script corresponding directives and afterwards tell
> mkdll.sh some linker flags to the corresponding libraries to resolve
> the references.

Thanks Stipe. I tried to build php as DSO/static and with/without pgsql.
Every trial failed at a certain point.

Is it necessary to have apache/postgresql sources accessible to build a php
DSO?

I think the apache sources are required only for statically linked modules.
However, the sources are available in:
/usr/src/apache_1.3.24-5
/usr/src/postgresql-7.2.1-2
/usr/src/php-4.2.0-1

The correct steps to build a php DSO with pgsql support should be as follows
(?):
  tar xjvf apache-php-4.2.0-1-src.tar.bz2			[1]
  patch -p0 < php-X-Y/CYGWIN-PATCHES/php-4.2.0-1.patch	[2]
  cd php-4.2.0-1							[3]
  autoconf								[4]
  ./configure --with-apxs --without-mysql --with-pgsql	[5]
  make								[6]
  cd sapi/apache/.libs						[7]
  ../../../CYGIN-PATCHES/mkdll.sh libsapi.la \
    -L ../../../.libs -lphp4 \
    /usr/bin/cyghttpd.dll					[8]
  mv cygsapi.dll libphp4.dll					[9]
  /usr/sbin/apxs -i -a -n php4 libphp4.dll  		[10]

Step [5] breaks with:
...
checking for PostgreSQL support... yes
configure: error: Cannot find libpq.so. Please specify correct PostgreSQL
installation path

Of course there are no *.so files available under Cygwin. Which path for
pgsql should I specify (installation (/usr/share/postgresql) or source or
other (/usr/include/postgresql or /lib/postgresql) path)?
Is it necessary to install pgsql from source where the install directory
would be /usr/local/pgsql?

The process terminates with step [8] if no pgsql support is specified
(./configure --with-apxs --without-mysql) after a list of "undefined
reference to..." messages with following error:
collect2: ld returned 1 exit status

Is there any other flag required for mkdll.sh than the above (step [8])? I
guess for pgsql!?

Andreas



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2002-09-20 11:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <IOEFIOCBAFPGBCJCLFMECEAMCDAA.news.Andreas@gmx.net>
2002-09-07  9:07 ` PHP Apache module with PostgreSQL support cygwin
2002-09-07 13:03 ` Jason Tishler
     [not found] <3D8447C6.35A64055@wapme-systems.de>
2002-09-15 11:51 ` Andreas
2002-09-16 11:21   ` Jason Tishler
2002-09-17  4:20     ` AW: " Andreas
2002-09-17  6:50       ` Jason Tishler
2002-09-17 10:20         ` AW: " Andreas
2002-09-18  5:24           ` Jason Tishler
2002-09-18 13:05             ` Andreas
2002-09-18 14:01               ` Jason Tishler
2002-09-18 14:56                 ` AW: " Andreas
2002-09-20  4:29                   ` Jason Tishler
     [not found] <7424935D9B6CD311B72800508B108FD20D1767A5@emss03m08.orl.lmco.com>
2002-09-19  9:44 ` Andreas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).