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 |
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! |
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:
|
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 :) |
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 :) |
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? |
Perhaps associate the *.php files as PHP-scripts?
|
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? |
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:
|
Quote:
<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! |
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 |
Quote:
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 :) |
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 |
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? :) |
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 02:45 AM. |