LinuxQuestions.org
Review your favorite Linux distribution.
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 11-28-2006, 06:50 AM   #1
baskerville
LQ Newbie
 
Registered: Sep 2004
Location: Rio de Janeiro, Brazil
Distribution: Slackware
Posts: 19

Rep: Reputation: 0
Unhappy Fight against Slack + PHP5 + MySQL. Weird library dependency


Hey, guys
I'm struggling against my Slack for these last two days. I'm trying to install Apache 2, PHP5 and Mysql 5.0. Everything is ok with Apache and MySQL. They're both running and I've managed to create DBs and tables in MySQL. The problem is with PHP. I'm trying to install and run a web-based bibliography manager, called Aigaion. And I get a blank page when I point to its index.php. Apache error log reports the following message:

[Tue Nov 28 09:19:40][error][client 127.0.0.1] PHP Fatal Error: Call to undefined function mysql_connect() in /var/www/htdocs/aigaion/_global.php on line 98

I've got packages from www.linuxpackages.net, more specifically the following ones:
- apache2-2.0.55-i486-1jim
- php-5.1.6-i486-1kjz
- mysql-5.0.16-i486-1
I'm running Slackware 10.1 in a old K6-II (somewhat overclocked, but stable) and I needed once to do a reinstall, due to a HD change. In the older install I've got all this stuff working (although I remember that I've had similar problems).


Well, after trying all that I knew and search for answer here and elsewhere, what I can conclude up to now is:
1) the config files are all right. The lines corresponding to mysql extensions are uncommented.
2) It seems that the php package is the right one. I've installed another before, with the compile options for mysql extension not set to 'shared'. It refused to load even with the all the extension lines commented. I don't know the reason, but I downloaded the other package, with options set to shared and libphp5.so could be correctly loaded by Apache. phpinfo() reports the following compilation options: --with-mysql=shared,/usr --with-mysqli=shared
3) I have mysql.so mysqli.so pdo_mysql.so in the php extensions folder, so this is not the problem.
4) Slackware MySQL package installs the libmysqlclient libraries, I don't need to install these separately.

My hypothesis was that these packages were broken, had broken dependencies or was of a different kind from those needed by php-mysql. So, I've typed "ldd mysql.so", it reported a broken dependency with libmysqlclient.so.15 (which was in fact installed). I've made a link from the /usr/lib/ folder to /usr/lib/mysql folder contents, but now I get the following warning when I run "ldd mysql.so":
./mysql.so: /usr/lib/libmysqlclient.so.15: no version information available (required by ./mysql.so)

[EDIT: In the part of phpinfo() related to the configuration of extensions there is only configuration options to mysqli extension, but mysql_connect() is a function defined in mysql.so extension.]


I don't know anything else to do. I feel that I'm near the solution, but I don't know how to fix this specific problem.
Well, I wellcome any idea, and ask you to be forgiving with my english.

Last edited by baskerville; 11-28-2006 at 07:14 AM.
 
Old 11-28-2006, 10:52 AM   #2
baskerville
LQ Newbie
 
Registered: Sep 2004
Location: Rio de Janeiro, Brazil
Distribution: Slackware
Posts: 19

Original Poster
Rep: Reputation: 0
Update: parameters missing in php.ini

Ok, shame on me. php.ini wasn't complete. Some values for mysql extensions were missing, as the default host and, what I think to be more important, the path to MySQL socket. Well, my fight now is against the application itself, but this is other problem. Let the post be here as a guide. So this is a quick checklist for problems with apache2 + php5 + mysql5 in Slackware:
  1. Check /etc/apache2/httpd.conf Look for the lines for the php module and the AddType, instructing the server on how to handle .php files. In Slackware at least, these lines are in a separate file called mod_php.conf that is included in httpd.conf. Check if the file is actually included or not.
  2. Write a file with .php extension with these contents:
    PHP Code:
     <?php phpinfo(); ?>
    And check if the support for mysql was compiled into php. Check for "--with-mysql" flags.
  3. Check in php extension folder if you have the extension, in case, named mysql.so This is a problem since php isn't bundled with MySQL code any more (license problems...)
  4. There is a problem with the way you link the extension in the compilation of php. Shared libraries minimize problems with dependencies.
  5. Check /etc/apache2/php.ini Look (1) if the path to the extensions folder is uncommented and correct. And (2) if the extensions you're using and for which you have the appropriate libraries are uncommented and [3] if the configurations for the extension are correct. I think the most important values are for the port and the socket ( /var/run/mysql/mysql.sock in Slackware), because the other values can and should be set in the php script or application using the database.
  6. Check if you have the libmysqlclient libraries. In Slackware they come in the MySQL package, but I think that if you're compiling, you'll get them separately.
  7. Check if the libraries are of the required version. One way of doing it is running "ldd mysql.so" in the php extensions folders. This may report a broken dependency. Sometimes you have libxxx.so.14 and the program requires libxxx.so.15, and you are too lazy to search or compile the correct version. What you can do, although this is a very ugly solution, very prone to bugs, is to make a link to the old library with the name of the required one.

I hope this checklist may help you. Those who knows other things to do, please, add them in a reply.

thanx. sorry for the english noch einmal.

Last edited by baskerville; 11-28-2006 at 11:01 AM.
 
  


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
Problems Installing/uninstalling MySQL On Fedora Fc4 (library dependency issue) donraja Linux - Software 2 05-26-2006 01:06 AM
LXer: Mysql to Fight Oracle With Fire(bird)? LXer Syndicated Linux News 0 02-26-2006 02:46 PM
Weird:there is no Makefile for php5 installation backpacker Linux - Software 2 11-03-2005 01:43 AM
Library Dependency H*ll springshades Linux - Software 1 07-18-2005 06:57 PM
grip library dependency - can't resolve synaptical Linux - Software 1 02-09-2004 01:25 PM

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

All times are GMT -5. The time now is 08:30 PM.

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