REST API Apache PHP7 FPM

Hallo

Ich versuche die REST Api auf einem Server mit Apache, PHP7 FPM zum laufen zu kriegen.

Wenn ich den entsprechenden Code von http://community.shopware.com/api-configuration verwende, dann erhalte ich bein Shop-Aufruf einen Server Error.

Welches ist die richtige .htaccess Konfiguration für Shopware 5 und die Apache PHP7 FPM Kombination?

Vielen Dank für jede Hilfe!

Funktioniert die Konfiguration denn mit < PHP7 FPM?

Ja, einwandfrei.

Welche Exception erhältst Du?

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, and inform them of the time the error occurred and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Und was steht im Error Log? Das ist ja lediglich die Info für den Endanwender… 

[Tue Aug 02 11:41:02.172468 2016] [core:alert] [pid 3499] [client 77.58. ***.*** :49944] /home/httpd/vhosts/ *******/******* /.htaccess: Alias not allowed here
[Tue Aug 02 11:41:02.266194 2016] [core:alert] [pid 12158] [client 77.58. ***.*** :49942] /home/httpd/vhosts/ *******/******* /.htaccess: Alias not allowed here, referer: http:// ******* /

 

wenn du bei mittwald den server hast, hab ich folgende config angelegt bekommen.

im shopware verzeichniss eine “.user.ini” anlegen mit folgendem inhalt

auto_prepend_file = /home/www/ accountNummer /html/shopware/setheader.php

 

in der datei setheader.php folgendes eintragen

<?php
header("Access-Control-Allow-Origin: ". $\_SERVER['HTTP\_ORIGIN']); header('Access-Control-Allow-Credentials: true'); header('Access-Control-Max-Age: 10'); ?\>  

Vielen Dank für die Hilfe.

 

Das Problem hat sich anderweitig erübrigt.
Der API Zugriff erfolgt auch ohne irgendwelche Anpassungen.
Ich habe für den Zugriff auf die REST Api https verwendet. Mit http funktioniert es.

@grevo Schau dir auch mal das Shopware PHP SDK an GitHub - LeadCommerceDE/shopware-sdk: A PHP SDK for the Shopware 5 REST API

1 „Gefällt mir“

Super, das werde ich mir anschauen.

Vielen Dank!

@grevo schrieb:

 

Ich habe für den Zugriff auf die REST Api https verwendet. Mit http funktioniert es.

War für die Seite kein SSL konfiguriert, oder ist kein gültiges SSL-Zertifikat hinterlegt?

Timme Hosting - schnelles nginx-Hosting

www.timmehosting.de

Es handelt sich um einen Testshop auf einem “billigen” Shared-Hosting.

Dort ist aber ein gültiges Let’s Encrypt Zertifikat installiert.

Werden die API Daten auch bei http verschlüsselt übertragen?

Falsch, war mein Fehler.

Da war kein SSL Zertifikat installiert :slight_smile: