phpMyAdmin Error timeout 504

I installed LAMP (http, php, mariadb, phpmyadmin) following this guide:

When I try to import a large DB via phpMyAdmin, instead of getting the “reload the same file to continue” screen, I get a 504 timeout error.

My virtual host for phpMyAdmin:

<VirtualHost *:80>
    ServerAdmin webmaster@domainname1.dom
    DocumentRoot "/srv/http"
    ServerName localhost
    ServerAlias localhost
    ErrorLog "/var/log/httpd/localhost-error_log"
    CustomLog "/var/log/httpd/localhost-access_log" common

    <Directory "/srv/http">
        Require all granted

    Alias /phpmyadmin "/usr/share/webapps/phpMyAdmin"
    <Directory "/usr/share/webapps/phpMyAdmin">
        DirectoryIndex index.php
        AllowOverride All
        Options FollowSymlinks
        Require all granted

    DirectoryIndex index.php index.html
    <FilesMatch \.php$>
        SetHandler "proxy:unix:/run/php-fpm/php-fpm.sock|fcgi://localhost/"

Set max_execution_time in php.ini to a certain extra large value, the default is only 30 seconds, don’t forget to restart php-fpm service. You can also set it to -1, which in theory should be equal to “forever”.

Do note that Apache’s mod_fcgi (which I assume the one you’re using to communicate with php-fpm) also has its own various timeout settings. If it’s reached before PHP one, you will still get 504, just thrown by Apache instead of PHP.

How do I change this setting?
In “php.ini” I have already done it.