Error 500 Mautic 3.0.2 clean installation

Your software
My Mautic version is: 3.0.2
My PHP version is: 7.2.32
MariaDB 10.4.13-MariaDB
PHP version: 7.2.32
Apache version: Apache/2.4.39
Distro Name: CentOS Linux release 7.8.2003 (Core)
Kernel Version: 3.10.0-1127.18.2.el7.x86_64
Your problem
My problem is:
I am trying to perform a clean installation of Mautic 3.0.2

But, I still get the error below when trying to process /step/1.1

https://www.tismail.com.br/installer/step/1.1

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@tismail.com.br to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Does anyone know how to solve this?

These errors are showing in the log:
Script timed out before returning headers: index.php, referer: https://tismail.com.br/mem/installer/step/1

Steps I have tried to fix the problem:
I have already checked all folder permissions, PHP versions, MariaDB etc.

For some weird reason, MariaDB 10.4 didn’t go well for me when I was trying to install mautic 3, could you try updating to 10.5 and retry.

Also, Error 500 can mean a hell lots of things, but this can generally be due to some misconfiguration on your server, make sure your server block is properly configured e.g your apache config.

Hi @devsrealm,

Thank you for the informations.

The switch to MariaDB 10.4 was already an attempt to resolve, but it didn’t work. I will try 10.5 as informed.

Regarding Apache, I’ve done several revisions and nothing has resolved. Do you have any special tips on what to configure?

In fact, I use NGINX as well.

Unfortunately, after installation for MariaDB 10.5.4 the problem of error 500 remains the same. :frowning:

Should we try it with Nginx? I am very certain it would work using nginx as I have done a lots of installation with mautic 3 using nginx.

Yes, I am trying with Nginx but it is not working.

Do you mind sharing what you’ve tried, and the error you got?

Hi @devsrealm,

I made 3 MariaDB version changes, now I have the version: 10.5.4
I updated the PHP version to: 7.2.32

The only error I get is this:

[Sun Aug 09 14:31:12.130171 2020] [core:error] [pid 1389:tid 140268422539008] [client 192.168.1.51:53020] Script timed out before returning headers: index.php, referer: https://www.tismail.com.br/installer/step/1
[Sun Aug 09 15:20:02.281552 2020] [core:error] [pid 1421:tid 140268422539008] [client 192.168.1.51:53208] Script timed out before returning headers: index.php, referer: https://www.tismail.com.br/installer/step/1
[Sun Aug 09 15:30:01.125826 2020] [core:error] [pid 1388:tid 140268447717120] [client 192.168.1.51:53240] Script timed out before returning headers: index.php, referer: https://www.tismail.com.br/installer/step/1
[Sun Aug 09 15:33:17.714073 2020] [core:error] [pid 1389:tid 140268372182784] [client 192.168.1.51:53242] Script timed out before returning headers: index.php, referer: https://www.tismail.com.br/installer/step/1
[Sun Aug 09 15:39:55.643899 2020] [core:error] [pid 1388:tid 140268439324416] [client 192.168.1.51:53248] Script timed out before returning headers: index.php, referer: https://www.tismail.com.br/installer/step/1

This is Contents of File: /etc/my.cnf

#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]

#
# include *.cnf from the config directory
#
!includedir /etc/my.cnf.d

# The following options will be passed to all MySQL clients
[client]
port            = 3306

# The MySQL server
[mysqld]
port            = 3306
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 2M
sort_buffer_size = 2048K
net_buffer_length = 16K
myisam_sort_buffer_size = 8M
log_error = /var/lib/mysql/tismail.com.br.err

# Don't listen on a TCP/IP port at all.
skip-networking

# required unique id between 1 and 2^32 - 1
server-id       = 1

# Uncomment the following if you are using BDB tables
bdb_cache_size = 4M
bdb_max_lock = 10000

