Click to See Complete Forum and Search --> : redhat 7, mysql and php


markymark
11-19-2000, 08:00 PM
Hey,

I just installed RedHat 7 (my first time using nix) and am trying to get MySQL and PHP going. Can someone please tell me how I should go about this? RPMs? I tried downloading the MySQL source tar but when I wasn't able to get the right --with-apace=DIR. So I tried the RPMs, it worked, so I tried RPMs with PHP. PHP worked but PHP and MySQL didn't work together. Actually, could the problem be that I used 'localhost' for the db host?

Thanks,
markymark

H++
11-20-2000, 06:22 AM
Since I'm rather new to the game I can't promise that this will work but this is how I did it.

I installed all the Mysql rpms, source, client, dev, yadda yadda.. all.

I downloaded and extracted the source for php and apache.

In Apache source dir:
./configure --prefix=/where/you/want/it/to/be

In php source dir:
./configure --with-mysql --with-apache=/apache/source/dir --enable-track-vars --enable-trans-sid

make

make install

back to apache source dir:

./configure --prefix=/where/you/want/it --activate-module=src/modules/php4/libphp4.a

make

make install

back to php source dir:

cp php.ini-dist /usr/local/lib/php.ini

Edit your *httpd.conf or *srm.conf file and add:

AddType application/x-httpd-php .php

cp **httpd /usr/sbin/httpd

fire it up and connect to it

Have a look at http://www.zend.com/manual/install.unix.php

One time I had to run ./configure in the mysql source dir and add (in php source dir) ./configure --with-mysql=/mysql/source/dir to get it to work.

* -> /where/you/want/it/conf
** -> /where/you/want/it/bin

hope it helps..



[This message has been edited by H++ (edited 20 November 2000).]

Sweede
11-20-2000, 01:12 PM
H++ is pretty close, but dont compile php into apache, compile as a DSO module.

download apache, php sources, MySQL 3.23.27 RPMS (Server, Client, Devel and shared. Downloading the src.rpm is smaller and recompiling it, but it takes longer).

untar apache and php,
cd apache_1.3.14
./configure \
--with-modules=most \
--enable-shared=all \
--with-layout=RedHat \
[other options]
make
make install
cd ../php
./configure \
--with-apxs=/usr/sbin/apxs \
--with-zlib \ <~VERY IMPORTANT
--enable-track-vars \
[other options]

edit /etc/httpd/conf/httpd.conf and uncomment around line 600 i think,

AddType application/x-httpd-php .php
AddType application/x-httpd-phps .phps

start apache.

H++
11-21-2000, 07:06 AM
What's a DSO module and what are the pros and cons of a such module versus compling it into apache?

/Hilding

Sweede
11-21-2000, 12:57 PM
Dynamic Shared Object = DSO

a DSO is linked into apache instead of compile, making it easy to add/remove support for whatever module.

it also makes it increadably easy to upgrade items that dont change as much as Apache, such as PHP. or implementing new modules is easy since they do not require a new rebuild of apache.

VRay
11-21-2000, 02:10 PM
How did it go, markymark? I could not get php and mysql to work with RH7. Had more luck with the bibaries than the rpms, but i never got it working....

Sweede
11-21-2000, 03:16 PM
VRay, what do you mean by not working?

did apache just seem to die for no reason ??
if so, your probably using MySQL 3.23.2x correct??

when compiling php, be absolutly sure to specify --with-zlib and anything else that will be compiled with mysql support or compiled into php/apache, be sure that the EXTRA_LIBS= or CF_LIBS= flag in the main Makefile , Make.rules or whatever, also has -lz .

i had to do this for proftpd to compile with mysql support.

VRay
11-21-2000, 03:49 PM
No, no apache death, just files not found...
I used the latest rpms from redhat update ftp, it seemed to me that the rpms installed some files in the 'wrong' place...but i am a newbie so... I was trying to check out phpNuke.

I'll give it another shot using the advice above...

[This message has been edited by VRay (edited 21 November 2000).]