php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #36708 PDO Extension fails to configure proper makefile
Submitted: 2006-03-12 23:59 UTC Modified: 2017-05-07 04:22 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: jerome at macsaresexy dot com Assigned:
Status: No Feedback Package: PDO related
PHP Version: 5.2.1 OS: Mac OS X 10.4.9
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jerome at macsaresexy dot com
New email:
PHP Version: OS:

 

 [2006-03-12 23:59 UTC] jerome at macsaresexy dot com
Description:
------------
phpize runs, configure runs, but make fails to produce any 
actually compilation.

This successfully works on a linux machine with similar 
configured php, something in the makefile generation fails to 
include something I suppose.  I can't seem to find anything 
except that this might be a bug with OS X setup.

Reproduce code:
---------------
Using PHP built with configure line:
'./configure' '--enable-memory-limit' '--with-layout=GNU' '--prefix=/usr/local/php5' '--disable-all' '--enable-xml' '--enable-libxml' '--enable-spl' '--with-regex=php' '--disable-cli' '--enable-force-cgi-redirect' '--enable-fastcgi'

PDO extension fails to build on OS X, with no failures or even attempts at building.  Phpize and configure successfully run but not make.

Expected result:
----------------
Compilation of the module should've happened after 'make' not 
nothing.

Actual result:
--------------
Actual result is this: 

$ phpize
Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20050922
Zend Extension Api No:   220051025
$ ./configure
checking for egrep... grep -E
checking for a sed that does not truncate output... /usr/
bin/sed
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking whether gcc and cc understand -c and -o together... 
yes
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... no
checking build system type... powerpc-apple-darwin8.5.0
checking host system type... powerpc-apple-darwin8.5.0
checking target system type... powerpc-apple-darwin8.5.0
checking for PHP prefix... /usr/local/php5
checking for PHP includes... -I/usr/local/php5/include/php -
I/usr/local/php5/include/php/main -I/usr/local/php5/include/
php/TSRM -I/usr/local/php5/include/php/Zend -I/usr/local/
php5/include/php/ext
checking for PHP extension directory... /usr/local/php5/lib/
php/20050922
checking for PHP installed headers prefix... /usr/local/
php5/include/php
checking for re2c... no
configure: WARNING: You will need re2c 0.9.11 or later if 
you want to regenerate PHP parsers.
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking whether to enable PDO support... yes, shared
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... no
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -p
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking the maximum length of command line arguments... 
196608
checking command to parse /usr/bin/nm -p output from gcc 
object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if gcc static flag  works... yes
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fno-common
checking if gcc PIC flag -fno-common works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/bin/ld) supports 
shared libraries... yes
checking dynamic linker characteristics... darwin8.5.0 dyld
checking how to hardcode library paths into programs... 
immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... no
checking whether the g++ linker (/usr/bin/ld) supports 
shared libraries... yes
checking for g++ option to produce PIC... -fno-common
checking if g++ PIC flag -fno-common works... yes
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/bin/ld) supports 
shared libraries... yes
checking dynamic linker characteristics... darwin8.5.0 dyld
checking how to hardcode library paths into programs... 
immediate
checking whether stripping libraries is possible... yes
configure: creating ./config.status
config.status: creating config.h
config.status: config.h is unchanged
$ make

Build complete.
(It is safe to ignore warnings about tempnam and tmpnam).

$ 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-03-13 07:37 UTC] jerome at macsaresexy dot com
Apparently this is not just PDO, it's the majority of the 
extensions, nothing obvious in similarity.  PDO, curl, XSL 
fail, gd and mysql succeeded.  Mysql required editing 
configure to link to libz (or defining LDFLAGS might've 
worked)  So it seems in general the configure/makefile setup 
with PHP extensions in OS X has issues with leaving out the 
compile instructions
 [2006-03-13 08:30 UTC] tony2001@php.net
What autoconf version are you using?
 [2006-03-13 14:59 UTC] jerome at macsaresexy dot com
autoconf 2.59 which i believe is same as my linux machine i 
tested on.

automake is 1.6.3, the linux box was recently switched to 1.8 
due to requirement to build lighttpd web server.  is that a 
possibility?
 [2006-03-13 15:05 UTC] tony2001@php.net
Please try with autoconf 2.13 and put the result Makefile somewhere in the Net, so we can take a look at it.
 [2006-03-13 15:31 UTC] jerome at macsaresexy dot com
I tried autoconf 2.13 by removing the configure file and 
running /sw/bin/autoconf which is where it was installed (thru 
fink), not sure if that's proper enough.  I then ran ./
configure and put the makefile on the internet:

http://www.jeremyknope.com/files/Makefile-pdo-autoconf2.13.txt
 [2006-04-10 12:49 UTC] sniper@php.net
I can not access that makefile. Try again?
 [2006-04-10 13:19 UTC] jerome at macsaresexy dot com
