Ticket #1485924 (closed Bugs: fixed)

Opened 9 months ago

Last modified 7 months ago

.htaccess sets wrong path for error log

Reported by: feyp Owned by:
Priority: 5 Milestone: 0.3-stable
Component: Other Version: 0.2.2
Severity: normal Keywords:
Cc: suporte@…

Description

I got this error message in the webserver error logs for each file served by roundcube:

PHP Warning:  Unknown: Unable to access logs/errors in Unknown on line 0

This is because of this statement in /.htaccess

php_value       error_log       logs/errors

This statement should contain an absolute path.

Change History

Changed 9 months ago by alec

  • milestone changed from later to 0.3-stable

Nothing in my log, so maybe you've wrong access rights to such file/path? What PHP version?

Changed 9 months ago by feyp

The error goes away, if I set an absolute path to logs/errors in the .htaccess file. The permissions are ok, the webserver does have read/write access to this directory/file. In fact, errors are written to the log just fine (see my other bug report).

PHP version is: 5.2.9

Changed 9 months ago by thomasb

  • status changed from new to closed
  • resolution set to worksforme

Relative paths work fine for me. Also we don't know your absolute path.

Changed 9 months ago by feyp

  • status changed from closed to reopened
  • resolution worksforme deleted

I did some further research on Google and it turns out that the error goes away, if both safe_mode and open_basedir is disabled. So please try the following to reproduce this:

* set open_basedir to something reasonable OR enable safe_mode OR do both * use a current stable version of PHP (5.2.9)

If you enable safe_mode, you'll get the error message i reported originally. If safe_mode is disabled and open_basedir is enabled, you'll get:

PHP Warning:  Unknown: open_basedir restriction in effect. File(logs/errors) is not within the allowed path(s): (/usr/share/php:/var/www/roundcube) in Unknown on line 0

Both open_basedir and safe_mode on are very common in shared hosting environments, so I still consider this a bug. Feel free to close this again, if you're not able to reproduce with safe_mode on/open_basedir or if you do not consider this a bug. I'll leave you alone then and just fix it myself in the future ;).

I know that you don't know my absolute path. But there are a number of ways you can work around this. A few suggestions:

* Write the .htaccess file during installation using the PHP installer * Set the directive using ini_set instead of using the .htaccess file * Trust your user to set a sane value for error_log that works for her and do not include this directive in the .htaccess file in the first place.

Changed 9 months ago by lommy

I can confirm that bug. With the default error_log value in the .htaccess file I'm getting the same open_basedir restriction errors in my Apache error log. I am using PHP 5.2.9-pl2-gentoo with safe_mode disabled and open_basedir to the main directory of Roundcube. Changing the error_log value in the .htaccess file to an absolute path to the logs/error file solves this problem. Sounds like a PHP bug for me. lommy

Changed 9 months ago by thomasb

  • status changed from reopened to closed
  • resolution set to invalid

Again, we cannot set an absolute path in the distributed .htaccess. The bug you describe may be valid but it's related to some special PHP configuration and is not a general problem of RoundCube. All we can do is to mention this issue in the README or INSTALL instructions.

Changed 7 months ago by netbit

  • cc suporte@… added
  • status changed from closed to reopened
  • resolution invalid deleted

Same problem here. Cannot use relative path with safemode ON. Please add this instruction to README or INSTALL.

Changed 7 months ago by thomasb

  • status changed from reopened to closed
  • resolution set to fixed

Fixed in r2874

Note: See TracTickets for help on using tickets.