Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Can't get php working
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Stalione
Guru
Guru


Joined: 21 Apr 2002
Posts: 335

PostPosted: Sun Apr 21, 2002 10:33 pm    Post subject: Can't get php working Reply with quote

After batteling the installation of php for a long time, i finally got php to install properly...or so I think. Before when I was installing php (emerge php i was getting errors regarding java vm libs...please see https://forums.gentoo.org/viewtopic.php?t=567 ) Well i finally got php installed without erroring out on me. Then I created a file called phptest.php with the following line of code. But for some reason teh php parser is not parsing the code .... I also did a http://localhost/server-info and found that mod_php is loading. Can anyone help??

<?php
phpinfo();
?>

this is what shows up when i do a server-info
Server Settings, mod_php4.c, mod_setenvif.c, mod_so.c, mod_unique_id.c, mod_example.c, mod_usertrack.c,
Back to top
View user's profile Send private message
klieber
Bodhisattva
Bodhisattva


Joined: 17 Apr 2002
Posts: 3657
Location: San Francisco, CA

PostPosted: Sun Apr 21, 2002 11:23 pm    Post subject: Reply with quote

Do you have the proper entries for php in your mime.types file?

--kurt
_________________
The problem with political jokes is that they get elected
Back to top
View user's profile Send private message
horza
Guest





PostPosted: Mon Apr 22, 2002 12:01 am    Post subject: Getting PHP working Reply with quote

What Gentoo is to getting Linux and a desktop up and working, Apache Toolbox does for Apache servers. Will install PHP, mod_perl plus dozens of others, all up and integrated (compiled from source, naturally). Give it a go, I recommend it.

Phillip.
Back to top
Stalione
Guru
Guru


Joined: 21 Apr 2002
Posts: 335

PostPosted: Mon Apr 22, 2002 12:13 am    Post subject: Reply with quote

Yeah I made sure that the mime type was specified. Both for php3 and 4.
Too bad gentoo does not have a build for apachetoolbox
Back to top
View user's profile Send private message
klieber
Bodhisattva
Bodhisattva


Joined: 17 Apr 2002
Posts: 3657
Location: San Francisco, CA

PostPosted: Mon Apr 22, 2002 12:23 am    Post subject: Reply with quote

Can you post the relevant portions of your httpd.conf file and mime.types file? Also, are you getting any error messages in your apache error log?

--kurt
_________________
The problem with political jokes is that they get elected
Back to top
View user's profile Send private message
Stalione
Guru
Guru


Joined: 21 Apr 2002
Posts: 335

PostPosted: Mon Apr 22, 2002 3:16 pm    Post subject: Reply with quote

Kurt,
I got so frustrated that I decided to try out ApacheToolBox but to my disappointment I can't get even the webserver working. I have never had problems building apache and php....but for some strange reason I am just struggling with gentoo on this issue. I am goign to remove ApacheToolBox and remerge apache and php and try it again. I will also post my config file on here for your knowledgeable eyes. 8O
Back to top
View user's profile Send private message
Stalione
Guru
Guru


Joined: 21 Apr 2002
Posts: 335

PostPosted: Tue Apr 23, 2002 3:45 pm    Post subject: The mystery solved Reply with quote

Hello folks,
After my long struggle with Apache and PHP in Gentoo, I have finally figured out what I did wrong. I noticed that Gentoo lay's out the Apache config files much differently (yet intutively) as opposed to if you were to compile Apache from source yourself (instead of using emerge that is). Normally I always had one httpd.conf/apache.conf file with everything in it, General Server settings, Mime settings, Virtual Hosts, etc. But Gentoo actually split these up into:
apache.conf
commonapache.conf
magic
mime.types

Once you have installed Apache and php (emerge apache php) to get your apaceh to load php add the following lines in commonapache.conf file under
<IfModule mod_negotiation.c>
LanguagePriority en fr de es it da nl et el ja kr no pl pt pt-br ru ltz ca sv tw
</IfModule>



Quote:

#php3
AddType application/x-httpd-php3 .php3
AddType application/x-httpd-php3-source .php3s

#php4
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps


Also add the following lines to your apache.conf under LoadModule and AddModule:
under LoadModule:
Quote:

LoadModule php4_module modules/libphp4.so


under AddModule:

Quote:

AddModule mod_php4.c


Yes this stuff is simple and mentioned in many places....but i was so used to doign it all in jsut one file that i got all confused. Thank you all for helping me. Hope this helps others ...
Back to top
View user's profile Send private message
Felix
n00b
n00b


Joined: 25 Apr 2002
Posts: 3
Location: The Netherlands

PostPosted: Thu Apr 25, 2002 2:07 pm    Post subject: Reply with quote

My additions to apache.conf to make it work:

Note the extramodules instead modules
Code:

LoadModule php4_module extramodules/libphp4.so


Code:

AddModule mod_php4.c


Code:

###
### PHP
###
Include conf/addon-modules/mod_php.conf


Seems to work now :)
Back to top
View user's profile Send private message
Target
Apprentice
Apprentice


Joined: 25 Apr 2002
Posts: 200

PostPosted: Thu Apr 25, 2002 4:32 pm    Post subject: Reply with quote

I had the same problem.

Turns out that installing PHP and putting -D PHP4 into /etc/conf.d/apache did get the php module to start loading, but it didn't include conf/addon-modules/mod_php.conf for the mimetypes.

Adding the include to apache.conf caused php to start getting parsed.
Back to top
View user's profile Send private message
Yoda
n00b
n00b


Joined: 16 Apr 2002
Posts: 8

PostPosted: Fri Apr 26, 2002 5:16 am    Post subject: Reply with quote

Donny wrote:
You need to do this:
bash #ebuild /var/db/pkg/dev-lang/php-*/php-*.ebuild config

This will "turn on" the php mime types in the Apache configuration
file, and will fix your problem. A message was printed to your
screen after you installed php, telling you to do this, but I guess
you missed it.


This makes things *very* easy.
Back to top
View user's profile Send private message
zend
Tux's lil' helper
Tux's lil' helper


Joined: 10 Apr 2002
Posts: 112
Location: Shanghai,China

PostPosted: Fri Apr 26, 2002 8:05 am    Post subject: Reply with quote

mod_ssl is same as it?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming 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