Timeout Installing Prestashop

Hi everyone.
I am trying to install Prestashop

But i getting “1: HTTP 504 - error - Gateway Timeout” when installing addons.

I have changed the php option but i can’t make it work.

max_execution_time = 120
max_input_time = 120

Can anyone help with this?

I changed

Configure Server: APACHE2

Timeout 120

and now that problem has gone away but now i get:

General error: 2006 MySQL server has gone away

it finished install.
Configure Server: MARIADB