php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14557 Compile Failure (and potential fix)
Submitted: 2001-12-17 01:01 UTC Modified: 2002-04-10 18:50 UTC
Votes:7
Avg. Score:4.6 ± 0.7
Reproduced:6 of 6 (100.0%)
Same Version:5 (83.3%)
Same OS:6 (100.0%)
From: squasar at squasar dot dhs dot org Assigned: kalowsky (profile)
Status: Closed Package: Compile Failure
PHP Version: 4.1.0 OS: MacOS X (10.1.1)
Private report: No CVE-ID: None
 [2001-12-17 01:01 UTC] squasar at squasar dot dhs dot org
The compile of PHP 4.1.0 (source tarball) fails miserably 
out-of-the-box on MacOS X 10.1.1. The CGI version seems 
mostly alright, but the Apache DSO is a dismal mess. I'm 
running the latest released Apache (1.3.22). Also, I'm 
working with the CC shipped by Apple for OS X (this failed 
even MORE miserably with my compiled version of GCC, which 
is expected since OS X isn't supported by GCC yet) After 
some 5 days of wrestling, writing manual compiles, and 
running make -n and libtool --dry-run to get some idea of 
what the compilation is doing, I finally got it to work 
properly via writing a tcsh script that manually compiles 
the files involved (My configure is "./configure --with-
apxs=/usr/sbin/apxs --enable-ftp --enable-mbstring --
enable-mbstr-enc-trans --with-mysql=/usr/local --enable-
sockets --with-tsrm-pthreads --enable-ctype --with-zlib --
prefix=/usr --sysconfdir=/etc --localstatedir=/var --
mandir=/usr/share/man"). Instead of filling this text box 
beyond its buffer with the entire script (which gets a bit 
long in the tooth, obviously), here's a summary of what 
options it uses:

cc command when compiling normal source files: /usr/bin/cc 
-dynamic -fPIC -fno-common -traditional-cpp -O2 -I(all the 
various include dirs) -D(all the various defines) -c 
(source file).c -o (source file).lo

ld command when combining the .lo files in a dir into a .a: 
/usr/bin/ld -r -o lib(dir name).a (all the objects from the 
dir)

cc command for creating the final libphp4.so: /usr/bin/cc -
bundle -bundle_loader /usr/sbin/httpd -flat_namespace -
undefined warning -lm -lz -L/usr/local/lib/mysql -
lmysqlclient -o libphp4.so (all the .a's compiled above)
# for this one, note that the -L and -l for mysql only 
apply for compiling with a non-bundled libmysql

Putting all this together into a tcsh script gave me a 
successful PHP compile, and adding the appropriate install 
command (/usr/sbin/apxs -S LIBEXECDIR="/usr/libexec/httpd" 
-i -a -n php4 libphp4.so) gave me a working Apache + PHP 
4.1.0 + MySQL. My humble suggestion is that whoever 
maintains the autoconf script for PHP use this information 
to make a normal ./configure work under Darwin. 
(incidently, `uname -a` == Darwin hostname 5.1 Darwin 
Kernel Version 5.1: Tue Oct 30 00:06:34 PST 2001; root:xnu/
xnu-201.5.obj~1/RELEASE_PPC  Power Macintosh powerpc). 
Thanks :)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-12-17 01:04 UTC] squasar at squasar dot dhs dot org
(Incidently, I want to note that most of the problems with 
the compile seem to stem from libtool, which evidently has 
no clue what the heck it's doing.)
 [2001-12-17 01:07 UTC] squasar at squasar dot dhs dot org
Oops! One more thing! The full text of the tcsh script I'm 
using is available at http://leraz.dhs.org:8080/~squasar/
manual_php_compile.txt and a script which outputs a 
phpinfo() is available at http://leraz.dhs.org:8080/
~squasar/info.php
 [2002-03-03 02:07 UTC] kalowsky@php.net
Thank you for the submission of this.  have you sent an email to the libtool group yet informing them of your findings as well? It might be useful :)

Assigning to myself to keep me working on a proper fix.
 [2002-03-10 12:54 UTC] markonen@php.net
This bug has been superceded by bugs 15986 and 15987. 
Please follow those bugs for information regarding the 
forthcoming fixes for the issue you've reported.
 [2002-04-10 18:50 UTC] sniper@php.net
This bug has been fixed in CVS.

The cvs HEAD (which will become 4.3.0 at some point) has this fixed.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Oct 06 17:01:27 2024 UTC