# <IfDefine PHP4> Prevents mod_php from loading

## discostu

For some reason <IfDefine PHP4> Prevents mod_php from loading even though:

% grep PHP4

/etc/conf.d/apache APACHE_OPTS="-D SSL -D PHP4"

I have to take out <IfDefine PHP4> where libphp.so and mod_php4.c are referenced in /etc/apache/conf/apache.conf. Any ideas as to why this isn't recognizing the definition?

----------

## fyerk

Does PHP4 show up in the list of included defines when Apache is started?

```

# ps -awwux | grep httpd

```

----------

## discostu

Here is the output:

```

$ ps -awwux | grep apache

root      8946  0.0  1.5 10452 4060 ?        S    19:31   0:00 /usr/sbin/apache

apache   21557  0.0  1.7 10676 4432 ?        S    19:31   0:00 /usr/sbin/apache

apache   29625  0.0  1.6 10532 4244 ?        S    19:31   0:00 /usr/sbin/apache

apache    6310  0.0  1.7 10560 4436 ?        S    19:31   0:00 /usr/sbin/apache

apache   25838  0.0  1.5 10464 4056 ?        S    19:31   0:00 /usr/sbin/apache

apache   16675  0.0  1.6 10464 4076 ?        S    19:31   0:00 /usr/sbin/apache

apache   24287  0.0  1.6 10464 4076 ?        S    19:31   0:00 /usr/sbin/apache

root      6208  0.0  0.1  1412  464 pts/0    R    21:23   0:00 grep apache

```

Apache is running successfully with php. My test.php is showing <?phpinfo();?>. The problem is that I had to take out the <IfDefine PHP4> for it to work though. For some reason when I start apache with the ifdefine, apache does not load the mod_php module.

----------

## fyerk

Well, the ps command should show something like this

```

# ps -awwux | grep apache

apache   16683    2.2  1.1  10908  4360  ?     S   23:05   0:00 /usr/sbin/apache -D SSL -D PHP4

```

The <IfDefine PHP4> option looks for those -D options so if you don't see them it won't work properly.

Are you sure PHP4 is configured properly?

----------

## discostu

I figured out the problem.  :Smile: 

I have been using 

```
# /usr/sbin/apachectl start
```

 to start apache. That script does not seem to load the arguments from "/etc/conf.d/apache."

This time I started it with 

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

# ps -awwux | grep apache

root       264  1.2  1.5 10452 4060 ?        S    22:07   0:00 /usr/sbin/apache -D SSL -D PHP4

apache   16447  0.0  1.5 10464 4056 ?        S    22:07   0:00 /usr/sbin/apache -D SSL -D PHP4

apache   10373  0.0  1.5 10464 4056 ?        S    22:07   0:00 /usr/sbin/apache -D SSL -D PHP4

apache   25037  0.0  1.5 10464 4056 ?        S    22:07   0:00 /usr/sbin/apache -D SSL -D PHP4

apache   20867  0.0  1.5 10464 4056 ?        S    22:07   0:00 /usr/sbin/apache -D SSL -D PHP4

root     10886  0.0  0.1  1420  504 pts/0    S    22:07   0:00 grep apache

```

Thanks for you help!   :Very Happy: 

----------

