View previous topic :: View next topic |
Author |
Message |
gentoo_sonam n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 29 Oct 2006 Posts: 20
|
Posted: Sat Nov 25, 2006 10:14 pm Post subject: Solved : help needed in apache php |
|
|
I did:
emerge php
emerge apache
gedit /etc/conf.d/apache2
after gedit the apache2 file has 2 lines:
KEEPENV="PATH"
APACHE2_OPTS="-D PHP5"
i can get my localhost working in html but am not able to get any php outputs. When I tried
<<?php phpinfo(); ?>
saved it to phpinfo.php in localhost and tried to retreive http://localhost/phpinfo.php
it displays
<<?php phpinfo(); ?>
on the page. How can I get this working?
Last edited by gentoo_sonam on Fri Dec 01, 2006 10:45 am; edited 1 time in total |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
tboloo Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/2111798119440f3d13934f1.jpg)
Joined: 20 Jan 2006 Posts: 403 Location: Grodzisq, Poland
|
Posted: Sat Nov 25, 2006 10:22 pm Post subject: |
|
|
1. Emerge php with apache2 flag
2. alter httpd.conf. Add
Code: |
LoadModule php5_module modules/libphp5.so
AddType text/html php
|
_________________ The clock is ticking, brothers and sisters, counting down to Armageddon. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
iluxa Retired Dev
![Retired Dev Retired Dev](/images/ranks/rank-retired.gif)
![](images/avatars/923725164455e6bd9e66f5.jpg)
Joined: 18 Nov 2006 Posts: 52
|
Posted: Sun Nov 26, 2006 9:26 am Post subject: |
|
|
tboloo wrote: | 1. Emerge php with apache2 flag
2. alter httpd.conf. Add
Code: |
LoadModule php5_module modules/libphp5.so
AddType text/html php
|
|
Emerge php with apache2 use flag - that's correct
Adding LoadModule to httpd.conf - should not be. Adding -DPHP5 to /etc/conf.d/apache2, like tboloo already did is sufficient. _________________ Ilya A. Volynets-Evenbakh
Total Knowledge. CTO
http://www.total-knowledge.com
CPPSERV: C++ Servlet Container and CSP (C++ Server Pages) parser: Application server for Real Programmers(TM) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
bunder Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
Joined: 10 Apr 2004 Posts: 5947
|
Posted: Sun Nov 26, 2006 9:47 am Post subject: |
|
|
shouldn't php be emerged after apache, not before? _________________
Neddyseagoon wrote: | The problem with leaving is that you can only do it once and it reduces your influence. |
banned from #gentoo since sept 2017 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
iluxa Retired Dev
![Retired Dev Retired Dev](/images/ranks/rank-retired.gif)
![](images/avatars/923725164455e6bd9e66f5.jpg)
Joined: 18 Nov 2006 Posts: 52
|
Posted: Sun Nov 26, 2006 8:34 pm Post subject: |
|
|
bunder wrote: | shouldn't php be emerged after apache, not before? |
If it were emerged with correct use flags, apache would have been automatically pulled in. _________________ Ilya A. Volynets-Evenbakh
Total Knowledge. CTO
http://www.total-knowledge.com
CPPSERV: C++ Servlet Container and CSP (C++ Server Pages) parser: Application server for Real Programmers(TM) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
gentoo_sonam n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 29 Oct 2006 Posts: 20
|
Posted: Mon Nov 27, 2006 6:16 pm Post subject: apache not working |
|
|
i did
emerge --unmerge apache2
emerge --unmerge php
edited make.conf in /etc to look like:
USE="gtk gnome qt kde dvd alsa cdr hal howl imap maildir mysql apache2"
emerge apache2
emerge php
Now my apache isn't working...when i try http://localhost , it says page not found...
i tried restarting my apache2 aswell |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
iluxa Retired Dev
![Retired Dev Retired Dev](/images/ranks/rank-retired.gif)
![](images/avatars/923725164455e6bd9e66f5.jpg)
Joined: 18 Nov 2006 Posts: 52
|
Posted: Mon Nov 27, 2006 11:07 pm Post subject: |
|
|
"Page not found" as in standard 404 response, or as in "Unable to connect"?
Take a look at /var/log/apache2/error_log as well, and see if there is anything
interesting there. _________________ Ilya A. Volynets-Evenbakh
Total Knowledge. CTO
http://www.total-knowledge.com
CPPSERV: C++ Servlet Container and CSP (C++ Server Pages) parser: Application server for Real Programmers(TM) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
gentoo_sonam n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 29 Oct 2006 Posts: 20
|
Posted: Fri Dec 01, 2006 10:42 am Post subject: Thanks guys.... |
|
|
Got it working ...
i unmerged apache2 and php again...
then did
emerge apache
changed the package.use file to contain
dev-lang/php -* apache2 cgi cli ctype fastbuild pcre session
then did emerge php
it started working... |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
MLongmire n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/131878090445708bf58e112.gif)
Joined: 25 Apr 2005 Posts: 4 Location: New Hampshire, USA
|
Posted: Fri Dec 01, 2006 7:52 pm Post subject: |
|
|
I found that after installing apache and php, my php was not working, either. I tried all the suggestions here, but no go.
My php test was to edit the default index.html.en file from apache and add:
.
Adding this line in /etc/apache2/modules.d/70_mod_php5.conf seemd to do the trick:
Code: | AddType application/x-httpd-php .html |
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
iluxa Retired Dev
![Retired Dev Retired Dev](/images/ranks/rank-retired.gif)
![](images/avatars/923725164455e6bd9e66f5.jpg)
Joined: 18 Nov 2006 Posts: 52
|
Posted: Fri Dec 01, 2006 8:43 pm Post subject: |
|
|
MLongmire wrote: | I found that after installing apache and php, my php was not working, either. I tried all the suggestions here, but no go.
My php test was to edit the default index.html.en file from apache and add:
|
Why would you want to process your html files with PHP? Not such a good idea, if you
ever want to serve any static content. _________________ Ilya A. Volynets-Evenbakh
Total Knowledge. CTO
http://www.total-knowledge.com
CPPSERV: C++ Servlet Container and CSP (C++ Server Pages) parser: Application server for Real Programmers(TM) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|