LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-25-2002, 06:31 AM   #1
CyberDrake
Member
 
Registered: Feb 2002
Location: Tora Bora
Distribution: RH 7.2
Posts: 38

Rep: Reputation: 15
Apache + Php


Hi folks!
Gawd! Its Monday and i was supposed to get my Apache Server up and running, along with PHP. Talk about grounding my arse over the weekend, and still being fruitless

I've tried the installation procedures on the Apache.org and Php.net sites with relation to installing/configuring Apache and PHP respectively. But to no avail.

Could someone please guide me step by step, installing Apache 2.0.40 and making PHP4.2.3 work on it.

Thanks a lot in advance,
Sidney
 
Old 11-25-2002, 06:44 AM   #2
CyberDrake
Member
 
Registered: Feb 2002
Location: Tora Bora
Distribution: RH 7.2
Posts: 38

Original Poster
Rep: Reputation: 15
Btw I'm trying to install from a .tar.gz file and not an rpm [Hence I have to compile the source code]. Also I'm using Rh 7.1, if that helps.

Have a nice day!
 
Old 11-25-2002, 11:00 AM   #3
CyberDrake
Member
 
Registered: Feb 2002
Location: Tora Bora
Distribution: RH 7.2
Posts: 38

Original Poster
Rep: Reputation: 15
Okie dokie heres what I've done till date!

tar -xzvf httpd-2.0.40.tar.gz

./configure --prefix=/usr/local/apache2 --enable-so --enable-so --enable-rewrite --enable-module=most --enable-shared=max

make
make install
make clean

/usr/local/apache2/bin/apachectl start


Geez! After running the last command, i cant get to start the Apache server. It gives the following error:

Quote:
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down
Please Help!
 
Old 11-25-2002, 11:42 AM   #4
bladewalker
Member
 
Registered: Nov 2002
Location: UK
Distribution: Redhat 8
Posts: 30

Rep: Reputation: 15
Very easy install

Go to www.apachetoolbox.com

Download their little script

Follow the instructions and specify what you want to install - you have loads of options probally the ones you will be intereste din are apache, php, mysql, and possibly ssl

I had major problems trying to get LAMPS installed now Im all done - in only 1 hour

Post back if you need any help
 
Old 11-25-2002, 12:17 PM   #5
CyberDrake
Member
 
Registered: Feb 2002
Location: Tora Bora
Distribution: RH 7.2
Posts: 38

Original Poster
Rep: Reputation: 15
Voila! I got Apache working finally. The error/warning mentioned in my previous post was due to memory probems/couldnt bind the specific IP address to apache. Oh well all i had to do was reboot my linux system, restart Apache and pronto it works!

Now onto phase2: Installing/Configuring PHP4

Btw thanks bladewalker, would certainly check out that site
 
Old 11-25-2002, 01:39 PM   #6
CyberDrake
Member
 
Registered: Feb 2002
Location: Tora Bora
Distribution: RH 7.2
Posts: 38

Original Poster
Rep: Reputation: 15
Hmmf! I proceeded onto installing PHP4, and I guess i'm unsuccessful. Tried testing a PHP script, the output couldnt be displayed in a web-browser

Anyways i went about installing PHP in the following manner:

tar -xzvf php4-STABLE-200211241830.tar.gz

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

make
make install
make clean

/usr/local/apache/bin/apachectl restart



After which i created a Test.php in /usr/local/apache2/htdocs. Opened up a browser and typed in 127.0.0.1/Test.php, it doesnt output anything

Any ideas?
 
Old 11-25-2002, 01:49 PM   #7
Ztyx
Member
 
Registered: Dec 2001
Location: Stockholm, Sweden
Distribution: Ubuntu, Kubuntu and Debian
Posts: 338

Rep: Reputation: 30
Perhaps associate the *.php files as PHP-scripts?
 
Old 11-25-2002, 01:50 PM   #8
bladewalker
Member
 
Registered: Nov 2002
Location: UK
Distribution: Redhat 8
Posts: 30

Rep: Reputation: 15
What does it display?

Does it output the text file?
Does it just say page cannot be displayed?
What machine are you trying to get the page from - local/remote?
 
Old 11-25-2002, 01:50 PM   #9
CyberDrake
Member
 
Registered: Feb 2002
Location: Tora Bora
Distribution: RH 7.2
Posts: 38

Original Poster
Rep: Reputation: 15
Before restarting the Apache server, i also executed and made the following changes:

