PHP auf der Kommandozeile bei Strato

Versucht man die Kommandozeilentools von NextCloud occ und updater.phar bei Strato zu benutzen dann bekommt man so nette Fehlermeldungen:

> php updater/updater.phar
Nextcloud Updater - version: v20.0.0beta4-11-g68fa0d4

Current version is 20.0.3.

Update to Nextcloud 20.0.12 available. (channel: "stable")
Following file will be downloaded automatically: https://download.nextcloud.com/server/releases/nextcloud-20.0.12.zip
Open changelog ↗

Steps that will be executed:
[ ] Check for expected files
[ ] Check for write permissions
[ ] Create backup
[ ] Downloading
[ ] Verify integrity
[ ] Extracting
[ ] Enable maintenance mode
[ ] Replace entry points
[ ] Delete old files
[ ] Move new files in place
[ ] Done

Start update? [y/N] PHP Warning:  Use of undefined constant STDIN - assumed 'STDIN' (this will throw an Error in a future version of PHP) in phar:///mnt/web120/e2/56/510XXX56/htdocs/cloud/updater/updater.phar/vendor/symfony/console/Helper/QuestionHelper.php on line 117
PHP Warning:  fgets() expects parameter 1 to be resource, string given in phar:///mnt/web120/e2/56/510XXX56/htdocs/cloud/updater/updater.phar/vendor/symfony/console/Helper/QuestionHelper.php on line 133


  [RuntimeException]
  Aborted


update [--no-backup]

X-Powered-By: PHP/7.4.23
Content-type: text/html

oder bei occ:

php occ upgrade
X-Powered-By: PHP/7.4.23
Content-type: text/html

An unhandled exception has been thrown:
TypeError: Return value of OC\AppFramework\Http\Request::getScriptName() must be of the type string, null returned in /mnt/web120/e2/56/51008256/htdocs/WordPress-WH3/cloud/lib/private/AppFramework/Http/Request.php:837
Stack trace:
#0 /mnt/web120/e2/56/510XXX56/htdocs/cloud/lib/base.php(163): OC\AppFramework\Http\Request->getScriptName()
#1 /mnt/web120/e2/56/510XXX56/htdocs/cloud/lib/base.php(576): OC::initPaths()
#2 /mnt/web120/e2/56/510XXX56/htdocs/cloud/lib/base.php(1091): OC::init()
#3 /mnt/web120/e2/56/510XXX56/htdocs/cloud/console.php(49): require_once('/mnt/web120/e2/...')
#4 /mnt/web120/e2/56/510XXX56/htdocs/cloud/occ(11): require_once('/mnt/web120/e2/...')
#5 {main}

Dazu kommt, dass die PHP-Version nicht unbedingt zur Version passt, die für den Webspace eingestellt ist (in diesem Fall wäre es eigentlich PHP 7.3 gewesen).

Ein funktionierendes PHP-Binary findet man unter /opt/ in einem Versionsspezifischen Ordner:

/opt/RZphp73/bin/php-cli occ db:add-missing-indices
The current PHP memory limit is below the recommended value of 512MB.
Check indices of the share table.
Check indices of the filecache table.
Adding additional size index to the filecache table, this can take some time...
Filecache table updated successfully.
Check indices of the twofactor_providers table.
Check indices of the login_flow_v2 table.
Check indices of the whats_new table.
Check indices of the cards table.
Check indices of the cards_properties table.
Check indices of the calendarobjects_props table.
Check indices of the schedulingobjects table.
Check indices of the oc_properties table.

Damit funktionieren sowohl occ als auch updater.phar einwandfrei 🙂

Veröffentlicht von

Gerald Schneider

Diplom-Informatiker (DH) in Rostock. Ich blogge über Entwicklung, Internet, mobile Geräte und Virtualisierung.

4 Gedanken zu „PHP auf der Kommandozeile bei Strato“

    1. Den Credit kann ich leider nicht für mich in Anspruch nehmen. Ich hatte dazu als das Problem das erste Mal auftrat in irgend einem Forum was dazu gefunden.

      Als das Problem das zweite Mal auftrat habe ich es nicht wieder gefunden und habe dann mal ein bisschen herumgestöbert. /opt/ ist da einer der ersten Orte an dem sowas liegen könnte, und die Verzeichnisnamen darin sprechen für sich.

      War also eher “intelligentes raten”, vereinfacht dadurch dass ich schon wusste dass das irgendwo gibt.

  1. Hallo Gerald,
    ich stolpere gerade mit identischem Fehler bei meiner Strato NextCloud durch alle möglichen Internet Foren und finde dazu rein gar nichts.
    Nur bei Dir fand ich diese Anleitung. Allerdings verwende ich:
    PHP/8.1.26 und Nextcloud Hub 6 (27.1.5)
    Meine aktuellen Fehler sind identisch mit den von Dir beschriebenen, aber ich finde bei mir nirgends ein /opt Directory. Wo muss ich suchen bzw. was mache ich falsch?
    Ich will nicht nerven, aber wenn Du eine Antwort parat hättest wäre ich sehr dankbar.
    Viele Grüße

Schreibe einen Kommentar zu Christian Antworten abbrechen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert