Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to make apache work with 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
keykeen
n00b
n00b


Joined: 31 Jan 2005
Posts: 44
Location: Athena

PostPosted: Sun Feb 20, 2005 7:32 pm    Post subject: How to make apache work with php Reply with quote

The apache has work well in my pc for one month or more.
Now I want to add php support ,so I
emerge php
And then, how to make them work together,
the test.php doesnot work at all.

I looked for some document,it told me to add such lines
to httpd.conf:
LoadModule php4_module modules/libphp4.so
AddType application/x-httpd-php .php
But I cannot find the libphp4.so
Should I build the php with some special argument?

apache 1.3.33,php 4.3.10
_________________
Nothing for happy.


Last edited by keykeen on Sun Feb 20, 2005 7:43 pm; edited 2 times in total
Back to top
View user's profile Send private message
TheRAt
Veteran
Veteran


Joined: 03 Jun 2002
Posts: 1580

PostPosted: Sun Feb 20, 2005 7:40 pm    Post subject: Reply with quote

Did you enter the following in your /etc/conf.d/apache2 file?
Code:
APACHE2_OPTS="-D PHP5"

_________________
All reality is the construct of the observer.

Get Firefox and rediscover the web!

BOFH Excuse #295:
The Token fell out of the ring. Call us when you find it.
Back to top
View user's profile Send private message
keykeen
n00b
n00b


Joined: 31 Jan 2005
Posts: 44
Location: Athena

PostPosted: Sun Feb 20, 2005 7:48 pm    Post subject: Reply with quote

I have uncommented this line,not work still.
APACHE_OPTS="-D SSL -D PHP4"
_________________
Nothing for happy.
Back to top
View user's profile Send private message
lookinin
Guru
Guru


Joined: 21 Jan 2005
Posts: 486

PostPosted: Sun Feb 20, 2005 8:13 pm    Post subject: Re: How to make apache work with php Reply with quote

keykeen wrote:
Now I want to add php support ,so I
emerge php


Hi there, unless you mistyped this, you need to emerge mod_php, not php. php is a command line interpreter, mod_php is the apache module.
Back to top
View user's profile Send private message
TheRAt
Veteran
Veteran


Joined: 03 Jun 2002
Posts: 1580

PostPosted: Sun Feb 20, 2005 8:22 pm    Post subject: Reply with quote

did you restart apache?
_________________
All reality is the construct of the observer.

Get Firefox and rediscover the web!

BOFH Excuse #295:
The Token fell out of the ring. Call us when you find it.
Back to top
View user's profile Send private message
keykeen
n00b
n00b


Joined: 31 Jan 2005
Posts: 44
Location: Athena

PostPosted: Sun Feb 20, 2005 8:51 pm    Post subject: Reply with quote

en,I just emerge mod_php ,I find the libphp4.so has appear at /etc/apache/module/libphp4.so
and /usr/lib/apache/libphp4.so and /usr/lib/apache-extramodules/libphp4.so

This two line are in /etc/apache/conf/httpd.conf
I also add the first line to /etc/apache/conf/apache.conf,by a hope it may work.*_*

LoadModule php4_module modules/libphp4.so
AddType application/x-httpd-php .php

and restart apache,
doesnot work still,how could i do?
_________________
Nothing for happy.


Last edited by keykeen on Sun Feb 20, 2005 8:57 pm; edited 1 time in total
Back to top
View user's profile Send private message
TheRAt
Veteran
Veteran


Joined: 03 Jun 2002
Posts: 1580

PostPosted: Sun Feb 20, 2005 8:55 pm    Post subject: Reply with quote

You are certain that you are using PHP4, not PHP5? according to your conf file, you have enabled PHP4..
_________________
All reality is the construct of the observer.

Get Firefox and rediscover the web!

BOFH Excuse #295:
The Token fell out of the ring. Call us when you find it.
Back to top
View user's profile Send private message
keykeen
n00b
n00b


Joined: 31 Jan 2005
Posts: 44
Location: Athena

PostPosted: Sun Feb 20, 2005 8:58 pm    Post subject: Reply with quote

yes.
Code:
[susu:~]$ php -v
PHP 4.3.10 (cli) (built: Feb 21 2005 04:37:21)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies

_________________
Nothing for happy.
Back to top
View user's profile Send private message
lookinin
Guru
Guru


Joined: 21 Jan 2005
Posts: 486

PostPosted: Sun Feb 20, 2005 9:35 pm    Post subject: Reply with quote

I just realized you are using apache 1.3 - I am not sure how to advise you on that - can anyone else help?
Back to top
View user's profile Send private message
keykeen
n00b
n00b


Joined: 31 Jan 2005
Posts: 44
Location: Athena

PostPosted: Wed Feb 23, 2005 11:35 am    Post subject: Reply with quote