cp php.ini-dist /usr/local/lib/php.ini
---- It asked me whether it wants to overwrite the file in the above mentioned path. 'Y'

Then i edited the httpd.conf by adding the following line to it:
AddType application/x-httpd-php.php

On restarting the server, it gives me the following error:

Quote:
AddType requires at least two arguments, a mime type followed by one or more file extenstions
Suggestions?
 
Old 11-25-2002, 01:53 PM   #10
CyberDrake
Member
 
Registered: Feb 2002
Location: Tora Bora
Distribution: RH 7.2
Posts: 38

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by bladewalker
What does it display?

Does it output the text file?
Does it just say page cannot be displayed?
What machine are you trying to get the page from - local/remote?
This is the Test.php which i created:
<html>
<head
<title>PHP4 Test page</title>
</head>
<body>
<?php echo "Hello world"; ?>
<?php phpinfo() ?>
</body>
</html>


The PHP part of the file doesnt give any output, its just the header which gets displayed in the browser.

Btw its a localhost thingie!
 
Old 11-25-2002, 02:03 PM   #11
bladewalker
Member
 
Registered: Nov 2002
Location: UK
Distribution: Redhat 8
Posts: 30

Rep: Reputation: 15
I would say just use the apachetoolbox it was really simple

The display is what I got - it turns out I had not installed the module - doh!

There seems to be a config error in your apache config - mine reads:
And for PHP 4.x, use:
#
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps


I think it is because you havent got a space to seperate your arguments try using:
AddType application/x-httpd-php .php

instead of what you added:
AddType application/x-httpd-php.php
 
Old 11-25-2002, 02:07 PM   #12
CyberDrake
Member
 
Registered: Feb 2002
Location: Tora Bora
Distribution: RH 7.2
Posts: 38

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by bladewalker

I think it is because you havent got a space to seperate your arguments try using:
AddType application/x-httpd-php .php

instead of what you added:
AddType application/x-httpd-php.php
True that! Silly moi!

Anyways I could have used the method you suggested to install both the Apache aswell as the PHP thingie, but my professor insists to compile the whole damn friggin' source code. Hence i've no other alternative but to stick with this for the time being.

Thanks for the help m8
 
Old 11-25-2002, 02:13 PM   #13
bladewalker
Member
 
Registered: Nov 2002
Location: UK
Distribution: Redhat 8
Posts: 30

Rep: Reputation: 15
Lol no problem - I had a major headache with mine - is it working now?

Try installing SSL and mySQL into apache as well and then you'll fine out why I did about 30 installs - grrr
 
Old 11-25-2002, 02:14 PM   #14
CyberDrake
Member
 
Registered: Feb 2002
Location: Tora Bora
Distribution: RH 7.2
Posts: 38

Original Poster
Rep: Reputation: 15
I believe the installation of PHP4 is fine. I've created the above illustrated Test.php file for testing purposes. When I open my browser and type in 127.0.0.1/Test.php, a "Save File" window pops up.

The output Hello World isnt gettting displayed.

Anyways how do you go about testing whether PHP has been installed successfully or not?
 
Old 11-25-2002, 02:23 PM   #15
bladewalker
Member
 
Registered: Nov 2002
Location: UK
Distribution: Redhat 8
Posts: 30

Rep: Reputation: 15
Yep I had this problem too - it is because the php module is not installed or it cant be found - did you edit the http.conf file to add the PHP module as well?

I got round this by using the apachetoolbox and recompling apache with the option for mod_php installed it got round the problem - as far as what went wrong I don't know - sorry but I only just started this as well - I would presume PHP cant be found

It tries to save the file because it cant pass it to PHP - it sees it as an application (I think) and so prompts for download, if you try to get the file again you will find that the file contents are displayed in your browser!
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache 2, PHP 5, SuSE 9.2 - cannot run php files dickohead Linux - Networking 6 06-28-2006 11:25 AM
php apache or php cgi - php learner rblampain Linux - Security 3 12-18-2004 12:10 AM
slackware, apache and PHP from .tgz - problems with PHP szymon Slackware 2 09-06-2004 05:57 PM
reinstalled apache, php, still no php support SuSE 8.2 hindenbergbaby Linux - Software 1 10-14-2003 02:42 PM
php-nuke with apache php mysql c0c0deuz Linux - Software 0 03-30-2003 07:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:57 PM.

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