LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 04-23-2006, 08:48 AM   #16
vnb400
LQ Newbie
 
Registered: Apr 2006
Posts: 10

Original Poster
Rep: Reputation: 0

Hi

i made the following change to the /etc/php.d/mysql.ini

original was
extension=mysql.so

extension=/usr/lib/php/modules/mysql.so

now it works, was this the problem, i would like to think so.

anyway thanks to all who replied.

vnb400
 
Old 04-23-2006, 09:10 AM   #17
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Hi,

You said that it is working so that is great! There are two ways to get an extension in php, the windows approach is to load the extension, whilst the typical Linux approach is to compile it into the code. However since your system has the library it can be loaded, which is what you have just done with that change.

The .ini file has a directive called extension_dir you can set that up to the path of your extensions meaning that, so long as all your .so files are in the same directory you will not need to change the extension part of the ini file. Giving you something like:

extension_dir="/usr/lib/php/modules/"

...

extension=mysql.so
extension=mysqli.so

Last edited by graemef; 04-23-2006 at 09:12 AM.
 
Old 04-25-2006, 04:16 AM   #18
vnb400
LQ Newbie
 
Registered: Apr 2006
Posts: 10

Original Poster
Rep: Reputation: 0
Hi

It seems that specifying the location of .so file was not the actual problem.

Next day after after i had succeded i get the connect to MySQL, i tried it again and it got stuck again on the line mysql_connect("", "" "").

So i did the one thing i am good at, re-installed Linux O/S afresh and it worked the first time i tried , but on the next try it again go stuck on mysql_connect("", "", "");

The only reason this ccould be happening is maybe due to the connection not being closed. Is that possible, funniest thing is even if i reboot again it still does not work.

Any helpful advice is welcome.

vnb400
 
Old 04-25-2006, 05:06 AM   #19
zeitounator
Member
 
Registered: Aug 2003
Location: Montpellier, France, Europe, World, Solar System
Distribution: Debian Sarge, Fedora core 5 (i386 and x86_64)
Posts: 262

Rep: Reputation: 30
The helpfull advice was already given in this thread. You are using fedora core 4 (you should put that in your profile by the way so that can be seen instantly). Guessing
  • you use 'yum' as your package manager
  • 'yum' is configured correctly
In a shell logued in as root type:
Code:
yum install php-mysql
done.
 
Old 04-26-2006, 02:41 AM   #20
smallville
Member
 
Registered: Dec 2005
Posts: 44

Rep: Reputation: 15
add this i your connect line

or die(mysql_error());


so the whole line will look like this

mysql_connect("host","password", "root") or die(mysql_error());


then, it will show what's the real error... if you can't solve it, try posting it here again and we'll see what we can do...
 
Old 04-26-2006, 02:43 AM   #21
smallville
Member
 
Registered: Dec 2005
Posts: 44

Rep: Reputation: 15
sorry not like that but like this ;-)

mysql_connect("host","user", "password") or die(mysql_error());
 
  


Reply

Tags
mysql


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 03:13 PM
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock welery Linux - Software 19 03-06-2014 08:19 AM
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. suziecorbett Linux - Software 8 10-09-2008 02:52 AM
Problems with MySQL on SuSE: Can't Connect (/var/lib/mysql/mysql.sock) neocookie Linux - Software 8 02-08-2008 12:48 AM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 09:44 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration