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 |
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
09-04-2003, 08:19 AM
|
#1
|
Member
Registered: Nov 2002
Location: /au/qld/bne/4157
Distribution: Gentoo mactel-linux
Posts: 238
Rep:
|
mySQL, PHP, Apache Question
I have httpd 2.0.40 and php4.2.2 installed on RedHat9(an upgrade)
and in the phpinfo there is a note about '--with mysql=shared,/usr'
and later in the listing dbx support enabled 1.0.0 MySQL dbx support.
And since phpinfo produces output php is ok - but when I try to connect to a database - which is able to be connected to from the shell I get:
Fatal error: Call to undefined function: mysql_connect()
So I look at phpinfo on my web host and find that there is a section in the phpinfo that lists mysql - but my local host doesn;t have this!
So, how do I go about recompiling the php so that it have this proper mysql support and why is it listed as a --with in the configure command if it is not running?
I am trying to build a development platform that is a mirror of my hosting server so I can do mods and backups and stuff.
TIA
*.str
|
|
|
09-04-2003, 08:46 AM
|
#2
|
Member
Registered: Aug 2003
Posts: 208
Rep:
|
By using the --with-mysql[=DIR] configuration option you enable PHP to access MySQL databases.
In PHP 4, the option --with-mysql is enabled by default. To disable this default behavior, you may use the --without-mysql configure option. Also in PHP 4, if you enable MySQL without specifying the path to the MySQL install DIR, PHP will use the bundled MySQL client libraries.
That s the exact quote from the online php manual, hope it helps
|
|
|
09-04-2003, 06:43 PM
|
#3
|
Member
Registered: Nov 2002
Location: /au/qld/bne/4157
Distribution: Gentoo mactel-linux
Posts: 238
Original Poster
Rep:
|
Why does my host show a table detailing the MySQL configuration but my localhost does not? They both have the same 'configure'.
On my Web Host:
mysql
MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version 3.23.57
MYSQL_MODULE_TYPE external
MYSQL_SOCKET /var/lib/mysql/mysql.sock
MYSQL_INCLUDE -I/usr/include/mysql
MYSQL_LIBS -L/usr/lib/mysql -lmysqlclient
This table is missing on my localhost even though "configure command" specifies:
with-mysql=shared,/usr'
is this an incomplete configuration - where do I need to look to determine if PHP needs recompiling - or will I need to configure httpd somehow differently.
Please some pointers to where to look other than the manuals - I have mysql manual and php manual and apache manual and three books for using all three and I am just a bit tangled up since everything is supposedly installed ok and clearly php is running, apache is running and mysql is running/has the database - its just the connection from php/apache to the database.
TIA
dot*
|
|
|
09-05-2003, 01:03 AM
|
#4
|
Member
Registered: Jul 2003
Location: Lisbon, Portugal
Distribution: Red Hat 9.0
Posts: 30
Rep:
|
Ran into the same problems as you have - I have given up trying to figure things out from the RH9 default binaries.... right now I am opting for compiling everything from scratch first starting with PHP which has given me some trouble because it requires MySQL header files that the binaries dont seem to supply. So I am going to compile and install MySQL too today....
I will watch this thread if ~you happen to stumle on a solution....
If you decide to compile I may be able to help you. PS: please note I am a newbie too...
|
|
|
09-07-2003, 08:36 AM
|
#5
|
Member
Registered: Nov 2002
Location: /au/qld/bne/4157
Distribution: Gentoo mactel-linux
Posts: 238
Original Poster
Rep:
|
Thanks for the post and support Tuka! I will be recompiling once I get time... Just looking around for a bit for clues on how to proceed then I'll post here again!
|
|
|
09-08-2003, 05:21 AM
|
#6
|
Member
Registered: Nov 2002
Location: /au/qld/bne/4157
Distribution: Gentoo mactel-linux
Posts: 238
Original Poster
Rep:
|
OK I got the lot installed by recompiling the latest sources and making sure that I launched Apache from its new directory. Now I have phpMyAdmin installed I have the dev platform I desired.
Still don't know why the existing rpms didn't support the functions.
BTW I had to make clean in PHP to get the -with-mysql fucntion to work - it reported truncated files and I thought I was stuck but make clean fixed the problem - I don't understand - any ideas on why this is necessary - and yes I had done a 'without mysql' configuration prior.
Cheers
|
|
|
09-08-2003, 05:51 AM
|
#7
|
Member
Registered: Aug 2003
Posts: 208
Rep:
|
May I suggest going to www.hotscripts.com and looking in the php section if you ever need a php/mysql/apache server.
There is a software and servers section that has php/mysql/apache packages for both linux and windows that are one command/click installs. They come with a lot of different stuff, mine was php, mysql, apache2, phpmyadmin, phpnuke, tcl/tk, python, openssl, perl, perl::asp and some other stuff I can't remember offhand. And all it took to install was one command and I had it all installed in seconds. Just had to change a few config files and bingo!
You should take a look before going and recompiling all the stuff you need, it may save time (or a thumping headache!).
Last edited by Andy@DP; 09-08-2003 at 05:52 AM.
|
|
|
All times are GMT -5. The time now is 03:11 AM.
|
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
|
|