Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Solved : help needed in apache php
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
gentoo_sonam
n00b
n00b


Joined: 29 Oct 2006
Posts: 20

PostPosted: Sat Nov 25, 2006 10:14 pm    Post subject: Solved : help needed in apache php Reply with quote

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
View user's profile Send private message
tboloo
Guru
Guru


Joined: 20 Jan 2006
Posts: 403
Location: Grodzisq, Poland

PostPosted: Sat Nov 25, 2006 10:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
iluxa
Retired Dev
Retired Dev


Joined: 18 Nov 2006
Posts: 52

PostPosted: Sun Nov 26, 2006 9:26 am    Post subject: Reply with quote

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
View user's profile Send private message
bunder
Bodhisattva
Bodhisattva


Joined: 10 Apr 2004
Posts: 5947

PostPosted: Sun Nov 26, 2006 9:47 am    Post subject: Reply with quote

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
View user's profile Send private message
iluxa
Retired Dev
Retired Dev


Joined: 18 Nov 2006
Posts: 52

PostPosted: Sun Nov 26, 2006 8:34 pm    Post subject: Reply with quote

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
View user's profile Send private message
gentoo_sonam
n00b
n00b


Joined: 29 Oct 2006
Posts: 20

PostPosted: Mon Nov 27, 2006 6:16 pm    Post subject: apache not working Reply with quote

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
View user's profile Send private message
iluxa
Retired Dev
Retired Dev


Joined: 18 Nov 2006
Posts: 52

PostPosted: Mon Nov 27, 2006 11:07 pm    Post subject: Reply with quote

"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
View user's profile Send private message
gentoo_sonam
n00b
n00b


Joined: 29 Oct 2006
Posts: 20

PostPosted: Fri Dec 01, 2006 10:42 am    Post subject: Thanks guys.... Reply with quote

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
View user's profile Send private message
MLongmire
n00b
n00b


Joined: 25 Apr 2005
Posts: 4
Location: New Hampshire, USA

PostPosted: Fri Dec 01, 2006 7:52 pm    Post subject: Reply with quote

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:
Code:
<?php phpinfo() ?>
.
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
View user's profile Send private message
iluxa
Retired Dev
Retired Dev


Joined: 18 Nov 2006
Posts: 52

PostPosted: Fri Dec 01, 2006 8:43 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum