LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-05-2004, 05:21 AM   #1
Lars79
Member
 
Registered: Jan 2004
Distribution: Slackware
Posts: 96

Rep: Reputation: 15
Can't connect to MySQL server using PHP


Hi,

I recently installed Slackware 10. Apache 1.3.31 and PHP 4.3.7 have been installed already. I configured the httpd.conf and the php.ini and the server works. Afterwards I downloaded the MySQL 4.0.20 binaries, and got the MySQL server running as well. Output of ps aux:

root 1957 0.0 0.8 74384 4208 ? Ss 11:32 0:00 /usr/sbin/httpd
nobody 1958 0.0 0.8 74484 4560 ? S 11:32 0:00 /usr/sbin/httpd
nobody 1959 0.0 1.0 75128 5348 ? S 11:32 0:00 /usr/sbin/httpd
nobody 1960 0.0 0.8 74468 4384 ? S 11:32 0:00 /usr/sbin/httpd
nobody 1961 0.0 1.0 75128 5348 ? S 11:32 0:00 /usr/sbin/httpd
nobody 1962 0.0 0.9 74500 4640 ? S 11:32 0:00 /usr/sbin/httpd
nobody 1985 0.0 1.0 75128 5356 ? S 11:43 0:00 /usr/sbin/httpd
root 2077 0.0 0.2 2172 1108 pts/2 S 11:53 0:00 /bin/sh /usr/local/mysql/bin/safe_mys
root 2094 0.1 1.9 30304 10128 pts/2 S 11:53 0:00 /usr/local/mysql/bin/mysqld --basedir
root 2095 0.0 1.9 30304 10128 pts/2 S 11:53 0:00 /usr/local/mysql/bin/mysqld --basedir
root 2096 0.0 1.9 30304 10128 pts/2 S 11:53 0:00 /usr/local/mysql/bin/mysqld --basedir
root 2097 0.0 1.9 30304 10128 pts/2 S 11:53 0:00 /usr/local/mysql/bin/mysqld --basedir
root 2098 0.0 1.9 30304 10128 pts/2 S 11:53 0:00 /usr/local/mysql/bin/mysqld --basedir
root 2099 0.0 1.9 30304 10128 pts/2 S 11:53 0:00 /usr/local/mysql/bin/mysqld --basedir
root 2100 0.0 1.9 30304 10128 pts/2 S 11:53 0:00 /usr/local/mysql/bin/mysqld --basedir
root 2101 0.0 1.9 30304 10128 pts/2 S 11:53 0:00 /usr/local/mysql/bin/mysqld --basedir
root 2102 0.0 1.9 30304 10128 pts/2 S 11:53 0:00 /usr/local/mysql/bin/mysqld --basedir
root 2103 0.0 1.9 30304 10128 pts/2 S 11:53 0:00 /usr/local/mysql/bin/mysqld --basedir

I downloaded phpMyAdmin 2.5.7 PL1, configured it and tried to connect to the my MySQL server. The error message is:

cannot load MySQL extension,
please check PHP Configuration.
Documentation

In the php.ini the extension_dir is set correctly:

extension_dir = "/usr/lib/php/extensions/"

the extension is loaded:

extension=mysql.so

And the file mysql.so is placed in /usr/lib/php/extensions/. Unfortunately I have no clue where the problem is. The weird things is that also phpinfo() doesn't show any MySQL information. The configure command is:

'./configure' '--prefix=/usr' '--disable-static' '--with-apxs=/usr/sbin/apxs' '--sysconfdir=/etc' '--enable-discard-path' '--with-config-file-path=/etc/apache' '--enable-safe-mode' '--with-openssl' '--with-mhash' '--enable-bcmath' '--with-bz2' '--with-pic' '--enable-calendar' '--enable-ctype' '--with-gdbm' '--with-db3' '--with-imap-ssl=/usr/local/lib/c-client' '--with-imap=/usr/local/lib/c-client' '--enable-dbase' '--enable-ftp' '--with-iconv' '--with-exif' '--with-gd' '--enable-gd-native-ttf' '--with-jpeg-dir=/usr' '--with-png' '--with-gmp' '--with-mysql=shared,/usr' '--with-gettext=shared,/usr' '--with-expat-dir=/usr' '--with-xml' '--enable-wddx' '--with-mm=/usr' '--enable-trans-sid' '--enable-shmop' '--enable-sockets' '--with-regex=php' '--enable-sysvsem' '--enable-sysvshm' '--enable-yp' '--enable-memory-limit' '--with-tsrm-pthreads' '--enable-shared' '--disable-debug' '--with-zlib=/usr'

It would be nice if somebody could help me with that. Thanks a lot =).

Lars

Edit: This is some output of /var/log/error_log:

PHP Warning: Unknown(): Unable to load dynamic library '/usr/lib/php/extensions/mysql.so' - libmysqlclient.so.12: cannot open shared object file: No such file or directory in Unknown on line 0

Last edited by Lars79; 08-05-2004 at 08:27 AM.
 
Old 08-05-2004, 12:04 PM   #2
Lars79
Member
 
Registered: Jan 2004
Distribution: Slackware
Posts: 96

Original Poster
Rep: Reputation: 15
After some more reading it seems to be a problem with the libmysqladmin.so.12. The problem is, I don't have that file on my system. It seems that I don't even have the client libraries, at least I don't have the /usr/lib/mysql folder. I downloaded the Linux (x86, libc6) Standard binaries, unpacked them to /usr/local/mysql and created the mysql table with scripts/mysql_install_db. So, did I miss someting or is there anything more to download?
 
Old 08-05-2004, 03:06 PM   #3
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
Quote:
--with-mysql=shared,/usr
The PHP package you got was compiled with a shared library version of MySQL, but the version you have is static. So you either have to recompile PHP against your current MySQL, or compile and install MySQL from the source.
 
Old 08-05-2004, 03:13 PM   #4
Lars79
Member
 
Registered: Jan 2004
Distribution: Slackware
Posts: 96

Original Poster
Rep: Reputation: 15
Thanks for your reply. Makes sense. I think I will compile MySQL from source.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. NoviceW Linux - Networking 17 09-17-2014 02:13 PM
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock welery Linux - Software 19 03-06-2014 07:19 AM
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. suziecorbett Linux - Software 8 10-09-2008 01:52 AM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 08:44 AM
Can't connect MySQL through PHP mac Programming 1 02-18-2002 09:23 AM


All times are GMT -5. The time now is 03:33 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration