Cannot create log file and send emails

Get help from other users here.

Moderators: Developer, Contributor

worker
Posts: 16
Joined: 16 Apr 2014, 13:35

Cannot create log file and send emails

Post 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.
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Cannot create log file and send emails

Post by atrol »

Is the permission set for the directory and the file?
Please use Search before posting and read the Manual
worker
Posts: 16
Joined: 16 Apr 2014, 13:35

Re: Cannot create log file and send emails

Post by worker »

All files have -rwxr-xr-x.
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Cannot create log file and send emails

Post 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.
Please use Search before posting and read the Manual
worker
Posts: 16
Joined: 16 Apr 2014, 13:35

Re: Cannot create log file and send emails

Post 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.
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Cannot create log file and send emails

Post 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
Please use Search before posting and read the Manual
worker
Posts: 16
Joined: 16 Apr 2014, 13:35

Re: Cannot create log file and send emails

Post 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.
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Cannot create log file and send emails

Post 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.
Please use Search before posting and read the Manual
worker
Posts: 16
Joined: 16 Apr 2014, 13:35

Re: Cannot create log file and send emails

Post 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?
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Cannot create log file and send emails

Post by atrol »

run admin/check.php
Do you get any errors or warnings?

Are there any errors or warnings in your webserver logs?
Please use Search before posting and read the Manual
worker
Posts: 16
Joined: 16 Apr 2014, 13:35

Re: Cannot create log file and send emails

Post 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
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Cannot create log file and send emails

Post by atrol »

Does sending work if you don't use SMTP?
Please use Search before posting and read the Manual
worker
Posts: 16
Joined: 16 Apr 2014, 13:35

Re: Cannot create log file and send emails

Post 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. :(
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Cannot create log file and send emails

Post 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.
Please use Search before posting and read the Manual
worker
Posts: 16
Joined: 16 Apr 2014, 13:35

Re: Cannot create log file and send emails

Post by worker »

I use this:

$g_phpMailer_method = PHPMAILER_METHOD_SMTP;
Post Reply