# mod_php and apache 1.3.27 refuse to play nicely

## billatq

It worked fine before, but mysteriously I can't get apache to work with mod_php. It works fine with other modules, i.e. mod_ssl or without them, but as soon as mod_php is set up to work with apache, it silently fails to load apache. Anybody run into this problem before?

----------

## xedx

what did the logs tell?

did you do post install config steps?

----------

## billatq

Well, the logs are actually non-existant, as in it never actually gets around to writing anything and the ebuild config was run as instructed. It happens regardless of whether or not it's set to run php by having apache passed the -D PHP or by just manually configuring it in the .conf file. Strace wasn't horribly helpful because apache forks itself after it's started and it doesn't follow the fork.

----------

## revresxunil

Well my gentoo installation is 4 days old now, and I had emerged apache and mod_php.... I then realized I didnt include gd support so i unmerged/emerged mod_php again with gd in the make.conf.  Now when i run /etc/init.d/apache start/restart it has no errors and seems to have loaded, but when i ps -aux, no apache... if i comment out php stuff in the apache.conf, and run apache start, everything is fine.

I unmerged/emerged mod_php again with the default settings i origionally had, and restarted apache, still no go!

logs have nothing either.

help!!

----------

## revresxunil

Searched all over for 2 hours and couldnt find a solution.  Any help would be greately appreciated.

----------

## H0bb3z

This is probably more than you might be trying to get running, but here's how I solved my woes:

From my changelog notes:

 *Quote:*   

> emerge --unmerge apache mysql php mod_php mod_ssl phpmyadmin cacti
> 
> emerge rsync
> 
> emerge apache mysql php mod_php mod_ssl phpmyadmin #-The order IS important
> ...

 

Hope this helps!  :Smile: 

----------

## revresxunil

Following the provided information, currently compiling.  Will update with results when everything is done.

----------

## revresxunil

Still no go.  If i remove -D PHP4 from the /etc/conf.d/apache, then apache loads up fine, but once I try and load php4, apache silently disapears from existence even after /etc/init.d/apache start.

This is really starting to bug me because I need php support for something to play with when im bored! UGH.

Any new ideas?? This is entirely a php module problem, im sure other people must have this problem and figured out a solution, so if anyone can enlighten me, please feel free.

----------

## H0bb3z

Here are my USE flags in /etc/make.conf:

```
USE="ssl mysql -java -X -gtk -gnome -alsa -kde -qt -truetype -opengl"
```

I know the -java flag fixes some heartburn, but if you're able to completely compile, it shouldn't be an issue.

Sounds like some debug log output would be handy about now.  You might try to run the apache binary manually to see if it spits any messages out to the console before it dies...

----------

## revresxunil

unmerged/emerged mod_php for fun, then did /etc/init.d/apache start, no errors, ps -aux, no apache.  deleted the pid file, then tried to run it manually.

/usr/sbin/apache -D SSL -D MP3 

apache loads up and shows in ps -aux

killall -9 apache

/usr/sbin/apache -D PHP4

apache seems to load with no errors....

ps -aux shows no apache.

Im bummed, im thinking about just reinstalling gentoo, but i fear that wont do anything, i have nothing custom installed apart from portage packages.  all configs relating to mysql, apache, php, etc are default configs, and php still wont go.... no errors either.

----------

## revresxunil

Heres some more info, i find it useless, but maybe somebody else will find it useful.

/usr/sbin/apache -D PHP4

ps -aux  (as quickly as possible)

```

...yaddda my stuff....

...yaddda...

root      2397 38.0  1.9 30396 10028 ?       R    20:43   0:00 /usr/sbin/apache -D PHP4

root      2398  0.0  0.1  2664  804 pts/2    R    20:43   0:00 ps -aux

```

and then a second later, another ps -aux shows:

```

...

...

root      2399  0.0  0.1  2664  804 pts/2    R    20:43   0:00 ps -aux

```

i completely removed everything, apache mod_php mod_ssl, and then reemerged them, still no go with php.  I installed an older verison of mod_php-4.3.0, still no go.  Installed the newer version 4.3.2, still no go.  As of right now, every config file is default and stock with the ebuild config addings (so that php runs).

I am simply out of ideas,  ill leave this up to the forum community for a few days, and if nobody is able to help, ill blow off gentoo and reinstall the whole thing again.

----------

## H0bb3z

Just out of curiousity, is PHP (not mod_php) installed at all?  I ask because I had a problem getting apache+mod_php running until I emerged php.

----------

## revresxunil

I tried with both installed and not installed.  Currently at the time i post, i have it uninstalled.  Gawd, theres gotta be something bugging this up... could any of the flags i set such as curl xml flash gd etc cause it incompatability issues such that it would fail apache to load period?

----------

## H0bb3z

Is the line

```
Include  conf/addon-modules/mod_php.conf
```

In the apache.conf file and does that file exist if it does?

Also, set the LogLevel directive in apache.conf to debug:

```
ErrorLog /path/to/error_log

LogLevel debug
```

This should (hopefully) add some detail to the logs.  The logs should be in /var/log/apache/ or /etc/apache/logs/.  You can try something like:

