title: Attempted to call function from namespace
body: <p>Got this error, and don't understand it.. Thanks in advance for your help :D</p>
  
  <p>Info :<br>
  - Symfony 3<br>
  - Ubuntu 15.x </p>
  
  <pre><code>Attempted to call function "mcrypt_create_iv" from namespace "AppBundle\Controller". 
  </code></pre>
  
  <p>Use and class :</p>
  
  <pre><code>&lt;?php
  
  namespace AppBundle\Controller;
  
  use AppBundle\Entity\Logs;
  use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  use Symfony\Component\HttpFoundation\Request;
  use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
  use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
  use Symfony\Component\Finder\Finder;
  use Symfony\Component\HttpFoundation\Response;
  use Symfony\Component\Filesystem\Filesystem;
  
  
  class FileController extends Controller
  {
  </code></pre>
  
  <p>My function : </p>
  
  <pre><code>    protected function encrypt ($payload, $key) {
      $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC), MCRYPT_DEV_URANDOM);
      $crypt = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $payload, MCRYPT_MODE_CBC, $iv);
      $combo = $iv . $crypt;
      $garble = base64_encode($iv . $crypt);
      return $garble;
  }
  </code></pre>
  
  <p>And where i call it : </p>
  
  <pre><code>    public function getPrivateDirectoryAction($returnPath = false, Request $request)
  {
      $user = $this-&gt;getUser();
      if ($request-&gt;request-&gt;get('path') != null){
          $fullPath = $request-&gt;request-&gt;get('path');
      } else {
          if($returnPath){
              $fullPath = $returnPath;
          } else {
              $path = $this-&gt;getUser()-&gt;getPath();
              $dir = $this-&gt;ftpDirectory;
              $fullPath = $dir.$path;
          }
      }
      $finder = new Finder();
      $files = $finder-&gt;in($fullPath);
      $this-&gt;generateLogAction($user, $fullPath, 'null', 'access');
  
      $files = iterator_to_array($files-&gt;getIterator());
  
      foreach($files as $key =&gt; $value) {
          $value-&gt;path_crypted = $this-&gt;encrypt($value-&gt;getPath(), 'secret') . '||' . $this-&gt;encrypt($value-&gt;getBasename() , 'secret');
      }
  
      return $this-&gt;render('File/index.html.twig', array(
          'files' =&gt; $files,
          'path' =&gt; $fullPath
  
      ));
  }
  </code></pre>
  
  <p>(It's in the same class..)</p>
  
  <p>If someone can help me, explain how you did with easy word please. My english is realy bad :D</p>
  
  <p>Edit : </p>
  
  <pre><code>[PHP Modules]
  bcmath
  bz2
  calendar
  Core
  ctype
  curl
  date
  dba
  dom
  ereg
  exif
  fileinfo
  filter
  ftp
  gd
  gettext
  hash
  iconv
  json
  libxml
  mbstring
  mcrypt
  mhash
  mysql
  mysqli
  openssl
  pcntl
  pcre
  PDO
  pdo_mysql
  Phar
  posix
  readline
  Reflection
  session
  shmop
  SimpleXML
  soap
  sockets
  SPL
  standard
  sysvmsg
  sysvsem
  sysvshm
  tokenizer
  wddx
  xml
  xmlreader
  xmlwriter
  Zend OPcache
  zip
  zlib
  
  [Zend Modules]
  Zend OPcache
  
  mcrypt support  enabled
  mcrypt_filter support   enabled
  Version 2.5.8
  </code></pre>