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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
Due to network maintenance being performed by our provider, LQ will be down starting at 05:01 AM UTC. The exact duration of the downtime isn't currently known. We apologize for the inconvenience.
|
 |
|
04-23-2006, 07:48 AM
|
#16
|
|
LQ Newbie
Registered: Apr 2006
Posts: 10
Original Poster
Rep:
|
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
|
|
|
|
04-23-2006, 08:10 AM
|
#17
|
|
Senior Member
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,375
Rep: 
|
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 08:12 AM.
|
|
|
|
04-25-2006, 03:16 AM
|
#18
|
|
LQ Newbie
Registered: Apr 2006
Posts: 10
Original Poster
Rep:
|
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
|
|
|
|
04-25-2006, 04:06 AM
|
#19
|
|
Member
Registered: Aug 2003
Location: Montpellier, France, Europe, World, Solar System
Distribution: Debian Sarge, Fedora core 5 (i386 and x86_64)
Posts: 262
Rep:
|
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.
|
|
|
|
04-26-2006, 01:41 AM
|
#20
|
|
Member
Registered: Dec 2005
Posts: 44
Rep:
|
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...
|
|
|
|
04-26-2006, 01:43 AM
|
#21
|
|
Member
Registered: Dec 2005
Posts: 44
Rep:
|
sorry not like that but like this ;-)
mysql_connect("host","user", "password") or die(mysql_error());
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 09:12 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|