# Apache and PHP

## redcpu

After installing mod_php I get the following error when trying to start apache.

 * Starting apache...

/sbin/runscript.sh: line -61: 31940 Segmentation fault      start-stop-daemon --quiet --start --startas /usr/sbin/apache --pidfile /var/run/apache.pid -- ${APACHE_OPTS}

I adjusted the apache.conf file using the ebuild.

I am very frustrated with this.

I get no errors in the error log.

Help 

Dan J

----------

## delta407

Moving to Networking forum, as it has to do with running a server.

What are your CFLAGS in /etc/make.conf?

----------

## redcpu

My Use list is as follows

USE="kde bonobo tcltk gpm pam tcpd ssl arts perl esd gif imlib sdl gtk X gnome audio dvd opengl xv xmms avi png tiff gif jpeg mpeg mod_php php mysql apache --quicktime --cups"

I think mysql is messing it up but I am not sure.

Dan J

----------

## delta407

 *redcpu wrote:*   

> My Use list is as follows

 

No, I mean your CFLAGS. Look for the CFLAGS variable.

 *redcpu wrote:*   

> I think mysql is messing it up but I am not sure.

 

start-stop-daemon is segfaulting, which is almost certainly unrelated to MySQL.

----------

## redcpu

Sorry Brain Fart

CFLAGS="-march=i686 -O3 -pipe"

----------

## delta407

Continuing to stab around in the dark... what's "start-stop-daemon --version" got to say? I would try "emerge baselayout" to reinstall start-stop-daemon. (Along with about eighteen million other files, too. But that's beside the point.)

----------

## redcpu

How does baselayout effect apache. If I take the options for PHP out of the config files. Apache starts just fine.

???

Dan J

----------

## delta407

 *redcpu wrote:*   

> How does baselayout effect apache.

 

Well, start-stop-daemon is barfing, and that's installed by baselayout, so...

 *redcpu wrote:*   

> If I take the options for PHP out of the config files. Apache starts just fine.

 

You didn't say that.  :Wink: 

What's /etc/conf.d/apache?

----------

## redcpu

# Copyright 1999-2002 Gentoo Technologies, Inc.

# Distributed under the terms of the GNU General Public License, v2 or later

# $Header: /home/cvsroot/gentoo-x86/net-www/apache/files/apache.confd,v 1.2 2002

/05/04 23:23:00 woodchip Exp $

# Config file for /etc/init.d/apache

# Here's an example from /etc/apache/conf/apache.conf using mod_ssl:

#

# <IfDefine SSL>

# LoadModule ssl_module    extramodules/libssl.so

# </IfDefine>

#

# This means that libssl.so is only loaded into the server when you

# pass "-D SSL" to it at startup.

#

# Anything else in apache.conf which is guarded similarly, like:

#

# <IfDefine FOO> ... </IfDefine>

#

# can be easily turned on/off by editing APACHE_OPTS below to

# include or to not include "-D FOO".

#

# If you installed mod_throttle, you can add "-D THROTTLE"; if you

# installed mod_dav, then add "-D DAV".  For mod_gzip use "-D GZIP".

# The mod_contribs package has several options you can use.  See

# your apache.conf file for more details.

APACHE_OPTS="-D SSL -D PHP4"

----------

## delta407

And it starts when you remove "-D PHP4"?

----------

## redcpu

Not exactly. I was thinking of the options in the apache.conf. I took that line out of the /etc/conf.d/apache file and the server starts but when I attempt to open a php file it trys to save it to the hard disk rather than open it.

I think it is a config file problem now. I hope.

Dan J.

----------

## delta407

Well, no, removing -D PHP4 prevents mod_php from loading. So that's the config problem.  :Very Happy: 

Hmmm... mod_php is killing Apache which is killing start-stop-daemon. Quite a pickle.

----------

## redcpu

I took -SSL out of the PHP line in /etc/conf.d apache and it does not crash I still get application type download box now.

I am not sure what lines belong in the apache.conf file.

Dan J.

----------

## delta407

If apache.conf is set up right, -D PHP will make it load PHP-related stuff. If -D PHP is not set, all the PHP-related lines are inactive. Ditto with SSL.

I'm not entirely sure what you just said, so I hope that helps.  :Very Happy: 

----------

## redcpu

I am getting closer. I am struggling but I hope to get it figured out.

This is the orginal line I took out the -D SSL I dont' think I have that loaded.

#APACHE_OPTS="-D SSL -D PHP4"

Which apache starts but has no idea what to do with my index.php file.

Dan J.

----------