i apologize, broke the setup for that domain.
http://www.jeremyknope.com/files/Makefile-pdo-autoconf2.13.txt
should work again
 [2006-04-10 21:51 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.1-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.1-win32-latest.zip

And make sure you get the right files installed and that you're not mixing new phpize with old build files.
 [2006-04-11 05:18 UTC] jerome at macsaresexy dot com
Ok so that seems more successful now, I was able to make 
curl, mysql, xsl, libz, gd on OS X which at least a few 
failed to before with stable 5.1.2

BUT PDO is still failing to generate a proper Makefile. 
Seems couple things are empty that shouldn't be as far as I 
can tell in the Makefile
PHP_MODULES =
all_targets = $(PHP_MODULES)
which fails when make all is run since make all just 
references all targets.

but glad to see every other module seems to be compiling so 
I can make an extension driven install of PHP.
 [2006-04-11 11:13 UTC] sniper@php.net
Apparently it's not supposed to be possible to even build PDO as shared extension under MacOSX. Just these Wez's hacks don't work and won't give any warning about it but just silently fails. Wez: Obviously you don't check properly whether phpize is used..
 [2006-04-11 13:13 UTC] jerome at macsaresexy dot com
weird, so PDO for some reason is the only one that can't be 
built separately from PHP on OS X? does that include every PDO 
driver? because that'll be a downer.
 [2006-06-20 15:27 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip


 [2006-07-18 15:36 UTC] jerome at macsaresexy dot com
I was unable to try cvs since it failed compiling PHP part 
way through with:

/Users/jerome/Downloads/php5.2-200607181430/Zend/
zend_alloc.c: In function ?zend_mm_mem_mmap_realloc?:
/Users/jerome/Downloads/php5.2-200607181430/Zend/
zend_alloc.c:117: error: ?ret? undeclared (first use in this 
function)
/Users/jerome/Downloads/php5.2-200607181430/Zend/
zend_alloc.c:117: error: (Each undeclared identifier is 
reported only once
/Users/jerome/Downloads/php5.2-200607181430/Zend/
zend_alloc.c:117: error: for each function it appears in.)
make: *** [Zend/zend_alloc.lo] Error 1
 [2006-07-18 15:43 UTC] tony2001@php.net
The next snapshot should be ok.
Thanks for the alert.
 [2006-07-18 17:12 UTC] jerome at macsaresexy dot com
I just grabbed PHP 5.2 CVS 200607181630 snapshot and attempted 
to compile it, PHP itself compiled fine, but PDO still does 
not generate a proper makefile on Mac OS X.

after running the php5.2cvs's phpize on ext/pdo, i did 
configure then make, and it just immediately thinks it's done 
like it always has been doing.
 [2006-08-24 16:01 UTC] tony2001@php.net
Due to the way that loadable modules work on OSX/Darwin, you need to compile the PDO package statically into the PHP core.
I've fixed the configure, so it will fail if you try to compile PDO dynamically.
 [2007-05-10 16:21 UTC] jerome at macsaresexy dot com
After some looking into, I reopened this bug after discussing this 
with mac developers and the fact being stated that OS X has dlopen and 
friends just like linux.  ALso the fact that MOST of the php 
extensions build fine on OS X except for PDO and maybe one or 2 
others.

This doesn't seem reasonable to not be able to do, if other extensions 
can be compiled & loaded, why can't PDO.  it really limits options 
like considering Zend Core when you can't install PDO via pecl.
 [2007-05-10 20:59 UTC] jerome at macsaresexy dot com
Quick comment, clarification of dlopen() if that applies to this.  OS 
X 10.3.x supposedly has a dl compat layer, where 10.4.x actually has 
native support for dlopen() and friends.
 [2007-05-14 09:19 UTC] tony2001@php.net
I removed the restriction in configure and compiled both PDO and PDO_SQLITE as shared.
This is what I get after enabling both of them (first PDO, then PDO_SQLITE):

dyld: lazy symbol binding failed: Symbol not found: _php_pdo_register_driver
  Referenced from: /var/root/tony/php-src_5_2/modules/pdo_sqlite.so
  Expected in: flat namespace

dyld: Symbol not found: _php_pdo_register_driver
  Referenced from: /var/root/tony/php-src_5_2/modules/pdo_sqlite.so
  Expected in: flat namespace

Trace/BPT trap

So it seems dynamic linker is still broken in MacOSX, therefor the restriction is reasonable.
 [2007-05-14 15:30 UTC] jerome at macsaresexy dot com
_php_pdo_register_driver is defined in pdo.so i believe right?
So pdo_sqlite should be linking against the pdo.so extension?

How do I disable configure restriction so I can try this out and get 
more information to some smarter mac devs than myself?  I've been 
giving this info to them and they still seem to think something isn't 
being linked that it should work.
 [2011-02-21 21:28 UTC] jani@php.net
-Package: Feature/Change Request +Package: PDO related
 [2013-12-13 07:46 UTC] wez@php.net
-Status: Assigned +Status: Open -Assigned To: wez +Assigned To:
 [2017-04-24 19:08 UTC] adambaratz@php.net
-Status: Open +Status: Feedback
 [2017-04-24 19:08 UTC] adambaratz@php.net
Is this an issue with the latest 5.x release?
 [2017-05-07 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 15:01:29 2024 UTC