# Error 500 when 1st call of index.php

**URL:** https://forum.mautic.org/t/error-500-when-1st-call-of-index-php/2675
**Category:** Product Support
**Created:** [November 1, 2015, 8:09am UTC](https://forum.mautic.org/t/error-500-when-1st-call-of-index-php/2675 "2015-11-01T08:09:06Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![georglohrer](https://avatars.discourse-cdn.com/v4/letter/g/c57346/32.png) [@georglohrer](https://forum.mautic.org/u/georglohrer)
#### Post date: [November 1, 2015, 8:09am UTC](https://forum.mautic.org/t/error-500-when-1st-call-of-index-php/2675/1 "2015-11-01T08:09:06Z")

</div>

Hi,  
  
  
  
I have now tried mautic 1.2.1 on my webspace providing php 5.5.26 and apache, but I do receive an error 500 when first time calling index.php  
  
I then have setup a LAMP-server (Ubuntu 14.04 based - turnkeylinux in use) as a VMware-instance, setup a VirtualHost on 8080 pointing its DocumentRoot to the mautic-directory (/var/www/mautic) and I also receive an error 500.  
  
  
  
A short instrumenting of index.php shows that I got on the screen:  
  
  
  
Step 1Step 2Step 3Step 4

Code:

[index.php] require\_once \_\_DIR\_\_ . '/app/AppKernel.php'; //require\_once \_\_DIR\_\_.'/mautic/app/AppCache.php'; try { $kernel = new AppKernel('prod', false); printf("Step 1"); $kernel-\>loadClassCache(); printf("Step 2"); //$kernel = new AppCache($kernel); printf("Step 3"); // When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter //Request::enableHttpMethodParameterOverride(); $request = Request::createFromGlobals(); printf("Step 4"); $response = $kernel-\>handle($request); printf("Step 5"); $response-\>send(); printf("Step 6"); $kernel-\>terminate($request, $response); printf("Step 7"); } catch (MauticCoreBundleExceptionDatabaseConnectionException $e) { define('MAUTIC\_OFFLINE', 1); $message = $e-\>getMessage(); include \_\_DIR\_\_ . '/offline.php'; } catch (Exception $e) {

---

<div class="post-metadata">

### Author: ![georglohrer](https://avatars.discourse-cdn.com/v4/letter/g/c57346/32.png) [@georglohrer](https://forum.mautic.org/u/georglohrer)
#### Post date: [November 1, 2015, 8:09am UTC](https://forum.mautic.org/t/error-500-when-1st-call-of-index-php/2675/2 "2015-11-01T08:09:06Z")

</div>

Hi,

I have now tried mautic 1.2.1 on my webspace providing php 5.5.26 and apache, but I do receive an error 500 when first time calling index.php  
I then have setup a LAMP-server (Ubuntu 14.04 based - turnkeylinux in use) as a VMware-instance, setup a VirtualHost on 8080 pointing its DocumentRoot to the mautic-directory (/var/www/mautic) and I also receive an error 500.

A short instrumenting of index.php shows that I got on the screen:

Step 1Step 2Step 3Step 4

`[index.php]
require_once __DIR__. '/app/AppKernel.php';
//require_once __DIR__.'/mautic/app/AppCache.php';
try {
    $kernel = new AppKernel('prod', false);
printf("Step 1");
    $kernel->loadClassCache();
printf("Step 2");
    //$kernel = new AppCache($kernel);
printf("Step 3");
    // When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter
    //Request::enableHttpMethodParameterOverride();
    $request = Request::createFromGlobals();
printf("Step 4");
    $response = $kernel->handle($request);
printf("Step 5");
    $response->send();
printf("Step 6");
    $kernel->terminate($request, $response);
printf("Step 7");
} catch (MauticCoreBundleExceptionDatabaseConnectionException $e) {
    define('MAUTIC_OFFLINE', 1);
    $message = $e->getMessage();
    include __DIR__. '/offline.php';
} catch (Exception $e) {
`

---

<div class="post-metadata">

### Author: ![escopecz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/escopecz/32/370_2.png) [@escopecz](https://forum.mautic.org/u/escopecz)
#### Post date: [November 2, 2015, 10:36am UTC](https://forum.mautic.org/t/error-500-when-1st-call-of-index-php/2675/3 "2015-11-02T10:36:43Z")

</div>

Could you check Mautic logs (/app/logs dir) and server logs if there is some error message which would tell us more?

---

<div class="post-metadata">

### Author: ![georglohrer](https://avatars.discourse-cdn.com/v4/letter/g/c57346/32.png) [@georglohrer](https://forum.mautic.org/u/georglohrer)
#### Post date: [November 2, 2015, 5:07pm UTC](https://forum.mautic.org/t/error-500-when-1st-call-of-index-php/2675/4 "2015-11-02T17:07:06Z")

</div>

The /var/www/mautic/app/logs directory is empty.

The apache-logs show:

`127.0.1.1:8080 192.168.10.180 - - [02/Nov/2015:16:29:42 +0000] "GET / HTTP/1.1" 302 556 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36"
127.0.1.1:8080 192.168.10.180 - - [02/Nov/2015:16:29:42 +0000] "GET /index.php/ HTTP/1.1" 500 288 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36"
127.0.1.1:8080 192.168.10.180 - - [02/Nov/2015:16:29:45 +0000] "GET /favicon.ico HTTP/1.1" 302 574 "http://192.168.10.140:8080/index.php/" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36"
127.0.1.1:8080 192.168.10.180 - - [02/Nov/2015:16:29:45 +0000] "GET /index.php/favicon.ico HTTP/1.1" 500 288 "http://192.168.10.140:8080/index.php/" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36"
`

First, there is the redirection 302, and then the server error 500.

I dived a little bit deeper into the totally unknown debris of php-debugging and enabled in /etc/apache2/apache2.conf:

`php_flag display_errors on
php_value error_reporting 2039
`

Restarted apache and now I got for index.php:

code Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 262144 bytes) in /var/www/mautic/app/bootstrap.php.cache on line 2701  
Call Stack