```
tail -25 /var/log/apache/error_log
```

 to see if there is anything interesting that may help provide some insight.

----------

## revresxunil

The line is included in apache.conf.

I changed the log level to debug, in /var/log/apache/error_log I get this:

```

[Thu Jun  5 11:55:52 2003] [info] mod_unique_id: using ip addr 192.168.1.53

```

thats the only new thing that occurs in the logs.. still no go on apache with -D PHP4

You would think there would be some error to help me out just a tad!? *going crazy*

----------

## H0bb3z

Hmph - that was informative...  :Confused: 

You mentioned PHP wasn't emerged right now, so maybe try emerging php for one last test and see what the logs say.

----------

## revresxunil

Definently no go.  php compiled fine, I even had it interpet a test.php file i have in my web root directory, showed phpinfo in the command line.  I think this is just a problem only I have encountered.  I guess ill just reinstall gentoo  :Sad: 

Same information in the log as above relating to ip address.

I just hope that this time it will work, because if it doesnt, ill have to kick my computers ass.

----------

## H0bb3z

Well, you could try doing something like I did first:

```
emerge --unmerge mod_php mod_ssl php apache

emerge rsync

emerge clean

emerge -Dp apache php mod_php mod_ssl

emerge -D apache php mod_php mod_ssl
```

Perhaps the -D will catch something deep in the dependency tree that a regular emerge missed.  Its definitely worth a try as an alternative to starting over...

----------

## revresxunil

I already trashed the drive.  Im reinstalling and will just emerge the core system and then apache and see if everything goes smooth... The only downside to starting over is my compilation time for kde and X... oh well, no biggy, gives me more practice at installing gentoo in the first place.

*installs without a cdrom drive using zipslack  :Very Happy:  *

----------

## H0bb3z

Alrighty!  Well, at least you get more experience...  I hope it goes better this time around...    :Wink: 

----------

## mta

apache 1.3 just refused to work with mod_php for me, there's clearly a problem.  try including in USE "apache2" and then emerge apache, straightforward and works!  (worked for me and at least 1 other person anyway...)

----------

## revresxunil

Hmmmm *currently compiling system*

if my php doesnt work after this and that is the solution, im gonna shoot myself ugh.

Anyway, I wonder how many people actually share the same situation... could be a real bug?

----------

## revresxunil

Well im done compiling, and i have apache going with ssl, mp3, and php.  I dont think im going to re emerge php unless i desperately have to, but then i fear it will not work again.

so if all else fails, reformat--- ah gotta love growing up with microsoft windows.. it has taught me well  :Wink: 

----------

## H0bb3z

Whew!

----------

## superk

 *H0bb3z wrote:*   

> This is probably more than you might be trying to get running, but here's how I solved my woes:
> 
> From my changelog notes:
> 
>  *Quote:*   emerge --unmerge apache mysql php mod_php mod_ssl phpmyadmin cacti
> ...

 

I have the same problem that he had.....or at least similar enough to post it here

i tried the above (minus cacti cause it wasnt installed) 

when i then typed '/etc/init.d/apache start'  it would say apache started, but it wouldnt start, but it had given errors, so i fixed those by removing duplicates in the config files (it tried to load ssl twice) it then loaded, and i used lynx on http://localhost, so i then went into my window manager.  https://localhost said couldnt find server, and it wont execute php, so i know they dont work.  the problem that I had before i tried the above steps was that it would run ssl IF php wasnt loaded, or neither of them would work. and php wouldnt work at all.  and i need mysql, php and ssl to 'play nicely' any suggestions on what to try?

EDIT::  I tried the above steps again, and i get this message on the mysql emerge::

'!!! CATAGORY information missing from chunk, aborting...'

----------

## revresxunil

Sorry to bring this back up again... but as soon as i shutdown my computer and brought it back up again, apache doesnt seem to like php anymore!!!!!!!!!!!!!!!

How fked up is that????

Im losing my mind here.. why doesnt php4 play nicely with apache anymore?

----------

## Archevis

Try this:

USE="-java -qt" emerge mod_php

Worked for me.

- archie -

----------

## revresxunil

that did it, works fine now.  -java -qt

----------

## astarok

I seem to be having a problem similar to the other posters. I note that after running etc-update and accepting the new file that the file /etc/php4/php.ini is empty. I do not think that was the case previously. There is a link to this file from /etc/apache/conf. Should the file be empty?

----------

## knalb

 *astarok wrote:*   

> I seem to be having a problem similar to the other posters. I note that after running etc-update and accepting the new file that the file /etc/php4/php.ini is empty. I do not think that was the case previously. There is a link to this file from /etc/apache/conf. Should the file be empty?

 

No, it should definitely not be empty.  As for why yours is, I'm not sure.  But as for what it should have, I've pm'd you the contents, as it's way too long to post up here.

----------

## astarok

Thanks for the file. I emerged a previous version last night and kept the file when I went back to 4.3.2 and everything seems to be working now. I don't know how I lost the file in the first place but it happened on two separate machines. Everything is running on one but not on the other. I am trying to figure out the difference between the two now...

----------

