Search code examples
phpsymfonyimapsymfony-3.2

Symfony imap "Attempted to call function "imap_open" from the global namespace."


Im trying to get imap working inside my symfony 3 project. But when im trying to run any imap related commands I get the "Attempted to call function "imap_function_here" from the global namespace." error. I'm pretty sure that I am using it correctly because if I run an completely empty php file with just:

<?php
$conn = \imap_open('imap.mailserver.com:993/imap/ssl}INBOX','[email protected]', 'password');
var_dump($conn)

It work just fine, but the exact same code inside my symfony project wil result in an error. Can anyone help me, thanks in advance.


Solution

  • So after 3 hours of failing I restarted my server and it works. My symfony was running while I installed imap so it started without it. So thanks for the effort, but it just was a stupid mistake on my side.