LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Php mysql issue (https://www.linuxquestions.org/questions/linux-software-2/php-mysql-issue-365979/)

petenyce 09-22-2005 12:47 PM

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

JamieBrown 09-22-2005 05:43 PM

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. :)

jaws_tas 09-22-2005 09:01 PM

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.

JamieBrown 09-23-2005 02:17 AM

Good point jaws - I couldn't get the set up to work with the Mandriva urpmi setup, but Fedora might be different...

reddazz 09-23-2005 02:39 AM

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.


All times are GMT -5. The time now is 12:15 AM.