Ubuntu/Apache/PHP5.2.1 - cannot use dynamic extensions

Hi all,
I'm trying to compile PHP 5.2.1 on my Ubuntu 6.10 server. I've
downloaded the source code from php.net and am running the following
"configure" command on it:

../configure --with-apxs2=/usr/bin/apxs2 --with-mysql
--with-informix=/opt/informix --enable-shared --enable-pdo=shared
--without-sqlite --without-pdo-sqlite --with-pdo-mysql=shared
--with-zlib --with-xml --with-pdo-informix=shared,/opt/informix

After doing this, then "make", I copy over the generated libphp5.so file
into my Apache extensions directory, add extension=pdo.so (and lines for
the PDO-MySQL/Informix extensions) into my php.ini and restart Apache. I
would expect to see PDO, PDO-MySQL and PDO-Informix listed in my
phpinfo() - but they don't appear.

So, I tried recompiling PHP but without any of the PDO extensions being
shared. This worked, and I could see PDO and PDO-MySQL in phpinfo(), but
not PDO-Informix. I've also tried doing a "make install" after the
"make" in both instances, but that didn't help either.

So, can anyone hazard a guess as to why none of the PDO extensions load
when compiled shared? I don't get any related error messages in the
Apache or System logs by the way....

Cheers,
Matt
dirtycow [ Di, 06 März 2007 23:04 ] [ ID #1649280 ]

Re: Ubuntu/Apache/PHP5.2.1 - cannot use dynamic extensions

dirtycow wrote:
> Hi all,
> I'm trying to compile PHP 5.2.1 on my Ubuntu 6.10 server. I've
> downloaded the source code from php.net and am running the following
> "configure" command on it:
>
> ../configure --with-apxs2=/usr/bin/apxs2 --with-mysql
> --with-informix=/opt/informix --enable-shared --enable-pdo=shared
> --without-sqlite --without-pdo-sqlite --with-pdo-mysql=shared
> --with-zlib --with-xml --with-pdo-informix=shared,/opt/informix
>
> After doing this, then "make", I copy over the generated libphp5.so file
> into my Apache extensions directory, add extension=pdo.so (and lines for
> the PDO-MySQL/Informix extensions) into my php.ini and restart Apache. I
> would expect to see PDO, PDO-MySQL and PDO-Informix listed in my
> phpinfo() - but they don't appear.
>
> So, I tried recompiling PHP but without any of the PDO extensions being
> shared. This worked, and I could see PDO and PDO-MySQL in phpinfo(), but
> not PDO-Informix. I've also tried doing a "make install" after the
> "make" in both instances, but that didn't help either.
>
> So, can anyone hazard a guess as to why none of the PDO extensions load
> when compiled shared? I don't get any related error messages in the
> Apache or System logs by the way....
>
> Cheers,
> Matt

This might or might not help, but I had this problem before when doing a
compile from source.
I solved it by checking the extension directory matched that of php.ini

Hendri
Hendri Kurniawan [ Mi, 07 März 2007 13:19 ] [ ID #1650514 ]

Re: Ubuntu/Apache/PHP5.2.1 - cannot use dynamic extensions

> This might or might not help, but I had this problem before when doing a
> compile from source.
> I solved it by checking the extension directory matched that of php.ini
>
> Hendri

Hi Hendri,
Many thanks - your reply prompted me to solve my problem. I recompiled
PHP explicitly saying where the php.ini file was located, made some
other minor changes, and it's all working fine. You have helped me fix a
problem that has had me struggling for some time now, so thank you again :-)

Cheers,
Matt
dirtycow [ Mi, 07 März 2007 20:25 ] [ ID #1650519 ]

Re: Ubuntu/Apache/PHP5.2.1 - cannot use dynamic extensions

np
Hendri Kurniawan [ Mi, 07 März 2007 21:44 ] [ ID #1650520 ]
PHP » alt.php » Ubuntu/Apache/PHP5.2.1 - cannot use dynamic extensions

Vorheriges Thema: PHP 5.1.4 to Apache 2.2
Nächstes Thema: can I pass PHP var to JS ...?