LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 09-22-2005, 12:47 PM   #1
petenyce
Member
 
Registered: Sep 2005
Posts: 39

Rep: Reputation: 15
Php mysql issue


I installed php5 apache,mysql on fedora core 4. I cant have php read mysql??? how do i do the ./confiqure command to get php to read mysql??? I know this is my problem but dont know how to solve it

Do i have to change anything in php.ini? or httpd.conf???


Thanks
 
Old 09-22-2005, 05:43 PM   #2
JamieBrown
Member
 
Registered: Jan 2005
Location: Great Ayton, North Yorkshire, UK
Distribution: Gentoo, Mandriva, RHES, Debian
Posts: 61

Rep: Reputation: 15
Hi petenyce!

MySQL + Apache + PHP is one of these combinations that noobs like me find to be a nightmare! But I spent most of last night doing it and got it working. I'd advice you do it like this:

1) Install MySQL first. Get it working - log in to the MySQL client ("mysql" at the command prompt), create a database etc.
2) Next install apache. Again, make sure it works - visit http://127.0.0.1
3) Finally install PHP. This is the tricky bit. Make sure you use the --with-mysql command option with your compile string. I used:

./configure --with-mysql=/usr/local --with-apxs2=/usr/local/bin/apache/bin/apxs

I think. Try playing around with the path you give in --with-mysql. It might be "/usr/" or it might be /usr/local/mysql. Also - don't copy my "with-apxs2" path - you should know from when you compiled Apache where you installed it to. Finally apxs2 is for Apache2. If you're using Apache1 then use "with-apxs" instead.

If you get errors on compile after all of that then I'm fairly stumped. My only other suggestions: make sure MySQL is running when you install Apache, and I did read something about the mysql.sock file needing to be in the /tmp/ directory but it not being there. If you look in /tmp/ and can't find mysql.sock then try finding it ("find / -name mysql.sock") and creating a symlink to it.

Anyway - once you've compiled PHP its pretty simple from there - just follow the instructions on the www.php.net site and they'll tell you what you need to edit in your httpd.conf file.

Hope that helps a little!

Jamie.
 
Old 09-22-2005, 09:01 PM   #3
jaws_tas
LQ Newbie
 
Registered: Jan 2005
Posts: 25

Rep: Reputation: 15
Is there any particular reason why you are compiling from source?

I just used the Fedora 4 RPMS for each (straight of the cd's) and they worked together fine (currently running an PHP/MySQL based page - its well tested!). Then you can just upgrade the rpms as new versions are released.
 
Old 09-23-2005, 02:17 AM   #4
JamieBrown
Member
 
Registered: Jan 2005
Location: Great Ayton, North Yorkshire, UK
Distribution: Gentoo, Mandriva, RHES, Debian
Posts: 61

Rep: Reputation: 15
Good point jaws - I couldn't get the set up to work with the Mandriva urpmi setup, but Fedora might be different...
 
Old 09-23-2005, 02:39 AM   #5
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 73
Apache+PHP+MYSQL work fine on Mandriva and Fedora Core as long as you use the packages they provide. To save you the hassle do as jaws_tas said and install the rpms.
 
  


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
mysql and php issue czarherr Programming 4 04-07-2005 05:36 PM
Problem getting PHP to recognize MySQL, Using PHP 4.0 and MySQL 4.0.20 d2army Programming 4 06-27-2004 08:54 PM
php4 mysql, installation, php-pages with mysql info stay empty dnla Linux - Software 2 03-14-2004 02:54 PM
PHP + MySQL Integration issue digitalgravy Linux - Software 1 01-15-2004 10:07 AM
Apache Mysql Php: mysql with php doesn't work breakerfall Linux - Networking 6 12-27-2003 08:59 PM


All times are GMT -5. The time now is 10:13 AM.

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