From: [EMAIL PROTECTED]
Operating system: Linux Slackware 7.1
PHP version: 4.0.4pl1
PHP Bug Type: Apache related
Bug description: seg fault on apache
here is my configure line:
./configure --with-zlib --with-mm --with-mysql=/usr/local/mysql --with-mcal=../libmcal
--with-imap=../../imap --with-gettext --enable-ftp
--with-db3=/usr/local/BerkeleyDB.3.2 --with-apache=/usr/local/apache --with-mcrypt
I am using IMP from the HORDE project if you are familiar with it.
The script that it appears to be failing on is as follows, it is rather long sorry:
<?php
function isPreferred($server, $key = null)
{
global $HTTP_SERVER_VARS;
static $urlServer;
if (!isset($urlServer)) $urlServer = Horde::getFormData('server');
if (!empty($urlServer)) {
return $key == $urlServer;
}
if (is_array($server['preferred'])) {
foreach ($server['preferred'] as $preferred) {
if ($preferred == $HTTP_SERVER_VARS['SERVER_NAME'] ||
$preferred == $HTTP_SERVER_VARS['HTTP_HOST']) {
return true;
}
}
} elseif ($server['preferred'] == $HTTP_SERVER_VARS['SERVER_NAME'] ||
$server['preferred'] == $HTTP_SERVER_VARS['HTTP_HOST']) {
return true;
}
return false;
}
define('IMP_BASE', dirname(__FILE__));
require_once IMP_BASE . '/lib/base.php';
if ($conf['connections']['track']) {
include_once IMP_BASE . '/../lib/Connection.php';
}
/* Additional configuration (dependent on the above code libraries) */
require IMP_BASE . '/config/servers.php';
if ($conf['log']['enabled']) {
include_once 'Log.php';
$log = &Log::singleton($conf['log']['type'], $conf['log']['name'],
$conf['log']['ident'], $conf['log']['conf']);
}
/* Map the various values for $reason to more descriptive status messages. */
$reasons = array('login' => '',
'timeout' => _("Either you have logged in incorrectly or your login
has expired. Please login again."),
'logout' => sprintf(_("You have been logged out of %s. Thank you for
using the system. If you wish to log in again, please use the form below."),
$conf['sitename']),
'failed' => _("Login failed for some reason. Most likely your
username or password was entered incorrectly."));
/* Default to 'login' if no $reason is set. */
$reason = Horde::getFormData('reason', 'login');
$actionID = Horde::getFormData('actionID', NO_ACTION);
/* Initialize the session routines. */
session_name($conf['session_name']);
@session_start();
if (isset($HTTP_SESSION_VARS['imp']) && is_array($HTTP_SESSION_VARS['imp'])) {
if ($reason == 'logout') {
$imp = &$HTTP_SESSION_VARS['imp'];
if (isset($imp['user'])) {
$prefs = Prefs::factory($conf['prefs']['driver'],
$registry->getApp(), $imp['user'],
Secret::read(Secret::getKey('imp'), $imp['pass']),
$conf['prefs']['params']);
$prefs->store();
}
$HTTP_SESSION_VARS['imp'] = null;
session_unregister('imp');
} elseif ($reason == 'failed') {
$HTTP_SESSION_VARS['imp'] = null;
session_unregister('imp');
} else {
/* If there is an existing session, redirect the user to the mailbox. */
if ($actionID == IMP_LOGIN) {
header('Location: ' . Horde::applicationUrl('mailbox.php?actionID=' .
IMP_LOGIN, true));
exit;
} elseif (($actionID == LOGIN_COMPOSE) || (isset($HTTP_GET_VARS['action']) &&
($HTTP_GET_VARS['action'] == 'compose'))) {
header('Location: ' . Horde::applicationUrl('mailbox.php?actionID=' .
LOGIN_COMPOSE, true));
exit;
} else {
header('Location: ' . Horde::applicationUrl('mailbox.php', true));
exit;
}
}
}
/* Log the reason if logging is enabled. */
if ($conf['log']['enabled']) {
$log->log($HTTP_SERVER_VARS['REMOTE_ADDR'] . ' ' . $reason, LOG_INFO);
}
/* Redirect the user on logout if redirection is enabled. */
if (($reason == 'logout') && $conf['user']['redirect_on_logout']) {
header('Location: ' . $conf['user']['redirect_on_logout']);
exit;
}
/* Redirect the user if an alternate login page has been specified. */
if ((in_array($reason, array('login', 'failed', 'timeout'))) &&
$conf['user']['alternate_login']) {
header('Location: ' . $conf['user']['alternate_login']);
exit;
}
/* Initialize the password key. */
Secret::setKey('imp');
/* Set the actionID of the login form */
if ((isset($HTTP_GET_VARS['action']) && $HTTP_GET_VARS['action'] == 'compose') ||
($actionID == LOGIN_COMPOSE)) {
$actionID = LOGIN_COMPOSE;
} else {
$actionID = IMP_LOGIN;
}
/* Get the default preferences values. */
$prefs = Prefs::factory('none', $registry->getApp());
$prefs->setDefaults(IMP_BASE . '/config/prefs.php');
/* Grab some default values from the first entry in config/servers.php. */
reset($servers);
$server_key = key($servers);
$server_value = $servers[$server_key]['server'];
$protocol_value = $servers[$server_key]['protocol'];
$port_value = $servers[$server_key]['port'];
$folders_value = $servers[$server_key]['folders'];
$namespace_value = $servers[$server_key]['namespace'];
$maildomain_value = $servers[$server_key]['maildomain'];
/*
* If the server list is used but should be hidden (for virtual hosting),
* make sure we output a server name to use.
*/
if ($conf['server']['server_list'] && $conf['server']['server_list_hidden']) {
/*
* Iterate through the servers in an attempt to locate a "preferred"
* server for this web server. If none if found, we default to the
* first entry in the hash (indicated by the $server_key value set
* above).
*/
foreach ($servers as $key => $curServer) {
if (isPreferred($curServer, $key)) {
$server_key = $key;
break;
}
}
}
/* Build the <select> widget for the servers list. */
if ($conf['server']['server_list'] && !$conf['server']['server_list_hidden']) {
$servers_list = '';
foreach ($servers as $key => $curServer) {
$sel = (isPreferred($curServer, $key)) ? ' selected="selected"' : '';
$servers_list .= "<option value=\"$key\"$sel>";
$servers_list .= $curServer['name'] . "</option>\n";
}
}
/* Build the <select> widget containing the available languages. */
if (!$prefs->isLocked('language')) {
$langs = '<select name="new_lang" onchange="selectLang()">';
foreach ($nls['languages'] as $key => $val) {
$sel = ($key == $language) ? ' selected="selected"' : '';
$langs .= "<option value=\"$key\"$sel>$val</option>\n";
}
$langs .= '</select>';
}
$title = _("Welcome");
$js_onLoad = 'setFocus()';
include $conf['paths']['templates'] . '/doctype.inc';
include $conf['paths']['templates'] . '/common-header.inc';
include $conf['paths']['templates'] . '/login/login.inc';
if (@is_readable(IMP_BASE . '/config/MOTD.html')) {
include IMP_BASE . '/config/MOTD.html';
}
include $conf['paths']['templates'] . '/common-footer.inc';
?>
Thank you!
Terry
--
Edit Bug report at: http://bugs.php.net/?id=9840&edit=1
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]