p dont think wrote:
Bill Valentine wrote:
p dont think wrote:
Actually that last portion I don't know what happened. It got bungled by my mail client. I made the changes to that script and the error reporting in php.ini. I get the following result. Still points to permissions.I've tried the first part before to make sure. There's only one installation. Be very odd if they were since this machine was installed fresh the other day.I put a direct path in just to make sure. $data_dir = '/var/www/html/data/'
Here's a directory listing for the data_dir drwxrwxrwx 2 apache apache 4096 Dec 21 17:01 /var/www/html/data
Here's the user and group apache is running as.
User apache Group apache
Here's the data directory listing.
-rwxrwxrwx 1 apache apache 82 Dec 21 17:01 default_pref -rwxrwxrwx 1 apache apache 469 Dec 23 2001 index.php
looks ok. then Chris is probably on track; you are likely accessing the wrong SM installation on your machine. try 'updatedb; locate squirrelmail' or similar. insert some code in src/login.php to see if it gets printed on the login screen, something like:
global $data_dir; echo "<hr>Hello. data dir is $data_dir<hr>";
try inserting that above the third to last line, just before this line:
echo "</body>\n".
I inserted code into the page. It comes up on the login page. Here is the result. I changed to a direct path after I sent the first message. That's why it's different.
/Hello. data dir is /var/www/html//
your data directory is /var/www/html?!?!?!?!?!?!
doesn't that scream out to you as a problem?
It actually got stripped off. It should have read. /Hello. data dir is /var/www/html/data/
stripped off during a cut n paste or is SM somehow munging it?
assuming the first, see below
btw, the whole idea of moving the data dir is to move it *outside* the htdocs tree.
if you want to see the error where it happens, look in functions/file_prefs.php, around line 193 and make these changes:
(also remember to turn up error reporting all the way in php.ini and/or watch your logs)
/* If it is not there, check the internal data directory. */ - if ([EMAIL PROTECTED]($default_pref)) { + if (!file_exists($default_pref)) { + echo "<br>$default_pref was not found!<br>switching to " + . SM_PATH . 'data/default_pref<br>'; $default_pref = SM_PATH . 'data/default_pref'; }
/* Otherwise, report an error. */
$errTitle = sprintf( _("Error opening %s"), $default_pref );
if (!is_readable($default_pref)) {
$errString = $errTitle . "<br />\n" .
_("Default preference file not found or not readable!") . "<br />\n" .
_("Please contact your system administrator and report this error.") . "<br />\n";
logout_error( $errString, $errTitle );
exit;
- } else if ([EMAIL PROTECTED]($default_pref, $filename)) {
+ } else if (!copy($default_pref, $filename)) {
+ echo "<br>$default_pref could not be copied "
+ . "to $filename per the error above<br>";
$uid = 'httpd';
if (function_exists('posix_getuid')){
$user_data = posix_getpwuid(posix_getuid());
$uid = $user_data['name'];
}
$errString = $errTitle . '<br />' .
_("Could not create initial preference file!") . "<br />\n" .
sprintf( _("%s should be writable by user %s"), $data_dir, $uid ) .
"<br />\n" . _("Please contact your system administrator and report this error.") . "<br />\n";
logout_error( $errString, $errTitle );
exit;
}
/
/var/www/html/data/default_pref could not be copied to /var/www/html/data/[EMAIL PROTECTED] per the error above/
where is the "error above"? if you turned up error reporting and made the suggested changes in the code (remove the @ sign), an error should have been displayed. either that or watch your logs more carefully. also check php open basedir and safe mode settings.
Here we go.
/*Warning*: copy(/var/www/html/data/[EMAIL PROTECTED]): failed to open stream: Permission denied in */var/www/html/functions/file_prefs.php* on line *205*
/var/www/html/data/default_pref could not be copied to /var/www/html/data/[EMAIL PROTECTED] per the error above/
Code section starting form line 205.
else if (!copy($default_pref, $filename)) { echo "<br>$default_pref could not be copied " . "to $filename per the error above<br>"; $uid = 'httpd'; if (function_exists('posix_getuid')){ $user_data = posix_getpwuid(posix_getuid()); $uid = $user_data['name']; }
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
--
squirrelmail-users mailing list
Posting Guidelines: http://squirrelmail.org/wiki/wiki.php?MailingListPostingGuidelines
List Address: [EMAIL PROTECTED]
List Archives: http://news.gmane.org/thread.php?group=gmane.mail.squirrelmail.user
List Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=2995
List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-users