# Time Memory Function Location

1 0.0041 240144 {main}( ) …/index.php:0  
2 0.0697 4289272 AppKernel-\>handle( ) …/index.php:60  
3 0.0705 4300864 AppKernel-\>boot( ) …/AppKernel.php:71  
4 0.1483 6929912 AppKernel-\>initializeContainer( ) …/AppKernel.php:252  
5 1.7009 20393480 SymfonyComponentHttpKernelKernel-\>dumpContainer( ) …/AppKernel.php:489  
6 1.9667 21554616 SymfonyComponentHttpKernelKernel::stripComments( ) …/bootstrap.php.cache:2678  
7 1.9668 21555000 token\_get\_all ( ) …/bootstrap.php.cache:2701  
[/code]

This outcome let me increase the memory-size of the virtual machine to 1GB and got the same result.  
I then increased the memory-size to 2 GB and again achieved the same error at the same point.

And yes of course, there is enough memory available:

`root@lamp ~# cat /proc/meminfo
MemTotal: 2061256 kB
MemFree: 1809356 kB
Buffers: 14680 kB
`

I then checked this allowed memory-size of 33554432 which represents 32M. And I found in /etc/php5/apache2.ini the entry:

`root@lamp php5/apache2# grep "32M" *
php.ini:memory_limit = 32M
`

I increased that to 64M and what should I say, the mautic installation started up.

Would be great if such kind of memory exhaustion errors would be checked. Especially during the installation phase. Additionally it would be worth a hint that could be given to rookies like me.

---

<div class="post-metadata">

### Author: ![escopecz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/escopecz/32/370_2.png) [@escopecz](https://forum.mautic.org/u/escopecz)
#### Post date: [November 4, 2015, 9:48am UTC](https://forum.mautic.org/t/error-500-when-1st-call-of-index-php/2675/5 "2015-11-04T09:48:29Z")

</div>

I’m sorry for your troubles. Hopefully, your investigation helps others. As you suggested, I added the warning message if the memory\_limit setting is lower than 128 MB. It will be available in Mautic 1.2.3:

[https://github.com/mautic/mautic/pull/1124](https://github.com/mautic/mautic/pull/1124)

---

<div class="post-metadata">

### Author: ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)
#### Post date: [February 2, 2020, 10:57pm UTC](https://forum.mautic.org/t/error-500-when-1st-call-of-index-php/2675/6 "2020-02-02T22:57:26Z")

</div>


