[PHP-INSTALL] php crashes with msyql

[PHP-INSTALL] php crashes with msyql

am 22.03.2006 02:28:44 von Noah Silverman

Hello,

I have a mission critical problem that I cant seem to solve. Can
anyone help??

I'll even offer $100 paypal if someone gives me the answer to solve
this issue.

Thanks,

-N

------------------

The issue:
when I load a php file in a browser that references mysql, it
crashes the apache thread.

The clues:
if I call the same php from the command line, it works perfectly!
If I call a php file that doesn't use mysql, it works perfectly!
The problem is only when calling a php file using mysql THROUGH A
BROWSER.

The environment
slackware with kernel 2.6.11.8
php 5.1.2
apache 2.2.0
mysql 4.1.18 (pre-compiled downloaded from mysql.com)

apache config command:
../configure --with-apr=/usr/local/apr-httpd/ --with-apr-util=/usr/
local/apr-util-httpd/ --enable-so --enab
le-rewrite --disable-autoindex --enable-ssl --with-ssl=/usr/local/ssl

php config command:

'./configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-
mysql=/usr/local/mysql' '--with-mysql-sock=/tmp/mysql.sock' '--with-
sqlite' '--enable-sqlite-utf8' '--with-zlib' '--with-zlib-dir' '--
with-bz2' '--with-gd' '--enable-gd' '--enable-gd-native-ttf' '--with-
jpeg-dir=/usr/local' '--with-png-dir=/usr/local' '--with-ttf' '--with-
curl=/usr/local' '--enable-track-vars' '--with-gettext' '--with-
config-file-path=/usr/local/apache2/conf' '--enable-trans-id' '--
enable-ftp' '--enable-mbstring' '--with-openssl=/usr/local/ssl'

Re: php crashes with msyql

am 22.03.2006 02:34:10 von Chris

Noah Silverman wrote:
> Hello,
>
> I have a mission critical problem that I cant seem to solve. Can
> anyone help??
>
> I'll even offer $100 paypal if someone gives me the answer to solve
> this issue.
>
> Thanks,
>
> -N
>
> ------------------
>
> The issue:
> when I load a php file in a browser that references mysql, it
> crashes the apache thread.
>
> The clues:
> if I call the same php from the command line, it works perfectly!
> If I call a php file that doesn't use mysql, it works perfectly!
> The problem is only when calling a php file using mysql THROUGH A
> BROWSER.
>
> The environment
> slackware with kernel 2.6.11.8
> php 5.1.2
> apache 2.2.0
> mysql 4.1.18 (pre-compiled downloaded from mysql.com)

So if you just do a

mysql_connect(...)
?>

it crashes?

Get it down to it's simplest form and work from there.

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: php crashes with msyql

am 22.03.2006 02:46:04 von Chris

Noah Silverman wrote:
> Chris,
>
> Same problem
>
> Called from the command line it works. Called through a browser, it
> crashes.
> php test.php - WORKS
>
> http://server.com/test.php - CRASHES

What exactly is in test.php (change database details, but we need to see
the test.php script) ?

Is it segfaulting (check the apache error logs) ?

Did you re-compile php after updating mysql? Maybe there's a version
difference in there somewhere, it's trying to load an older module.

Does a phpinfo page show correct database version details?

Please CC the list, others may have ideas I don't about what's going on.

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: php crashes with msyql

am 22.03.2006 02:51:51 von Noah Silverman

Chris,

Thanks in advance for all the help. i appreciate it.

The script
-------------------------
mysql_connect('123.123.123.123','user','pass');
?>
----------------------


The error from apache log
-------------------------------------
[Tue Mar 21 15:36:05 2006] [notice] child pid 19337 exit signal
Segmentation fault (11)
-------------------------------------

How I got here:

I had an old copy of apache and php running (apache 2.0.? and php 4.3.5)
I delete apache
I configured, made, and installed apache (2.2.0)
I configured, made, and installed php (4.4.2)

The mysql being used is the pre-compiled one from mysql.com. I have
used it on other servers and it works fine.

