fiedsch / contao-4-backup-script

Backup Skript für Contao 4
MIT License
7 stars 1 forks source link

Datenbank wird nicht gesichert - Hostingwerk #3

Closed mlwebworker closed 4 years ago

mlwebworker commented 4 years ago

Ich habe Dein Script jetzt das erste Mal bei Hostingwerk im Einsatz. Die Files werden gesichert aber bei der DB gibt es Probleme

ERROR     [console] Error thrown while running command "debug:container --parameter=database_user". Message: "syntax error, unexpected '?', expecting function (T_FUNCTION) or const (T_CONST)" ["exception" => ParseError { …},"command" => "debug:container --parameter=database_user","message" => "syntax error, unexpected '?', expecting function (T_FUNCTION) or const (T_CONST)"]

In Configuration.php line 29:

  syntax error, unexpected '?', expecting function (T_FUNCTION) or const (T_CONST)

debug:container [--show-private] [--show-arguments] [--show-hidden] [--tag TAG] [--tags] [--parameter PARAMETER] [--parameters] [--types] [--env-var ENV-VAR] [--env-vars] [--format FORMAT] [--raw] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--] <command> [<name>]

19:43:33 ERROR     [console] Error thrown while running command "debug:container --parameter=database_password". Message: "syntax error, unexpected '?', expecting function (T_FUNCTION) or const (T_CONST)" ["exception" => ParseError { …},"command" => "debug:container --parameter=database_password","message" => "syntax error, unexpected '?', expecting function (T_FUNCTION) or const (T_CONST)"]

In Configuration.php line 29:

  syntax error, unexpected '?', expecting function (T_FUNCTION) or const (T_CONST)

debug:container [--show-private] [--show-arguments] [--show-hidden] [--tag TAG] [--tags] [--parameter PARAMETER] [--parameters] [--types] [--env-var ENV-VAR] [--env-vars] [--format FORMAT] [--raw] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--] <command> [<name>]

19:43:33 ERROR     [console] Error thrown while running command "debug:container --parameter=database_host". Message: "syntax error, unexpected '?', expecting function (T_FUNCTION) or const (T_CONST)" ["exception" => ParseError { …},"command" => "debug:container --parameter=database_host","message" => "syntax error, unexpected '?', expecting function (T_FUNCTION) or const (T_CONST)"]

In Configuration.php line 29:

  syntax error, unexpected '?', expecting function (T_FUNCTION) or const (T_CONST)

debug:container [--show-private] [--show-arguments] [--show-hidden] [--tag TAG] [--tags] [--parameter PARAMETER] [--parameters] [--types] [--env-var ENV-VAR] [--env-vars] [--format FORMAT] [--raw] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--] <command> [<name>]

19:43:34 ERROR     [console] Error thrown while running command "debug:container --parameter=database_name". Message: "syntax error, unexpected '?', expecting function (T_FUNCTION) or const (T_CONST)" ["exception" => ParseError { …},"command" => "debug:container --parameter=database_name","message" => "syntax error, unexpected '?', expecting function (T_FUNCTION) or const (T_CONST)"]

In Configuration.php line 29:

  syntax error, unexpected '?', expecting function (T_FUNCTION) or const (T_CONST)

debug:container [--show-private] [--show-arguments] [--show-hidden] [--tag TAG] [--tags] [--parameter PARAMETER] [--parameters] [--types] [--env-var ENV-VAR] [--env-vars] [--format FORMAT] [--raw] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--] <command> [<name>]

19:43:34 ERROR     [console] Error thrown while running command "debug:container --parameter=database_port". Message: "syntax error, unexpected '?', expecting function (T_FUNCTION) or const (T_CONST)" ["exception" => ParseError { …},"command" => "debug:container --parameter=database_port","message" => "syntax error, unexpected '?', expecting function (T_FUNCTION) or const (T_CONST)"]

In Configuration.php line 29:

  syntax error, unexpected '?', expecting function (T_FUNCTION) or const (T_CONST)

debug:container [--show-private] [--show-arguments] [--show-hidden] [--tag TAG] [--tags] [--parameter PARAMETER] [--parameters] [--types] [--env-var ENV-VAR] [--env-vars] [--format FORMAT] [--raw] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--] <command> [<name>]

Usage: mysqldump [OPTIONS] database [tables]
OR     mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]
OR     mysqldump [OPTIONS] --all-databases [OPTIONS]
For more options, use mysqldump --help
fiedsch commented 4 years ago

Das

Error thrown while running command "debug:container --parameter=database_port". Message: "syntax error, unexpected '?', expecting function (T_FUNCTION) or const (T_CONST)" ["exception" => ParseError { …},"command" => "debug:container --parameter=database_port","message" => "syntax error, unexpected '?', expecting function (T_FUNCTION) or const (T_CONST)"]

In Configuration.php line 29:

sieht mir nach einer falschen PHP-CLI Version aus. Was wird Dir denn ausgegeben, wenn Du auf der Console (z.B.)

vendor/bin/contao-console debug:container --parameter=database_port

ausführst. Der Output sollte etwas wie

vendor/bin/contao-console debug:container --parameter=database_port
 --------------- ------- 
  Parameter       Value  
 --------------- ------- 
  database_port   3306   
 --------------- ------- 

sein. Daraus holt sich das Backup-Skript dann die 3306. Datenbankname, Benutzername und Passwort gehen analog. Deshalb erscheint der Fehler auch mehrfach.

fiedsch commented 4 years ago

Eventuell musst Du (in main.sh) die Variable PHP_CLI anpassen.

mlwebworker commented 4 years ago

Nach Umstellung auf die korrekte PHP-Version läuft alles. Die Ausgabe des Outputs für den Konsolenbefehl ist dann auch genau wie er sein soll. Danke für die Unterstützung.