Hello,
The PHP error is related to SEOBOSS (since turning it off resolves the issue).
As for the 504 error, this means that the server did not recieve a timely response. To resolve this you can,
a) Report it to your hosting provider,
b) Disable 3rd party extensions to see which one is causing this.