I can provide an strace of the apache processing crashing if anyone
is interested,

Thanks







On Mar 21, 2006, at 5:46 PM, Chris wrote:

> Noah Silverman wrote:
>> Chris,
>> Same problem
>> Called from the command line it works. Called through a browser,
>> it crashes.
>> php test.php - WORKS
>> http://server.com/test.php - CRASHES
>
> What exactly is in test.php (change database details, but we need
> to see the test.php script) ?
>
> Is it segfaulting (check the apache error logs) ?
>
> Did you re-compile php after updating mysql? Maybe there's a
> version difference in there somewhere, it's trying to load an older
> module.
>
> Does a phpinfo page show correct database version details?
>
> Please CC the list, others may have ideas I don't about what's
> going on.
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: php crashes with msyql

am 22.03.2006 02:58:38 von Chris

Noah Silverman wrote:
> Chris,
>
> Thanks in advance for all the help. i appreciate it.
>
> The script
> -------------------------
> > mysql_connect('123.123.123.123','user','pass');
> ?>
> ----------------------
>
>
> The error from apache log
> -------------------------------------
> [Tue Mar 21 15:36:05 2006] [notice] child pid 19337 exit signal
> Segmentation fault (11)
> -------------------------------------
>
> How I got here:
>
> I had an old copy of apache and php running (apache 2.0.? and php 4.3.5)
> I delete apache
> I configured, made, and installed apache (2.2.0)
> I configured, made, and installed php (4.4.2)
>
> The mysql being used is the pre-compiled one from mysql.com. I have
> used it on other servers and it works fine.
>
> I can provide an strace of the apache processing crashing if anyone is
> interested,

Don't know how to read those things myself :)


Is php reporting the same version as mysql is running? A phpinfo page
has this under the 'mysql' section:

Client API Version

Is that the same as

mysql -V

reports?

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: php crashes with msyql

am 22.03.2006 04:33:44 von Noah Silverman

Yes,

Same versions..

-N


On Mar 21, 2006, at 5:58 PM, Chris wrote:

> Noah Silverman wrote:
>> Chris,
>> Thanks in advance for all the help. i appreciate it.
>> The script
>> -------------------------
>> >> mysql_connect('123.123.123.123','user','pass');
>> ?>
>> ----------------------
>> The error from apache log
>> -------------------------------------
>> [Tue Mar 21 15:36:05 2006] [notice] child pid 19337 exit signal
>> Segmentation fault (11)
>> -------------------------------------
>> How I got here:
>> I had an old copy of apache and php running (apache 2.0.? and php
>> 4.3.5)
>> I delete apache
>> I configured, made, and installed apache (2.2.0)
>> I configured, made, and installed php (4.4.2)
>> The mysql being used is the pre-compiled one from mysql.com. I
>> have used it on other servers and it works fine.
>> I can provide an strace of the apache processing crashing if
>> anyone is interested,
>
> Don't know how to read those things myself :)
>
>
> Is php reporting the same version as mysql is running? A phpinfo
> page has this under the 'mysql' section:
>
> Client API Version
>
> Is that the same as
>
> mysql -V
>
> reports?
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: php crashes with msyql

am 22.03.2006 04:43:59 von wrowe

Noah Silverman wrote:
> Hello,
>
> I have a mission critical problem that I cant seem to solve. Can
> anyone help??
>
> I'll even offer $100 paypal if someone gives me the answer to solve
> this issue.

You don't enable zts so I seriously doubt your php is threadsafe; you
configure httpd without specifying --with-mpm=prefork (?) This is bad
mojo - if you want to be paranoid choose the MPM explicitly to be prefork,
if you want to be experimental use worker but ensure you use the -zts
support on PHP, and ensure the extensions you build are -also- threadsafe.

http://www.apache.org/foundation/contributing.html#Paypal


------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Re: php crashes with msyql

am 22.03.2006 04:46:00 von Chris

Noah Silverman wrote:
> Yes,
>
> Same versions..

Hmm. I'm out of ideas :(

Might need to post on the -internals list and see if one of the
developers can help you with the backtrace.


