PrestaShop / php-ps-info

Simple script that allows you to test if your current environment fulfills PrestaShop's system requirements, and offers suggestions for improvements.
MIT License
107 stars 110 forks source link

Can't login - 401 unauthorized #1

Closed masiorama closed 4 years ago

masiorama commented 6 years ago

Hello there, I was able to use your script on my staging environment, while on production is not working at all, as it keeps asking for credentials, while I'm sure that those are right. Any idea why it is not working? Maybe it is related on the usage of $_SERVER in the checkAuth method? Thanks in advance.

Edit by @PierreRambaud: If the problem occurs, comment this line https://github.com/PrestaShop/php-ps-info/blob/master/phppsinfo.php#L499

$info = new PhpPsInfo();
// $info->checkAuth();
PierreRambaud commented 6 years ago

Hi and thanks for your feedback. What webserver are you using? Nginx ? Apache?

masiorama commented 6 years ago

Apache 2 PHP Version 7.0.31 Thanks!

PierreRambaud commented 6 years ago

Do you configure a new login or password? If yes, how to you do that?

masiorama commented 6 years ago

I tried both with original and changed credentials. Sorry, I understand it is pretty difficult to find a solution in my case without further data. I will check again a couple of times and then report back to you. Thanks!

edit: I tried again and on that server I have no clue, it keeps asking for credentials. No big deal anyway, I'm sure prestashop requirements are met anyway. Thanks!

PierreRambaud commented 6 years ago

Still weird, I will try to investigate on tomorrow :)

PierreRambaud commented 6 years ago

@masiorama Still can't reproduce :( Are you on Linux?

masiorama commented 6 years ago

Yes, I'm on CentOS

PierreRambaud commented 6 years ago

This is maybe because you're running under CGI configuration. What version of PHP are you using?

masiorama commented 6 years ago

How can I check that? The PHP version is 7.0.31

PierreRambaud commented 6 years ago

Follow this link to know if you're running under CGI: https://stackoverflow.com/a/16414507

masiorama commented 6 years ago

Yes, I'm on CGI/FastCGI, just checked.

PierreRambaud commented 6 years ago

As I know, you need to disable the checkAuth, or play with Apache authentication system :/

masiorama commented 6 years ago

Can't on that shared hosting, I have very limited privileges.

espacious commented 5 years ago

Same here. But i can access if i dont change the password, but if i change the password to anything but not prestashop i get 401.

PierreRambaud commented 5 years ago

You can remove the check otherwise and add a htapasswd check instead

espacious commented 5 years ago

Ok, sorry for late response. Yes could be a solution, but did we found some info why this is happening? I can provide logs and server configs... For me is happening on CentOS with latest Plesk with php 7.1.x or 7.2.x with php FPM enabled.

metacreo commented 4 years ago

The HTTP_AUTHORIZATION header removed by apache Two ways to fix. 1) Add to .htaccess RewriteCond %{HTTP:Authorization} . RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 2) Or add to apache config (may be virtualhost config) SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1

PierreRambaud commented 4 years ago

@metacreo Could you create a pull request to improve the readme?

Gipielle commented 4 years ago

I have the same problem

Gipielle commented 4 years ago

How can i remove password request by comment the file ?

Thanks

PierreRambaud commented 4 years ago

@Gipielle You can comment this line: https://github.com/PrestaShop/php-ps-info/blob/master/phppsinfo.php#L499 I will update the issue description :wink:

Gipielle commented 4 years ago

Thanks