# Php in apache 1.3.26, how to?

## knekten

I've allready installed apache 1.3.26 ( emerge apache ) and it's up running ( at least I think so). Now I need to get php to run in apache, but I'm not quite sure how to do it. Is it just to use the emerge mod_php command? I've allready tried that, but I don't know for sure what files to configure in order to  get things to work properly. So, my question is: What should I do (after installed apache) in order to get php up running?

----------

## rac

Did you follow the instructions to run ebuild config on the mod_php ebuild that are given to you at the end of the mod_php emerge process?  That should set everything up for you.

----------

## knekten

I'll try that =)

----------

## knekten

I've now followed the instructions after the mod_php install (the ebuild command and uncommented the last sentence in /etc/conf.d/apache and deleted the -d ssl option). Still it doesn't work. Is there something I have forgotten? Is there any other files that need to be configured?

----------

## rizzo

Have you stopped and started apache after all the mod_php configuration?

----------

## knekten

Yup, I have, still it doesn't work. Do I have to change somthing in /etc/apache/conf/apache.conf or /etc/apache/conf/commonapache.conf?

----------

## rizzo

You'll need these to blocks of code in the apache.conf.  Each goes into a different section.  I think the extra config at the end of the ebuild should do this automatically:

```

<IfDefine PHP4>

LoadModule php4_module    extramodules/libphp4.so

</IfDefine>

<IfDefine PHP4>

AddModule mod_php4.c

</IfDefine>

```

----------

## knekten

They're all there in the apache.conf file. I find it strange that php isn't working, since I have no problems with apache...

----------

## rizzo

What are you seeing that leads you to believe it isn't working?

----------

## knekten

well, when I'm about to look at my test.php file, the only thing printed out on the screen is:

<?

phpinfo();

?>

----------

## bacouch

Try 

<?php

phpinfo();

?>

----------

## knekten

Already did, and still no working php  :Sad: 

----------

## rac

Does the startup banner in the apache error log file indicate that mod_php is actually loaded?

EDIT: sorry, forgot this was the Newbies forum.  That was not a very good answer.  Can you try: 

```
$ grep -iw php /var/log/apache/error.log
```

----------

## knekten

The only errors in the log are the ones displayed when I'm trying to view a html file (in mozilla) with "my user", and the user obviously doesn't own the rights to do it...

No mention about php can't load (or anything else).

----------

## rac

Did you run the grep command I suggested?  If you get no response, then mod_php is not actually running.

----------

## knekten

Then I guess it doesn't load when I start apache..... 

Strange, I belive libphp4.so is in the correct map (extramodules or something like that) and the links to that file is also correct...

----------

## qwerty

Hi ! It wont work for me too

I have the same problems.

I have apache 1.3.27 with php_mod 4.2.2-r1 installed

[Thu Oct 10 07:46:48 2002] [notice] SIGUSR1 received.  Doing graceful restart

[Thu Oct 10 07:46:49 2002] [notice] Apache/1.3.26 (Unix) configured -- resuming normal operations

[Thu Oct 10 07:46:49 2002] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)

[Thu Oct 10 07:46:49 2002] [notice] Accept mutex: sysvsem (Default: sysvsem)

As you seen, after restarting no errors occured

greetings

qwerty

----------

## qwerty

hey !

after rebooting my box it worked .. dont know why ...

but try do to the windows thing  :Wink: 

qwerty

----------

## knekten

When I start up apache I get the following msg:

 [alert] apache: Could not determine the server's fully qualified domain name, using 192.168.1.1 for ServerName

/usr/sbin/apachectl start: httpd started

Think that could have something to do with it?

----------

## knekten

....

i got it to work now.... don't know what i did or didn't do when i didn't get it to work. I might have forgotten to do the rc-update command, but i don't think so. anyway, after a reboot it just works out as it should....

when I had lost all hope  :Very Happy: 

SUCCESS!

----------

## rac

Glad it's working now.  For the two of you that jumped on the reboot express, I'm betting that 

```
# /etc/init.d/apache stop

# /etc/init.d/apache start
```

...would have done the trick.

----------

## qwerty

Haha, youre funny  :Wink: 

That didn't work for me

----------

## jesusisarastaman

Hi !

Well, I get the same problem.

In fact, I used nano on the same console than emerge mod_php, then the help messages were gone (stupid isn't it ?)

I tought the conf files was in /etc/apache/ so I check the files there and see that all was OK for the PHP.

Try to stop and start Apache, and some unsuccesfull tries.

So I emerge again mod_php, and see that the file to change was in /etc/conf.d    :Embarassed: 

It's not the same path on other distros, so Gentoo newbies could be quite lost by this. 

The tought of the day : Read twice the help messages after emerge, and if forgot, emerge again !

Hope this helps in future.

----------

## slaisc

I had this problem with 1.3.26 .. and when I did a ps,  apache did not have any parameters, however I had edited the variable APACHE_OPTS in /etc/conf.d/apache so smething was wrong.. either with init scripts or something else... anyway..  I updated to 1.3.27 and added a few \n 's after the variable declaration and everything works now  .. ps shows  

```
/usr/sbin/apache -D PHP4
```

strange   :Confused: 

----------

## onlawn

just ran into the same problem as described above and the simple restarting *didn't* work.  Oddly enough a re-boot probably did work where a restart didn't.

But I didn't do that.  What I did was stoped apache "/etc/init.d/apache stop"

then waited 5 minutes

then started it again "/etc/init.d/apache start"

----------