> On Mar 21, 2006, at 5:58 PM, Chris wrote:
>
>> Noah Silverman wrote:
>>
>>> Chris,
>>> Thanks in advance for all the help. i appreciate it.
>>> The script
>>> -------------------------
>>> >>> mysql_connect('123.123.123.123','user','pass');
>>> ?>
>>> ----------------------
>>> The error from apache log
>>> -------------------------------------
>>> [Tue Mar 21 15:36:05 2006] [notice] child pid 19337 exit signal
>>> Segmentation fault (11)
>>> -------------------------------------
>>> How I got here:
>>> I had an old copy of apache and php running (apache 2.0.? and php
>>> 4.3.5)
>>> I delete apache
>>> I configured, made, and installed apache (2.2.0)
>>> I configured, made, and installed php (4.4.2)
>>> The mysql being used is the pre-compiled one from mysql.com. I
>>> have used it on other servers and it works fine.
>>> I can provide an strace of the apache processing crashing if anyone
>>> is interested,
>>
>>
>> Don't know how to read those things myself :)
>>
>>
>> Is php reporting the same version as mysql is running? A phpinfo page
>> has this under the 'mysql' section:
>>
>> Client API Version
>>
>> Is that the same as
>>
>> mysql -V
>>
>> reports?
>>
>> --
>> Postgresql & php tutorials
>> http://www.designmagick.com/
>>
>
>


--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: php crashes with msyql

am 22.03.2006 08:59:24 von Matt Richards

Hi,

From what you have said i would say the problem is related to the apache
module. It would also be nice if you could give us some more information
like an apache error log or the relative parts of it.

Does php need to be loaded as a module, if not you could probuly parse php
to cgi as it seems to work from the command line.

todo that all you will need todo is ...

build php with --enable-cgi --enable-force-cgi-redirect --enable-fastcgi
copy ./sapi/cgi/php from the php prefix to the cgi-bin of the webserver e.g.
/usr/local/httpd/cgi-bin/php

then add the following lines to the httpd.conf

AddType application/x-httpd-php php
Action application/x-httpd-php /cgi-bin/php


The AddType line can be extended to contain all the file extensions that
you need to parse through php.

also sorry if this has already been talked about, i was going to sent it
last night but my internet connection broke just before i hit the send
button and i have to run off now so i dont have time to read all the
replys.

HTH

Matt.

> Hello,
>
> I have a mission critical problem that I cant seem to solve. Can
> anyone help??
>
> I'll even offer $100 paypal if someone gives me the answer to solve
> this issue.
>
> Thanks,
>
> -N
>
> ------------------
>
> The issue:
> when I load a php file in a browser that references mysql, it
> crashes the apache thread.
>
> The clues:
> if I call the same php from the command line, it works perfectly!
> If I call a php file that doesn't use mysql, it works perfectly!
> The problem is only when calling a php file using mysql THROUGH A
> BROWSER.
>
> The environment
> slackware with kernel 2.6.11.8
> php 5.1.2
> apache 2.2.0
> mysql 4.1.18 (pre-compiled downloaded from mysql.com)
>
> apache config command:
> ./configure --with-apr=/usr/local/apr-httpd/ --with-apr-util=/usr/
> local/apr-util-httpd/ --enable-so --enab
> le-rewrite --disable-autoindex --enable-ssl --with-ssl=/usr/local/ssl
>
> php config command:
>
> './configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-
> mysql=/usr/local/mysql' '--with-mysql-sock=/tmp/mysql.sock' '--with-
> sqlite' '--enable-sqlite-utf8' '--with-zlib' '--with-zlib-dir' '--
> with-bz2' '--with-gd' '--enable-gd' '--enable-gd-native-ttf' '--with-
> jpeg-dir=/usr/local' '--with-png-dir=/usr/local' '--with-ttf' '--with-
> curl=/usr/local' '--enable-track-vars' '--with-gettext' '--with-
> config-file-path=/usr/local/apache2/conf' '--enable-trans-id' '--
> enable-ftp' '--enable-mbstring' '--with-openssl=/usr/local/ssl'
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php