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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
11-25-2002, 06:31 AM
|
#1
|
Member
Registered: Feb 2002
Location: Tora Bora
Distribution: RH 7.2
Posts: 38
Rep:
|
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
|
|
|
11-25-2002, 06:44 AM
|
#2
|
Member
Registered: Feb 2002
Location: Tora Bora
Distribution: RH 7.2
Posts: 38
Original Poster
Rep:
|
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!
|
|
|
11-25-2002, 11:00 AM
|
#3
|
Member
Registered: Feb 2002
Location: Tora Bora
Distribution: RH 7.2
Posts: 38
Original Poster
Rep:
|
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! 
|
|
|
11-25-2002, 11:42 AM
|
#4
|
Member
Registered: Nov 2002
Location: UK
Distribution: Redhat 8
Posts: 30
Rep:
|
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 
|
|
|
11-25-2002, 12:17 PM
|
#5
|
Member
Registered: Feb 2002
Location: Tora Bora
Distribution: RH 7.2
Posts: 38
Original Poster
Rep:
|
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 
|
|
|
11-25-2002, 01:39 PM
|
#6
|
Member
Registered: Feb 2002
Location: Tora Bora
Distribution: RH 7.2
Posts: 38
Original Poster
Rep:
|
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?
|
|
|
11-25-2002, 01:49 PM
|
#7
|
Member
Registered: Dec 2001
Location: Stockholm, Sweden
Distribution: Ubuntu, Kubuntu and Debian
Posts: 338
Rep:
|
Perhaps associate the *.php files as PHP-scripts?
|
|
|
11-25-2002, 01:50 PM
|
#8
|
Member
Registered: Nov 2002
Location: UK
Distribution: Redhat 8
Posts: 30
Rep:
|
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?
|
|
|
11-25-2002, 01:50 PM
|
#9
|
Member
Registered: Feb 2002
Location: Tora Bora
Distribution: RH 7.2
Posts: 38
Original Poster
Rep:
|
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?
|
|
|
11-25-2002, 01:53 PM
|
#10
|
Member
Registered: Feb 2002
Location: Tora Bora
Distribution: RH 7.2
Posts: 38
Original Poster
Rep:
|
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!
|
|
|
11-25-2002, 02:03 PM
|
#11
|
Member
Registered: Nov 2002
Location: UK
Distribution: Redhat 8
Posts: 30
Rep:
|
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
|
|
|
11-25-2002, 02:07 PM
|
#12
|
Member
Registered: Feb 2002
Location: Tora Bora
Distribution: RH 7.2
Posts: 38
Original Poster
Rep:
|
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 
|
|
|
11-25-2002, 02:13 PM
|
#13
|
Member
Registered: Nov 2002
Location: UK
Distribution: Redhat 8
Posts: 30
Rep:
|
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
|
|
|
11-25-2002, 02:14 PM
|
#14
|
Member
Registered: Feb 2002
Location: Tora Bora
Distribution: RH 7.2
Posts: 38
Original Poster
Rep:
|
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? 
|
|
|
11-25-2002, 02:23 PM
|
#15
|
Member
Registered: Nov 2002
Location: UK
Distribution: Redhat 8
Posts: 30
Rep:
|
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!
|
|
|
All times are GMT -5. The time now is 06:20 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|