Jump to content

Edit History

roombausato

roombausato

Il 1/6/2020 alle 12:47, roombausato disse:

il problema della chiave sbagliata deriva dal fatto
che i servizi Web Prestashop non consentono l'autenticazione
se il PHP in esecuzione sul server è impostato in modalità PHP-FPM a
causa di un bug Prestashop che verifica l'autenticazione
attraverso una variabile di sistema non disponibile in questa configurazione.

PHP-FPM è il modo più performante / recente di eseguire PHP
sul server ed è attivo di default su tutto il nostro hosting ottimizzato
(Https://bobcares.com/blog/php-fpm-advantages/).

Il problema è stato anche evidenziato e discusso dal team Prestashop:
https://github.com/PrestaShop/PrestaShop/issues/15385
ma non è mai stato gestito.

Esistono 3 soluzioni:

1)
Aggiungi queste due righe nella parte superiore del file .htaccess alla radice del sito:

RewriteEngine su
RewriteRule. * - [E = HTTP_AUTHORIZATION:% {HTTP: Autorizzazione}]

2)
Notifica a coloro che utilizzano il servizio web di richiamarlo
passando la chiave di autenticazione come parametro GET ws_key nell'URL
e non come autenticazione http / base

Esempio di una chiamata funzionante: http://sitoweb.com/api?ws_key=xxxxxxxxxxxxxx

3)
Chiedici di disabilitare il supporto PHP-FPM e impostarlo su PHP-CGI
(questo rallenterà le prestazioni complessive).


L'ho risolto aggiungendo questo in .htaccess
RewriteEngine su
RewriteRule. * - [E = HTTP_AUTHORIZATION:% {HTTP: Autorizzazione}]

 

 

roombausato

roombausato

On 1/6/2020 at 12:47, roombausato said:

the problem of the wrong key derives from the fact
that Prestashop webservices do not allow authentication
if the PHP running on the server is set in PHP-FPM mode
due to a Prestashop bug that verifies authentication
through a system variable not available in this configuration.

PHP-FPM is the most performing / recent way of running PHP
on the server and is active by default on all our optimized hosting
(Https://bobcares.com/blog/php-fpm-advantages/).

The problem was also highlighted and discussed by the Prestashop team:
https://github.com/PrestaShop/PrestaShop/issues/15385
but it has never been managed.

There are 3 solutions:

1)
Add these two lines at the top of the .htaccess file to the site root:

RewriteEngine On
RewriteRule. * - [E = HTTP_AUTHORIZATION:% {HTTP: Authorization}]

2)
Notify those who use the webservice to call it back
passing the authentication key as a GET parameter ws_key in the URL
and not as http / basic authentication

Example of a functioning call: http://sitoweb.com/api?ws_key=xxxxxxxxxxxxxx

3)
Request us to disable PHP-FPM support and set it to PHP-CGI
(this will slow down overall performance).


I solved it by adding this in the HTACESS
RewriteEngine On
RewriteRule. * - [E = HTTP_AUTHORIZATION:% {HTTP: Authorization}]

 

 

×
×
  • Create New...