# InnoDB tables are now used by default
# innodb_data_home_dir = /srv/mysql
# innodb_log_group_home_dir = /srv/mysql
# All the innodb_xxx values below are the default ones:
# innodb_data_file_path = ibdata1:12M:autoextend
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
innodb_buffer_pool_size = 128M
innodb_log_file_size = 48M
innodb_log_buffer_size = 16M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
safe-updates

[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

# End /etc/mysql/my.cnf

Your script is taking too long to execute and thus timed out. change your max execution time, find your php.ini, find the following, and change the values as follows:

memory_limit = 512M  
max_execution_time = 360 

Hi @devsrealm,

I made the informed adjustments and restart the Apache Web Server.
I tried to install again and it didn’t work.

Any other tips?

image

There are lots of stuff that might be affecting the installation behind the scene, without seeing what you’ve done right from the one set, it would be difficult to say what the underlying issue is.

Before we go further, could you list all your installed PHP module, use the following command to do that:

yum list installed | grep -i php

Copy the output, and paste it here.

Hi @devsrealm,

Thanks for you support.

Please check the log.

[root@mail ~]# yum list installed | grep -i php
cwp-suphp.x86_64                     0.7.2-3                          @cwp      
cwpphp.x86_64                        7.2.30-3                         @cwp      
[root@mail ~]#

I finally managed to install Mautic !!!

Here is information about the problem I had in my environment to help the community.

Basically being able to discover that the problem was in the process of creating the Mautic tables. To reach this understanding, I ran the following command from the Mautic console on the command line:

$> php bin/console mautic:install:data

This command recreates all the Mautic tables, to my surprise, this process took more than 40 minutes to complete. That’s when I started to analyze the MariaDB settings and arrived at this configuration in the /etc/my.cnf file

#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]

#
# include *.cnf from the config directory
#
!includedir /etc/my.cnf.d

[mysqld]
query_cache_size = 64M
tmp_table_size = 64M 
max_heap_table_size = 64M 
performance_schema=ON
performance-schema-instrument='stage/%=ON'
performance-schema-consumer-events-stages-current=ON
performance-schema-consumer-events-stages-history=ON
performance-schema-consumer-events-stages-history-long=ON

skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 1M
sort_buffer_size = 512K
net_buffer_length = 16K
myisam_sort_buffer_size = 8M

thread_cache_size = 16

slow-query-log = 1
slow-query-log-file = /var/lib/mysql/mysql-slow.log
long_query_time = 1 

wait_timeout = 60 

# Don't listen on a TCP/IP port at all.
skip-networking
skip-name-resolve

# required unique id between 1 and 2^32 - 1
server-id       = 1

# Uncomment the following if you are using BDB tables
#bdb_cache_size = 4M
#bdb_max_lock = 10000

# InnoDB tables are now used by default
# innodb_data_home_dir = /srv/mysql
# innodb_log_group_home_dir = /srv/mysql
# All the innodb_xxx values below are the default ones:
innodb_data_file_path = ibdata1:12M:autoextend
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
innodb_buffer_pool_size = 2G
innodb_log_file_size = 48M
innodb_log_buffer_size = 16M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50

innodb_file_per_table = 1

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
safe-updates

[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

As the script’s execution time is very long, the page falls due to time out and we received the famous error 500.

After all the settings, I started the installation process via the browser again.

If after all these configurations, you still return error 500 (you will be YOURDOMAIN.COM/installer/step/1.1), you must wait for the process of creating the tables to finish (check the processes running on MySQL) when finish, simply change to YOURDOMAIN.COM/installer/step/1.2, so the installation process will continue.

Summing up:

If error 500 occurs in step 1.1:
YOURDOMAIN.COM/installer/step/1.1

After creating the tables, change to step 1.2:
YOURDOMAIN.COM/installer/step/1.2

And finish the installation.

1 Like

You can mark it as solved!

Thanks for taking the time to posting your solution to the community. I’m sure your post will help others in the future!!!