This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: how to build php in cygwin?


Andrew DeFaria schrieb:
Joshua Daniel Franklin wrote:
Well I went to that URL and downloaded http://apache.dev.wapme.net/support/cygwin-packages/apache-modules/mod_php4/apache-php-4.2.0-2.tar.bz2, bunzip2 and untarred it and ran the postinstall (after first commenting out the last line which is an rm which assumes that the preceeding line, the rebase, doesn't fail):


$ /etc/postinstall/apache-php.sh
[activating module `php4' in /etc/apache/httpd.conf]
cp libphp4.dll /usr/lib/apache/libphp4.dll
chmod 755 /usr/lib/apache/libphp4.dll
cp /etc/apache/httpd.conf /etc/apache/httpd.conf.bak
cp /etc/apache/httpd.conf.new /etc/apache/httpd.conf
rm /etc/apache/httpd.conf.new
usage: rebase -b BaseAddress [-Vdv] [-o Offset] [-T FileList | -] Files...

After this I cannot start Apache. Running a syntax check:

$ httpd -t
Syntax error on line 238 of /etc/apache/httpd.conf:
Cannot load /usr/lib/apache/libphp4.dll into server: dlopen: Win32 error 126

stipe's postinstall.sh has a wrong rebase syntax, the required -b parameter is missing.
so before you run /etc/postinstall/apache-php.sh you have to fix it.


The commented line above is fine, but I removed postgres (pq.dll), since I don't need that.

my postinstall script looks like this:

#!/bin/sh
module=php4
module_dll=libphp4.dll
prefix=/usr
confdir=/etc
libdir=${prefix}/lib/apache
cd ${libdir}/new
if test -f ${module_dll}; then
  ${prefix}/sbin/apxs -i -a -n ${module} ${module_dll}
fi
rm -f ${libdir}/new/${module_dll}

# removed: ${prefix}/bin/pq.dll
# probably have to add: cygcrypt-0.dll and /usr/bin/cygcrypto-0.9.7.dll

rebase_dlls="${libdir}/${module_dll} /usr/bin/cygcrypto.dll /usr/bin/cygbz21.0.dll /usr/bin/cygintl-1.dll /usr/bin/cygxml2-2.dll /usr/bin/cygz.dll /usr/bin/cyggdbm.dll"
${prefix}/bin/rebase -v -d -b 0x68000000 -o 0x10000 ${rebase_dlls}; /usr/sbin/httpd
#${prefix}/bin/rebase -v -b 0x70000000 ${rebase_dlls}; /usr/sbin/httpd


$ less /usr/share/doc/Cygwin/rebase-2.3.README

$ nano /etc/apache/http.conf
#change the Port 8080, since another apache instance already runs on 80

$ cygcheck /usr/sbin/httpd.exe
# see that some other dll's are also loaded, but they are loaded above 0x70000000


$ pg_ctl stop
# if you keep postgres, you have to shut it down, otherwise you cannot rebase it.


$ rebase -v -b 0x70000000 ${rebase_dlls}; apachectl start
/usr/lib/apache/libphp4.dll: new base = 70000000, new size = 1e0000
/usr/bin/cygbz21.0.dll: new base = 701e0000, new size = 20000
/usr/bin/cygcrypto.dll: new base = 70200000, new size = b0000
/usr/bin/cygintl-1.dll: new base = 702b0000, new size = 10000
/usr/bin/pq.dll: new base = 702c0000, new size = 20000
/usr/bin/cygxml2-2.dll: new base = 702e0000, new size = 130000
/usr/bin/cygz.dll: new base = 70410000, new size = 20000
/usr/bin/cyggdbm.dll: new base = 70430000, new size = 10000

[Fri May 7 10:29:02 2004] [warn] Loaded DSO lib/apache/libphp4.dll uses plain Apache 1.3 API, this module might crash under EAPI! (please recompile it with -DEAPI)
f:\cygnus\usr\sbin\httpd.exe (3728): *** unable to remap f:\cygnus\bin\cygcrypto.dll to same address as parent(0x70200000) != 0x70210000
/usr/sbin/apachectl start: httpd could not be started


you have to try to start apache and rebase it again until it works.
now trying downwards from 0x68000000 on.

$ rebase -v -d -b 0x68000000 ${rebase_dlls}; apachectl start

/usr/lib/apache/libphp4.dll: new base = 67e20000, new size = 1e0000
/usr/bin/cygbz21.0.dll: new base = 67e00000, new size = 20000
/usr/bin/cygcrypto.dll: new base = 67d50000, new size = b0000
/usr/bin/cygintl-1.dll: new base = 67d40000, new size = 10000
/usr/bin/pq.dll: new base = 67d20000, new size = 20000
/usr/bin/cygxml2-2.dll: new base = 67bf0000, new size = 130000
/usr/bin/cygz.dll: new base = 67bd0000, new size = 20000
/usr/bin/cyggdbm.dll: new base = 67bc0000, new size = 10000

[Fri May 7 10:30:58 2004] [warn] Loaded DSO lib/apache/libphp4.dll uses plain Apache 1.3 API, this module might crash under EAPI! (please recompile it with -DEAPI)
f:\cygnus\usr\sbin\httpd.exe (2580): *** unable to remap f:\cygnus\bin\cygssl-0.9.7.dll to same address as parent(0xB60000) != 0xB70000
/usr/sbin/apachectl start: httpd could not be started


And now we are at the same position as stipe. Looks like we have to recompile httpd without cygcrypt-0
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/



-- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]