View previous topic :: View next topic |
Author |
Message |
Stalione Guru
Joined: 21 Apr 2002 Posts: 335
|
Posted: Sun Apr 21, 2002 10:33 pm Post subject: Can't get php working |
|
|
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 |
|
|
klieber Bodhisattva
Joined: 17 Apr 2002 Posts: 3657 Location: San Francisco, CA
|
Posted: Sun Apr 21, 2002 11:23 pm Post subject: |
|
|
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 |
|
|
horza Guest
|
Posted: Mon Apr 22, 2002 12:01 am Post subject: Getting PHP working |
|
|
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
Joined: 21 Apr 2002 Posts: 335
|
Posted: Mon Apr 22, 2002 12:13 am Post subject: |
|
|
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 |
|
|
klieber Bodhisattva
Joined: 17 Apr 2002 Posts: 3657 Location: San Francisco, CA
|
Posted: Mon Apr 22, 2002 12:23 am Post subject: |
|
|
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 |
|
|
Stalione Guru
Joined: 21 Apr 2002 Posts: 335
|
Posted: Mon Apr 22, 2002 3:16 pm Post subject: |
|
|
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. |
|
Back to top |
|
|
Stalione Guru
Joined: 21 Apr 2002 Posts: 335
|
Posted: Tue Apr 23, 2002 3:45 pm Post subject: The mystery solved |
|
|
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 |
|
|
Felix n00b
Joined: 25 Apr 2002 Posts: 3 Location: The Netherlands
|
Posted: Thu Apr 25, 2002 2:07 pm Post subject: |
|
|
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 |
|
|
Target Apprentice
Joined: 25 Apr 2002 Posts: 200
|
Posted: Thu Apr 25, 2002 4:32 pm Post subject: |
|
|
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 |
|
|
Yoda n00b
Joined: 16 Apr 2002 Posts: 8
|
Posted: Fri Apr 26, 2002 5:16 am Post subject: |
|
|
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 |
|
|
zend Tux's lil' helper
Joined: 10 Apr 2002 Posts: 112 Location: Shanghai,China
|
Posted: Fri Apr 26, 2002 8:05 am Post subject: |
|
|
mod_ssl is same as it? |
|
Back to top |
|
|
|