Cannot start apache2 with php5 due to missing sqlite3

Ryan Schmidt ryandesign at
Sat Mar 31 03:28:21 PDT 2007

On Mar 30, 2007, at 22:07, Tom Brice wrote:

> After a little reading I see that PHP5 comes with sqlite3.  The  
> only conclusion that I can come to is that something is linking to  
> the supplied sqlite3 rather than MacPorts version and the supplied  
> sqlite3 fails on OS X 10.3.9 for some reason.  Here's how I came to  
> this end:
> * The php5 install that I cannot get to work with apache2 via  
> mod_php does work in the CLI.
> * In the darwin 7 variant of the php5 Portfile I added "--with-pdo- 
> sqlite=${prefix}/bin/sqlite3" to the configure.args-append line.   
> Building this still fails mod_php usage with apache2.
> * I changed the darwin 7 variant to "configure.args-append   -- 
> without-sqlite --without-pdo-sqlite" and reintsalled.  THIS WORKS  
> with mod_php and apache2!!
> I wasn't using sqlite3 with php before so I can live without it.   
> However, I think it might be "fixable" by making sure that php uses  
> the MacPorts sqlite3 rather that the supplied version.  By adding  
> the appropriate DIR to "--with-sqlite=DIR --with-pdo-sqlite=DIR" it  
> might work.  I guess it should be "{prefix}/bin/sqlite3".  the  
> configure file states:
> 	"Use --with-sqlite=DIR to specify DIR where
> 	Sqlite include and library files are located,
> 	if not using bundled library."

I had tried before to fix the sqlite situation in the php5 port and  
reached an impasse with an error message which I did not have time to  
research. Searching for that error message today brought me to this  
bug report, which turns out not to be a bug:

As I understand it now, the standard sqlite support in php5 uses and  
requires sqlite2, a version of which is included with php5. As of php  
5.1, pdo sqlite support is also available, which uses sqlite3, and in  
the absence of instructions to the contrary, I believe it is this pdo  
sqlite component which was reaching out to the system's sqlite3  
library rather than the MacPorts version.

I have committed a new revision of the php5 port which disables  
standard and pdo sqlite support, and adds a new +sqlite variant for  
those who want to reenable it:

This seems to work for me on 10.4.9 Intel. Will someone with access  
to 10.3.9 PPC please test it there and let me know if both versions  
work properly (both when specifying +sqlite and when not)? Thanks.

More information about the macports-users mailing list