Running Mantis on a shared server
1AND1 is my provider
Formerly - On MantisBT 1.1.2 -
I used to be able to send email via CRONJOB using the following command:
php mantissave/core/send_emails.php; This process worked flawlessly
I've recently migrated to MantisBT 1.2.17 and copied my config_inc.php from my old mantis folder to my new mantis folder and did not make any changes.
I try to run the following command in my CRONJOB:
php mantisbt-1.2.17/scripts/send_emails.php;
and I am receiving the error -
send_emails.php is not allowed to run through the webserver.
I'm not very good at understanding email servers, etc. so help would be greatly appreciated.
Jim P.
Difficulty with emailing.
Moderators: Developer, Contributor
-
jkpalmer52
- Posts: 78
- Joined: 23 Feb 2005, 17:29
- Location: US-Chicago area
Re: Difficulty with emailing.
Make a copy of send_emails.php
Open send_emails.php in editor and add the following line before the line exit( 1 )Which output do you get now?
Try also if it works after removing the line exit( 1 )
Open send_emails.php in editor and add the following line before the line exit( 1 )
Code: Select all
echo php_sapi_name();
Try also if it works after removing the line exit( 1 )
-
jkpalmer52
- Posts: 78
- Joined: 23 Feb 2005, 17:29
- Location: US-Chicago area
Re: Difficulty with emailing.
I have modified the code as you have described:
if( php_sapi_name() != 'cli' ) {
echo "send_emails.php is not allowed to run through the webserver.\n";
echo php_sapi_name(); <----New line
exit( 1 );
When I execute the statement from CLI, the value that is returned from the echo that I added is cgi-fcgi
I commented out the exit(1) statement and now emails are being processed.
if( php_sapi_name() != 'cli' ) {
echo "send_emails.php is not allowed to run through the webserver.\n";
echo php_sapi_name(); <----New line
exit( 1 );
When I execute the statement from CLI, the value that is returned from the echo that I added is cgi-fcgi
I commented out the exit(1) statement and now emails are being processed.
Re: Difficulty with emailing.
Ok, it works but it's no clean solution.
You could check if your provide offers also a php-cli command.
If so, you could try using this one in your cron job.
Maybe this works without changing send_emails.php
e.g. php-cli mantisbt-1.2.17/scripts/send_emails.php;
You could check if your provide offers also a php-cli command.
If so, you could try using this one in your cron job.
Maybe this works without changing send_emails.php
e.g. php-cli mantisbt-1.2.17/scripts/send_emails.php;