0

I have a PHP script with the line:

$this->conn = imap_open('{'.$this->server.'/notls}', $this->user, $this->pass

It works when run in browser. However when run as a cron job on parallel plesk version 12 I get error:

PHP Warning: imap_open(): Couldn't open stream {localhost/notls} in /var/www/vhosts/cvdatabase.management/httpdocs/send_email.php on line 115

I have browsed the internet and tried several fixes but so far nothing has worked. Any one know how to fix this?

user1766169
  • 1,932
  • 3
  • 22
  • 44

1 Answers1

0

Because it run in CLI mode. In this mode $_SERVER variable not exist. Try run it like imap_open('{127.0.0.1/notls}'

stepozer
  • 1,143
  • 1
  • 10
  • 22