hmm,in gentoo,after emege apache-1.3.33,php,mod_php,
what extra i need to do to make the apache support the php?
Could you give some more ideas?
_________________
Nothing for happy.
Back to top
View user's profile Send private message
blakegrover
n00b
n00b


Joined: 31 Oct 2004
Posts: 23
Location: Idaho

PostPosted: Wed Feb 23, 2005 9:03 pm    Post subject: Apache 1.33 and PHP 4 Reply with quote

I also am having trouble swith Apache and PHP, I do not want to use Apache 2, and would like to have PHP working on Apache 1.33. If anyone has any help or suggestions I would appreciate it.

Thanks
Blake
Back to top
View user's profile Send private message
keykeen
n00b
n00b


Joined: 31 Jan 2005
Posts: 44
Location: Athena

PostPosted: Sun Feb 27, 2005 12:23 am    Post subject: Reply with quote

anyone give some more suggestions?
php still doesnot work..
_________________
Nothing for happy.
Back to top
View user's profile Send private message
ronnie
n00b
n00b


Joined: 21 Jul 2004
Posts: 66

PostPosted: Sun Feb 27, 2005 12:51 am    Post subject: Reply with quote

What exactly is not working? Do you get any error messages? Do you see the php script in clear text in a browser?

1. Check your apache errorlog.

2. Check if if have php enabled/configured in /etc/apache/conf/modules.d/XX_mod_php.conf (not sure for apache1, but apache2 has this).

3. Browse a page which doesn't exist, i.e. http://yourhost/foobar425161 and see the server message footer if php is enabled.

4. Try the simpliest php script,
Code:
<?php phpinfo() ?>
Back to top
View user's profile Send private message
keykeen
n00b
n00b


Joined: 31 Jan 2005
Posts: 44
Location: Athena

PostPosted: Sun Feb 27, 2005 2:53 am    Post subject: Reply with quote

ronnie wrote:
What exactly is not working? Do you get any error messages? Do you see the php script in clear text in a browser?

1. Check your apache errorlog.
2. Check if if have php enabled/configured in /etc/apache/conf/modules.d/XX_mod_php.conf (not sure for apache1, but apache2 has this).
3. Browse a page which doesn't exist, i.e. http://yourhost/foobar425161 and see the server message footer if php is enabled.
4. Try the simpliest php script,
Code:
<?php phpinfo() ?>


1,in log,i found
Code:

[Sun Feb 27 11:03:18 2005] [notice] caught SIGTERM, shutting down
[Sun Feb 27 11:03:21 2005] [notice] Apache/1.3.33 (Unix)  (Gentoo/Linux) PHP/4.3.10 configured -- resuming normal operations
[Sun Feb 27 11:03:21 2005] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sun Feb 27 11:03:21 2005] [notice] Accept mutex: sysvsem (Default: sysvsem)

2,it doesnot have modules.d this directory,but have a addon_modules directory which contain mod_php and mod_ssl
3,the footer:Apache/1.3.33 Server at localhost Port 80
4,browser return the php code text itself.

in http://localhost/server-info
it shows:
Code:

Module Name: mod_php4.c
Content handlers: application/x-httpd-php , application/x-httpd-php-source , text/html
Configuration Phase Participation: Create Directory Config, Merge Directory Configs, Child Exit
Request Phase Participation: none
Module Directives:
    php_value - PHP Value Modifier
    php_flag - PHP Flag Modifier
    php_admin_value - PHP Value Modifier (Admin)
    php_admin_flag - PHP Flag Modifier (Admin)
Current Configuration:
[/quote]
_________________
Nothing for happy.
Back to top
View user's profile Send private message
ronnie
n00b
n00b


Joined: 21 Jul 2004
Posts: 66

PostPosted: Sun Feb 27, 2005 6:24 pm    Post subject: Reply with quote

keykeen wrote:

2,it doesnot have modules.d this directory,but have a addon_modules directory which contain mod_php and mod_ssl

Check the mod_php file. If it starts with <IfDefine XXXX> then XXXX is needed in APACHE_OPTS in /etc/conf.d/apache, ex. APACHE_OPTS="-D XXXX". Note: I'm just guessing the config files since I've never used apache 1.
Check the rest of the file to see that everything looks correct (file paths etc.).
Back to top
View user's profile Send private message
peter96362930
Tux's lil' helper
Tux's lil' helper


Joined: 26 Oct 2003
Posts: 141
Location: S.E. Asia

PostPosted: Sat Mar 12, 2005 2:47 am    Post subject: Reply with quote

I was having the same problem where the php pages were just served up as text. It's working for me now. All I did was;

1) re-emerge mod_php just to make sure it was installed ok
2) Make sure that /etc/conf.d/apache2 has this line in it;
Code:
APACHE2_OPTS="-D PHP4"

3) Restart apache;
Code:
/etc/init.d/apache2 restart


And then everything started working as it should.
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