Page 1 of 2

Cannot create log file and send emails

Posted: 16 Apr 2014, 13:55
by worker
Hi guys,

I already installed mantis version 1.2.17 and im trying to send emails when someone registers.
I've seen this topic: http://www.mantisbt.org/forums/viewtopi ... =3&t=15398 and configured as it is written, however, still can not send emails.

I tried to create a log file for see the mistakes that were to appear and give me the following error:

Testing Mail -
SYSTEM WARNING: 'error_log(/var/www/html/mantis/mantis.log): failed to open stream: Permission denied' in '/var/www/html/mantis/core/logging_api.php' line 74


In my config_inc.php i have this:

Code: Select all

$g_log_level = LOG_EMAIL | LOG_EMAIL_RECIPIENT | LOG_FILTERING | LOG_AJAX | LOG_DATABASE | LOG_LDAP;
$g_log_destination = 'file:/var/www/html/mantis/mantis.log';
~

I thought it was a permissions problem on the files, however, already checked and given the appropriate permissions to read, write and execute.

Anyone had this problem? Suggestions?

Regards.

Re: Cannot create log file and send emails

Posted: 16 Apr 2014, 18:29
by atrol
Is the permission set for the directory and the file?

Re: Cannot create log file and send emails

Posted: 17 Apr 2014, 11:47
by worker
All files have -rwxr-xr-x.

Re: Cannot create log file and send emails

Posted: 18 Apr 2014, 15:44
by atrol
I asked also for the directory permission.

Who is the owner of the file? Is it the user which is running the web server process?
If not, change the owner, or temporary try to set permissions to -rw-rw-rw to find out if logging works in general.

Re: Cannot create log file and send emails

Posted: 29 Apr 2014, 10:05
by worker
Sorry for the delay.

I changed the file /core/logging_api.php to rw-rw-rw-.
The owner is root on both the directory and the files.

Re: Cannot create log file and send emails

Posted: 29 Apr 2014, 10:29
by atrol
worker wrote: I changed the file /core/logging_api.php to rw-rw-rw-.
:?: Why did you change this file? This is source from MantisBT and you shouldn't change anything.

You wrote that you have set

Code: Select all

    $g_log_destination = 'file:/var/www/html/mantis/mantis.log';
Thus you have to check/set permissions for /var/www/html/mantis/mantis.log

Re: Cannot create log file and send emails

Posted: 29 Apr 2014, 11:09
by worker
atrol wrote:
worker wrote: I changed the file /core/logging_api.php to rw-rw-rw-.
:?: Why did you change this file? This is source from MantisBT and you shouldn't change anything.

You wrote that you have set

Code: Select all

    $g_log_destination = 'file:/var/www/html/mantis/mantis.log';
Thus you have to check/set permissions for /var/www/html/mantis/mantis.log
Sorry for that.

I changed /var/www/html/mantis/mantis.log and now everything is already ok.

Now i receive this error in the log file:

WEST mail ERROR: Message could not be sent - SMTP Error: Could not connect to SMTP host.

Re: Cannot create log file and send emails

Posted: 29 Apr 2014, 11:42
by atrol
Maybe caused by a typo in your SMTP settings.
Double check that the SMTP host name is correct.
Check also that there is no firewall preventing the access to the SMTP server.

Re: Cannot create log file and send emails

Posted: 29 Apr 2014, 13:31
by worker
atrol wrote:Maybe caused by a typo in your SMTP settings.
Double check that the SMTP host name is correct.
Check also that there is no firewall preventing the access to the SMTP server.

The SMTP hostname is correct.

My firewall (iptables) is turned off.

Do I need any extra configuration?

Re: Cannot create log file and send emails

Posted: 29 Apr 2014, 16:14
by atrol
run admin/check.php
Do you get any errors or warnings?

Are there any errors or warnings in your webserver logs?

Re: Cannot create log file and send emails

Posted: 29 Apr 2014, 17:11
by worker
atrol wrote:run admin/check.php
Do you get any errors or warnings?

Are there any errors or warnings in your webserver logs?

Only this:

Checking MantisBT upload file size is less than php : BAD

Re: Cannot create log file and send emails

Posted: 01 May 2014, 10:42
by atrol
Does sending work if you don't use SMTP?

Re: Cannot create log file and send emails

Posted: 02 May 2014, 09:01
by worker
atrol wrote:Does sending work if you don't use SMTP?
Sorry but dont understand the question.

The mantis works perfectl but i need to send emails. :(

Re: Cannot create log file and send emails

Posted: 02 May 2014, 09:17
by atrol
There are three ways of sending emails in MantisBT. Using SMTP is just one of them.
See option $g_phpMailer_method
http://www.mantisbt.org/docs/master-1.2 ... NFIG.EMAIL
Maybe PHPMAILER_METHOD_MAIL or PHPMAILER_METHOD_SENDMAIL works in your installation.

Of course, SMTP should also work with the right settings.

Re: Cannot create log file and send emails

Posted: 02 May 2014, 09:41
by worker
I use this:

$g_phpMailer_method = PHPMAILER_METHOD_SMTP;