title: Laravel application with Apache gives "use of undefined constant MCRYPT_RIJNDAEL_128 - assumed 'MCRYPT_RIJNDAEL_128'"
body: <p>I am very new to Laravel and my problems start at the running-my-application stage. For some reason I get this error when I try to access my application at <a href="http://127.0.0.1/test/public/" rel="nofollow noreferrer">http://127.0.0.1/test/public/</a> (I have Apache server):</p>
  
  <pre><code>ErrorException in EncryptionServiceProvider.php line 16:
  Use of undefined constant MCRYPT_RIJNDAEL_128 - assumed 'MCRYPT_RIJNDAEL_128'
  in EncryptionServiceProvider.php line 16
  at HandleExceptions-&gt;handleError('8', 'Use of undefined constant MCRYPT_RIJNDAEL_128 - assumed 'MCRYPT_RIJNDAEL_128'', '/srv/http/test/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php', '16', array('app' =&gt; object(Application))) in EncryptionServiceProvider.php line 16
  at EncryptionServiceProvider-&gt;Illuminate\Encryption\{closure}(object(Application), array()) in Container.php line 773
  at Container-&gt;build(object(Closure), array()) in Container.php line 656
  at Container-&gt;make('encrypter', array()) in Application.php line 613
  at Application-&gt;make('Illuminate\Contracts\Encryption\Encrypter') in Container.php line 887
  at Container-&gt;resolveClass(object(ReflectionParameter)) in Container.php line 848
  at Container-&gt;getDependencies(array(object(ReflectionParameter)), array()) in Container.php line 813
  at Container-&gt;build('Illuminate\Cookie\Middleware\EncryptCookies', array()) in Container.php line 656
  at Container-&gt;make('Illuminate\Cookie\Middleware\EncryptCookies', array()) in Application.php line 613
  at Application-&gt;make('Illuminate\Cookie\Middleware\EncryptCookies') in Pipeline.php line 124
  at Pipeline-&gt;Illuminate\Pipeline\{closure}(object(Request)) in CheckForMaintenanceMode.php line 42
  at CheckForMaintenanceMode-&gt;handle(object(Request), object(Closure)) in Pipeline.php line 125
  at Pipeline-&gt;Illuminate\Pipeline\{closure}(object(Request))
  at call_user_func(object(Closure), object(Request)) in Pipeline.php line 101
  at Pipeline-&gt;then(object(Closure)) in Kernel.php line 111
  at Kernel-&gt;sendRequestThroughRouter(object(Request)) in Kernel.php line 84
  at Kernel-&gt;handle(object(Request)) in index.php line 53
  </code></pre>
  
  <p>I have mcrypt installed on my system:</p>
  
  <pre><code>[steelrat@archlinux test]$ php -m | grep mcrypt
  mcrypt
  [steelrat@archlinux test]$ php -i | grep mcrypt 
  mcrypt
  mcrypt support =&gt; enabled
  mcrypt_filter support =&gt; enabled
  mcrypt.algorithms_dir =&gt; no value =&gt; no value
  mcrypt.modes_dir =&gt; no value =&gt; no value
  </code></pre>
  
  <p>Moreover, when I start the artisan web server with <code>php artisan serve</code> and access it with <a href="http://localhost:8000" rel="nofollow noreferrer">http://localhost:8000</a>, everything works fine. What can be the problem here?</p>
  
  <p>I am aware of this topic: <a href="https://stackoverflow.com/questions/29993399/use-of-undefined-constant-mcrypt-rijndael-128-assumed-mcrypt-rijndael-128">Use of undefined constant MCRYPT_RIJNDAEL_128 - assumed &#39;MCRYPT_RIJNDAEL_128&#39;</a> . But it doesn't look like my case. The problem with me is that it works with artisan serve and doesn't work with apache.</p>