From mays at win.net Mon Jul 16 17:50:16 2007
From: mays at win.net (Joseph Mays)
Date: Mon Jul 16 17:50:18 2007
Subject: PHP5/MySQL problem
Message-ID: <035801c7c7cd$8e8dcfb0$b12118d8@engineering01>
Been dealing with a very frustrating couple of days, and have hit a wall. I
had a working gallery2 installation, then upgraded mysqli, and all hell
broke loose.
When I try to open a page (in this case gallery2) that connects to the
database. It always says "Too many open links". The thing is, it even says
that if mysqld is not running.
I'm running under freebsd 6.1.
You can examine my server setup at http://geekfleet.tai-gear.com/server-info
You can examine the php setup at http://geekfleet.tai-gear.com/phpinfo.php
The problem I'm having now is that php5 won't connect to the mysql server.
It's not a gallery thing, I've confirmed that I have the exact same problem
with a simple script to just connect to the mysql server and read the
database. And, in fact, the exact same error occurs if mysqld is not running
at all. Apache shows --
[Mon Jul 16 02:07:10 2007] [error] [client 66.249.66.10] PHP Warning:
mysql_connect() [function.mysql-connect]: Too many
open links (0) in
/usr/local/www/apache22/data/gallery2/lib/adodb/drivers/adodb-mysql.in
c.php on line 366
Here is the info in php.ini --
[MySQL]
; Allow or prevent persistent links.
mysql.allow_persistent = Off
; Maximum number of persistent links. -1 means no limit.
mysql.max_persistent = -1
; Maximum number of links (persistent + non-persistent). -1 means no
limit.
mysql.max_links = -1
; Default port number for mysql_connect(). If unset, mysql_connect()
will use
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
; compile-time value defined MYSQL_PORT (in that order). Win32 will
only look
; at MYSQL_PORT.
mysql.default_port =
; Default socket name for local MySQL connects. If empty, uses the
built-in
; MySQL defaults.
mysql.default_socket =
; Default host for mysql_connect() (doesn't apply in safe mode).
mysql.default_host =
; Default user for mysql_connect() (doesn't apply in safe mode).
mysql.default_user =
; Default password for mysql_connect() (doesn't apply in safe mode).
; Note that this is generally a *bad* idea to store passwords in this
file.
; *Any* user with PHP access can run 'echo
get_cfg_var("mysql.default_password")
; and reveal this password! And of course, any users with read access
to this
; file will be able to reveal the password as well.
mysql.default_password =
; Maximum time (in secondes) for connect timeout. -1 means no limit
mysql.connect_timeout = 60
; Trace mode. When trace_mode is active (=On), warnings for
table/index scans an
d
; SQL-Errors will be displayed.
mysql.trace_mode = Off
[MySQLi]
; Maximum number of links. -1 means no limit.
mysqli.max_links = -1
; Default port number for mysqli_connect(). If unset,
mysqli_connect() will use
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
; compile-time value defined MYSQL_PORT (in that order). Win32 will
only look
; at MYSQL_PORT.
mysqli.default_port = 3306
; Default socket name for local MySQL connects. If empty, uses the
built-in
; MySQL defaults.
mysqli.default_socket =
; Default host for mysql_connect() (doesn't apply in safe mode).
mysqli.default_host =
; Default user for mysql_connect() (doesn't apply in safe mode).
mysqli.default_user =
; Default password for mysqli_connect() (doesn't apply in safe mode).
; Note that this is generally a *bad* idea to store passwords in this
file.
; *Any* user with PHP access can run 'echo
get_cfg_var("mysqli.default_pw")
; and reveal this password! And of course, any users with read access
to this
; file will be able to reveal the password as well.
mysqli.default_pw =
; Allow or prevent reconnect
mysqli.reconnect = Off
From shaunc at crye-leike.com Mon Jul 16 18:50:09 2007
From: shaunc at crye-leike.com (Shaun Cummiskey)
Date: Mon Jul 16 18:50:15 2007
Subject: PHP5/MySQL problem
In-Reply-To: <035801c7c7cd$8e8dcfb0$b12118d8@engineering01>
References: <035801c7c7cd$8e8dcfb0$b12118d8@engineering01>
Message-ID: <20070716125538.25BB.SHAUNC@crye-leike.com>
On Mon, 16 Jul 2007 13:20:07 -0400
"Joseph Mays" wrote:
> You can examine the php setup at http://geekfleet.tai-gear.com/phpinfo.php
It doesn't appear that your installation of PHP was compiled with MySQL
support. If you go down to the MySQL section of the phpinfo output, the
value for MYSQL_MODULE_TYPE should be either "builtin" or "external."
IIRC, PHP will build with its own native MySQL support by default;
specifying --disable-all at config time overrode that option.
I would suggest appending --with-mysql --with-mysqli to PHP's configure
command, and recompiling.
hth
From mays at win.net Mon Jul 16 19:41:13 2007
From: mays at win.net (Joseph Mays)
Date: Mon Jul 16 19:41:14 2007
Subject: PHP5/MySQL problem
References: <035801c7c7cd$8e8dcfb0$b12118d8@engineering01>
<20070716125538.25BB.SHAUNC@crye-leike.com>
Message-ID: <019601c7c7e1$43713490$b12118d8@engineering01>
Okay, I did a "make deinstall; make clean; make rmconfig" in both the php5
and php5-extensions directories.
I edited the following in the php5 Makefile --
From:
CONFIGURE_ARGS= --enable-versioning \
--with-layout=GNU \
--with-config-file-scan-dir=${PREFIX}/etc/php \
--disable-all \
--enable-libxml \
--with-libxml-dir=${LOCALBASE} \
--enable-reflection \
--program-prefix=""
To:
CONFIGURE_ARGS= --enable-versioning \
--with-layout=GNU \
--with-mysql \
--with-mysqli \
--with-config-file-scan-dir=${PREFIX}/etc/php \
--disable-all \
--enable-libxml \
--with-libxml-dir=${LOCALBASE} \
--enable-reflection \
--program-prefix=""
MySQL still shows up as external in phpinfo. However, it looks like I am
getting a successful connection, now but I am getting the following error
from gallery2 --
[Mon Jul 16 20:24:59 2007] [error] [client 216.24.33.177] PHP Fatal error:
Call to undefined function preg_match() in
/usr/local/www/apache22/data/dpmeetup/index.php on line 35
[Mon Jul 16 20:25:00 2007] [error] [client 216.24.33.177] PHP Fatal error:
Call to undefined function preg_match() in
/usr/local/www/apache22/data/dpmeetup/index.php on line 35
Thanks for your help.
----- Original Message -----
From: "Shaun Cummiskey"
To: "Joseph Mays"
Cc:
Sent: Monday, July 16, 2007 2:00 PM
Subject: Re: PHP5/MySQL problem
> On Mon, 16 Jul 2007 13:20:07 -0400
> "Joseph Mays" wrote:
>
>> You can examine the php setup at
>> http://geekfleet.tai-gear.com/phpinfo.php
>
> It doesn't appear that your installation of PHP was compiled with MySQL
> support. If you go down to the MySQL section of the phpinfo output, the
> value for MYSQL_MODULE_TYPE should be either "builtin" or "external."
> IIRC, PHP will build with its own native MySQL support by default;
> specifying --disable-all at config time overrode that option.
>
> I would suggest appending --with-mysql --with-mysqli to PHP's configure
> command, and recompiling.
>
> hth
>
From berend at pobox.com Mon Jul 16 20:59:17 2007
From: berend at pobox.com (Berend de Boer)
Date: Mon Jul 16 20:59:20 2007
Subject: PHP5/MySQL problem
In-Reply-To: <019601c7c7e1$43713490$b12118d8@engineering01> (Joseph Mays's
message of "Mon, 16 Jul 2007 15:41:11 -0400")
References: <035801c7c7cd$8e8dcfb0$b12118d8@engineering01>
<20070716125538.25BB.SHAUNC@crye-leike.com>
<019601c7c7e1$43713490$b12118d8@engineering01>
Message-ID: <877ip013cx.fsf@dullio.nederware.nl>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
>>>>> "Joseph" == Joseph Mays writes:
Joseph> I edited the following in the php5 Makefile
You can just say:
make config
- --
Cheers,
Berend de Boer
PS: This email has been digitally signed if you wonder what the strange
characters are that your email client displays.
PGP public key: http://www.pobox.com/~berend/berend-public-key.txt
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8
iD8DBQFGm9m+IyuuaiRyjTYRAqZRAKDJ1ol9L2xG8LXier/ZOtBd5xO6zACg3Vzc
E7sG7gpr+T1ahldiPZzLGME=
=E1Fj
-----END PGP SIGNATURE-----
From idiotbg at gmail.com Mon Jul 16 21:36:55 2007
From: idiotbg at gmail.com (Momchil Ivanov)
Date: Mon Jul 16 21:36:56 2007
Subject: PHP5/MySQL problem
In-Reply-To: <019601c7c7e1$43713490$b12118d8@engineering01>
References: <035801c7c7cd$8e8dcfb0$b12118d8@engineering01>
<20070716125538.25BB.SHAUNC@crye-leike.com>
<019601c7c7e1$43713490$b12118d8@engineering01>
Message-ID: <200707162307.54909.idiotbg@gmail.com>
On Monday 16 July 2007 21:41:11 Joseph Mays wrote:
>
> [Mon Jul 16 20:24:59 2007] [error] [client 216.24.33.177] PHP Fatal error:
> Call to undefined function preg_match() in
> /usr/local/www/apache22/data/dpmeetup/index.php on line 35
> [Mon Jul 16 20:25:00 2007] [error] [client 216.24.33.177] PHP Fatal error:
> Call to undefined function preg_match() in
> /usr/local/www/apache22/data/dpmeetup/index.php on line 35
I guess you need the PCRE php extension.
--
PGP KeyID: 0x3118168B
Keyserver: pgp.mit.edu
Key fingerprint BB50 2983 0714 36DC D02E ?158A E03D 56DA 3118 168B
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-database/attachments/20070716/b9491e99/attachment.pgp
From ivoras at fer.hr Wed Jul 18 11:29:04 2007
From: ivoras at fer.hr (Ivan Voras)
Date: Wed Jul 18 11:29:06 2007
Subject: PHP5/MySQL problem
In-Reply-To: <035801c7c7cd$8e8dcfb0$b12118d8@engineering01>
References: <035801c7c7cd$8e8dcfb0$b12118d8@engineering01>
Message-ID:
Joseph Mays wrote:
> Been dealing with a very frustrating couple of days, and have hit a
> wall. I had a working gallery2 installation, then upgraded mysqli, and
> all hell broke loose.
It looks like you upgraded PHP, not only MySQL, and you're missing PHP
extensions your application needs. Try building the lang/php5-extensions
port.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-database/attachments/20070718/5e89e00a/signature.pgp
From tsr2600 at gmail.com Thu Jul 26 01:03:32 2007
From: tsr2600 at gmail.com (Gordon Stratton)
Date: Thu Jul 26 01:03:34 2007
Subject: PHP5 + oci8 consistently segfaults on script exit
Message-ID: <679088c80707251736r77a9108v422ef86387a3e6ed@mail.gmail.com>
Hey,
I'm running FreeBSD 6.2-RELEASE-p1 and PHP 5.2.2 built with the oci8
extension which is built against the oracle8-client port version
0.1.1_1.
Connecting to and working with an Oracle database works well so far, but
PHP segfaults whenever any script that uses the oci8 extension is run
and exits (regardless of success or failure). The segfault _only_
occurs when PHP is tearing everything down after the script runs.
Therefore scripts run successfully, but my kernel logs look like this:
Jul 25 16:59:17 kernel: pid 89667 (php), uid 1003: exited on signal 11
Jul 25 17:00:11 kernel: pid 89725 (php), uid 1003: exited on signal 11
Jul 25 17:01:38 kernel: pid 89729 (php), uid 1003: exited on signal 11
Jul 25 17:02:58 kernel: pid 89732 (php), uid 1003: exited on signal 11
...
Using gdb I've tracked the segfault down to a call to dlclose (via the
macro DL_UNLOAD in Zend/zend_API.c on line 1916). The module being
unloaded when the segfault occurs is the oci extension.
So far, I've tried:
- Various combinations of environment variables per the PHP
documentation
- Messing around remapping symbols as outlined in README.PORT that
ships with oracle8-client and rebuilding oci8 each time
- Not loading other PHP extensions
- Loading other PHP extensions in a different order
- Googling until I've memorized the 10 or so pages related to my problem
The problem has persisted across multiple versions of PHP in the last
several months, and pretty much everything I've tried results in a
working oci8 with the segfault after the script finishes. Today we
experienced some very odd behavior with a large Oracle query and httpd
exiting on signal 4 and while they may not be related, I'd like to see
if it's at all possible to resolve this issue (in the spirit of ruling
things out). Anything is welcome, I've heard of at least one other
person with my problem (and nearly identical setup) so I don't think I'm
the only one out there.
Thanks for your time,
Gordon
From numisemis at yahoo.com Sat Jul 28 14:46:47 2007
From: numisemis at yahoo.com (Simun Mikecin)
Date: Sat Jul 28 14:47:14 2007
Subject: PHP5 + oci8 consistently segfaults on script exit
Message-ID: <876507.10863.qm@web36614.mail.mud.yahoo.com>
>I'm running FreeBSD 6.2-RELEASE-p1 and PHP 5.2.2 built with the oci8
>extension which is built against the oracle8-client port version
>0.1.1_1.
>Connecting to and working with an Oracle database works well so far, but
>PHP segfaults whenever any script that uses the oci8 extension is run
>and exits (regardless of success or failure). The segfault _only_
>occurs when PHP is tearing everything down after the script runs.
>Therefore scripts run successfully, but my kernel logs look like this:
>Jul 25 16:59:17 kernel: pid 89667 (php), uid 1003: exited on signal 11
>Jul 25 17:00:11 kernel: pid 89725 (php), uid 1003: exited on signal 11
>Jul 25 17:01:38 kernel: pid 89729 (php), uid 1003: exited on signal 11
>Jul 25 17:02:58 kernel: pid 89732 (php), uid 1003: exited on signal 11
Could you please try these and send feedback:
1) Try the same using PDO_OCI instead of oci8 extension
2) Try with this combination: apache 2.0 (port compiled with WITH_THREADS) + php + oci8 extension
3) Try with this combination: apache 2.0 (port compiled with WITH_THREADS) + php + PDO_OCI
2) and 3) should be triggered by HTTP request.
____________________________________________________________________________________Ready for the edge of your seat?
Check out tonight's top picks on Yahoo! TV.
http://tv.yahoo.com/
From tsr2600 at gmail.com Sat Jul 28 18:59:20 2007
From: tsr2600 at gmail.com (Gordon Stratton)
Date: Sat Jul 28 18:59:22 2007
Subject: PHP5 + oci8 consistently segfaults on script exit
In-Reply-To: <876507.10863.qm@web36614.mail.mud.yahoo.com>
References: <876507.10863.qm@web36614.mail.mud.yahoo.com>
Message-ID: <679088c80707281159q2c906b4bn31ca7fcfdd2483a9@mail.gmail.com>
On 7/28/07, Simun Mikecin wrote:
> Could you please try these and send feedback:
>
> 1) Try the same using PDO_OCI instead of oci8 extension
> 2) Try with this combination: apache 2.0 (port compiled with WITH_THREADS) + php + oci8 extension
> 3) Try with this combination: apache 2.0 (port compiled with WITH_THREADS) + php + PDO_OCI
>
> 2) and 3) should be triggered by HTTP request.
Hey Simun,
1) Segfaults on exit, same as oci8.
2) Does not segfault.
3) Does not segfault.
In my situation, everything works like a charm up until the module is
unloaded via dlclose(3). My guess is that since mod_php doesn't
unload/reload PHP modules across requests that this is the reason it is
not segfaulting with httpd, but segfaulting with CLI PHP.
Thanks,
Gordon