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 09-04-2003, 08:19 AM   #1
stardotstar
Member
 
Registered: Nov 2002
Location: /au/qld/bne/4157
Distribution: Gentoo mactel-linux
Posts: 238

Rep: Reputation: 30
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
 
Old 09-04-2003, 08:46 AM   #2
Andy@DP
Member
 
Registered: Aug 2003
Location: Aberdeen, UK.
Distribution: Debian, Ubuntu
Posts: 208
Blog Entries: 2

Rep: Reputation: 30
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
 
Old 09-04-2003, 06:43 PM   #3
stardotstar
Member
 
Registered: Nov 2002
Location: /au/qld/bne/4157
Distribution: Gentoo mactel-linux
Posts: 238

Original Poster
Rep: Reputation: 30
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*
 
Old 09-05-2003, 01:03 AM   #4
tuka
Member
 
Registered: Jul 2003
Location: Lisbon, Portugal
Distribution: Red Hat 9.0
Posts: 30

Rep: Reputation: 15
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...
 
Old 09-07-2003, 08:36 AM   #5
stardotstar
Member
 
Registered: Nov 2002
Location: /au/qld/bne/4157
Distribution: Gentoo mactel-linux
Posts: 238

Original Poster
Rep: Reputation: 30
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!
 
Old 09-08-2003, 05:21 AM   #6
stardotstar
Member
 
Registered: Nov 2002
Location: /au/qld/bne/4157
Distribution: Gentoo mactel-linux
Posts: 238

Original Poster
Rep: Reputation: 30
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
 
Old 09-08-2003, 05:51 AM   #7
Andy@DP
Member
 
Registered: Aug 2003
Location: Aberdeen, UK.
Distribution: Debian, Ubuntu
Posts: 208
Blog Entries: 2

Rep: Reputation: 30
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.
 
  


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
Question about PHP-MySQL-Apache on Solaris ghouliajoolia Solaris / OpenSolaris 7 06-20-2005 10:37 PM
Apache Mysql Php: mysql with php doesn't work breakerfall Linux - Networking 6 12-27-2003 09:59 PM
php-nuke with apache php mysql c0c0deuz Linux - Software 0 03-30-2003 07:23 AM
Apache/MySQL/PHP c0c0deuz Linux - General 2 05-18-2002 04:55 PM
PHP, MySQL and Apache miker Linux - Newbie 1 03-27-2002 02:29 PM


All times are GMT -5. The time now is 04:57 AM.

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