Click to See Complete Forum and Search --> : How do I compile php into apache?
kornp
04-03-2002, 12:38 PM
I installed redhad linux 7.2 with apache webserver, but I can't use php right now. I think I just need to compile php into the apache kernel thinger (or so i'm told). How do I do this? Please explain in simple terms. Thanx
Choozo
04-03-2002, 03:18 PM
www.e-gineer.com (http://www.e-gineer.com) have good instructions on this (if you compiled Apache from source).
kornp
04-03-2002, 07:15 PM
I didn't compile apache from source...the redhat installer did it all for me. Will these instructions still work?
Choozo
04-04-2002, 02:56 AM
No, not unless you remove the Apache, PHP, and MySQL packages installed, and then download the source for each and compile from there using the e-gineer instructions.
If you installed Apache, MySQL and PHP during the installation of RedHat, everything should be set up to run straight away.
What makes you say that you "can't use PHP right now"? How did you test this? Did you check any documentation on this?
J-Tek
04-04-2002, 03:22 AM
your better off installing from source. you learn so much more that way..
easy tutorial on www.webmonkey.com (http://www.webmonkey.com)
kornp
04-04-2002, 09:03 PM
I am under the impression that php is not working because if i put a php script on the server it doesn't process it as php, it just pretends it's html. (and yes, i did end the file with ".php") But I'm not even entirely sure that php is really installed...all I can find related to php on the server are a few documents. I think I'll try to add the php package to the server from the redhat CD, but can't right now because I'm not at my school (where the server is). I don't really want to install apache/php/mySQL from source right now (maybee later) because the server needs to be up and available until may 1. I am worried that if i try to install the software and mess up it will be down for too long. I'll try php from the CD though, then if that doesn't work I'll probably install the how shabang from source in May. Thanx for all the help along the way!
Stuka
04-05-2002, 02:04 PM
Did you perform the following steps (from the INSTALL doc in the php distribution)?
15. cd ../php-x.x.x
16. for PHP 3: cp php3.ini-dist /usr/local/lib/php3.ini
for PHP 4: cp php.ini-dist /usr/local/lib/php.ini
You can edit your .ini file to set PHP options. If
you prefer this file in another location, use
--with-config-file-path=/path in step 8.
17. Edit your httpd.conf or srm.conf file and add:
For PHP 3: AddType application/x-httpd-php3 .php3
For PHP 4: AddType application/x-httpd-php .php
I just added the latest PHP to my Apache setup on Slack 8 (and not too long ago on pair.com's FreeBSD machine that our company uses). If PHP is there, but these lines are missing, you'll get the source code (or a hybrid mess, depending on the code...).
[ 05 April 2002: Message edited by: Stuka ]
kornp
04-05-2002, 06:10 PM
The only folder on my server with the name "php-x.x.x" (which happens to be "php-4.0.6") is in /usr/share/doc and all it contains is php documentation. The other php directories I have are /usr/share/php, which contains some .php files...which my server won't process :S right now. I am guessing this means that php isn't actually installed on my server. I don't know why the documentation is there...but other stuff isn't there. Am I correct in thinking this? Thanx for the help.
kornp
04-09-2002, 03:12 PM
For some reason I can't boot off of the CD's any more (probably due to scratches) but I can still get the php RPM off of the cd. Now (at the risk of sounding like an idiot) how do I install an RPM file? Also, when redhat was installing it mentioned a text based browser...but I can't figure out what it is. It's not lynx...any ideas what it would be? Thanx in advance.
kornp
04-11-2002, 12:29 PM
I solved one problem, it's links, not lynx, but how do I install RPMs?
Alex Merek
04-11-2002, 01:47 PM
use the rpm utility. Type rpm --help for you know what. :D
kornp
04-12-2002, 01:35 PM
Okay, apparently php was actually installed, apache just wasn't configured to use it. It had tags like <ifdefine HAVE_PHP4> around the commands to load the module. I removed these and now it works properly. Should I have done this differently? or is it fine to just delete these tags?
Disc0stoo
04-12-2002, 03:16 PM
That's exactly how you do it. I don't know if there is any "better" way, but that's how I've always done it. Of course I really don't know jack about apache...
kornp
04-14-2002, 01:48 AM
Okay, that makes me feel a bit better :D. I'm curious what would happen if you just put <Define HAVE_PHP4> at the top of the config....i think i'll try it on monday when i can get to my server again. (It's at my school, and the janitor keeps shutting it off :mad: )
Choozo
04-14-2002, 09:49 AM
Don't try adding <Define HAVE_PHP4> to the httpd.conf file as this have no meaning at all.
The <ifdefine HAVE_PHP4> line(s) that you removed should actually be there. What you should have done is to look for the script file where the 'variable' HAVE_PHP4 is defined, and make sure it's being used/defined.
Have a look into your '/etc/rc.d/init.d/httpd' script and see if you can locate the script/file containing these 'variables'.
Cheers :)