LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-16-2007, 08:00 PM   #1
DavidHB
Member
 
Registered: Feb 2006
Location: Chile
Distribution: Slackware 10.2
Posts: 53

Rep: Reputation: 15
mysql_connect crashes php


I installed apache and php from www.packages.slackware.it on my Slackware 10.1 2.6.13 kernel. Phpinfo() tells me I've got Apache 1.3.33, php 4.1.10 and mysql 4.1.14

Originally I received errors in the log indicating that it couldn't find libmysqlclient.so.12. The only mysqlclient I had was libmysqlclient.so.14.0.0 and in a different directory than where it was looking, so I linked to .14, calling it libmysqlclient.so.12.

It seemed better, at least mysql was recognized in phpinfo() now. But I get *** glibc detected *** corrupted double linked list, and the page dies when I try to call mysql_connect. Is it becasue I´m using a .14 client as .12?

phpinfo says:

Active Persistent Links 0
Active Links 0
Client API version 4.1.14
MYSQL_MODULE_TYPE external
MYSQL_SOCKET /var/run/mysql/mysql.sock
MYSQL_INCLUDE -I/usr/include/mysql
MYSQL_LIBS -L/usr/lib -lmysqlclient


mysql.allow_persistent On On
mysql.connect_timeout 60 60
mysql.default_host no value no value
mysql.default_password no value no value
mysql.default_port no value no value
mysql.default_socket no value no value
mysql.default_user no value no value
mysql.max_links Unlimited Unlimited
mysql.max_persistent Unlimited Unlimited
mysql.trace_mode Off Off


Whasup?

Thx
 
Old 04-16-2007, 08:08 PM   #2
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,670

Rep: Reputation: 1786Reputation: 1786Reputation: 1786Reputation: 1786Reputation: 1786Reputation: 1786Reputation: 1786Reputation: 1786Reputation: 1786Reputation: 1786Reputation: 1786
Slackware have an official package for Apache, MySQL, and PHP. Why don't you use that?
 
Old 04-17-2007, 07:55 AM   #3
DavidHB
Member
 
Registered: Feb 2006
Location: Chile
Distribution: Slackware 10.2
Posts: 53

Original Poster
Rep: Reputation: 15
I managed to isolate the problem a little further! It's not really "mysql_connect" that's causing the problem, its "mysql_select_db". I enabled mysql trace and it indicated that I was connecting to the mysql. If I use my original test database that I created manually, mysql_select_db is fine. Of course the rest of the program croaks because it is expecting a different DB.

The DBase I am trying to use was imported via script from a test site. I can access it manually and it seems intact, but with mysql_select_db, I get *** glibc errors ****

As far as why I don't use the Slackware pkg, it's too long a story and not all that relevant, but partly to do with the hardware (small embedded platform with not much space and a difficult hardware disc combination etc. etc.)
 
Old 04-17-2007, 08:13 PM   #4
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,670

Rep: Reputation: 1786Reputation: 1786Reputation: 1786Reputation: 1786Reputation: 1786Reputation: 1786Reputation: 1786Reputation: 1786Reputation: 1786Reputation: 1786Reputation: 1786
that's strange
if you managed to connect to the DB and it went fine, why would selecting a DB cause a GLIBC error?

Hm... have you tried to compile your own PHP?
I usually used a source code version for PHP and leave the rest (Apache and MySQL) from Slackware official package.
 
Old 04-18-2007, 08:06 AM   #5
DavidHB
Member
 
Registered: Feb 2006
Location: Chile
Distribution: Slackware 10.2
Posts: 53

Original Poster
Rep: Reputation: 15
could it be "ln libmysqlclient.so.14.0.0 libmysqlclient.so.12"?

The saga continues and takes a turn which changes the suspected cause of the failure. In the interest of any who might be looking to this post in the future for answers to a connection problem with mysql from php, there is no answer, it connects, the problem is farther along.

In any case, it's an interesting case of a debug situation and the problem is very strange.

The crash happens once the program gets past a query ( as a result of having access to all the tables it needs). Even with all the trace tags enabled, the crash "seemingly" happened before (making it seem like the failure was the connection etc) because the code would crash the program before the output got to the browser. Commenting out the appropriate sections the crash point could be isolated better letting the debug strings get to the browser.

At this point, if I leave the program intact but put an "echo" of the sql string to the browser before the query, the program doesn't crash!! Everything else is the same. The echo doesn't have to be the sql string, it can be any text of 70 char or more. Less text and it crashes. I've never seen anything like it. I thought perhaps it was that the echo produced a delay that perhaps permitted a complete connection before the query (??), but I tried a delay just in case, but no.

Might there be a problem in that I'm linking the libmysqlclient.so.14.0.0 to libmysqlclient.so.12 that php is looking for? If so which version php looks for the .14 client?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
weird PHP problem: Call to undefined function mysql_connect() Shioni Linux - Server 4 12-22-2006 05:26 AM
php mysql_connect error compu73rg33k Linux - Software 11 04-02-2005 05:37 AM
PHP mysql_connect Guru - Install Question/Issue whohasit Programming 4 07-16-2004 06:28 PM
mysql_connect problem w/apache+php CodeCrush Linux - Software 0 05-24-2004 08:35 AM
Redhat PHP 4.2 Problem, no mysql_connect() nehalem Linux - Software 1 11-20-2003 12:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration