New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to install/upgrade to PS 8.1.1 under Windows #33615
Comments
This is why we implemented this check, if it wasn't there, the installation would crash. You need to fix your PHP configuration. You would have problems with other things even in older versions, for example - you may not be able to download a language pack etc. |
Didn't you read my submission? I explicitly mentioned that OpenSSL is installed. It looks like some obstructionists at Prestashop have tried to "solve" the They have added a check to D/modules/autoupgrade/classes/UpgradeSelfCheck.php that looks like
The function openssl_pkey_new() needs a path to openssl.cnf and it looks my Xampp installation doesn't provide that by default. Never mind that the great majority of Prestashops doesn't have any need for public and private keys. |
I can read just fine, but openssl installed and enabled is not enough. You must check the paths to the certificates in php.ini, in XAMPP it's not configured correctly sometimes.
Yeah that was me, because it's better to notify the user before installing, then throwing a fatal error during the install. Open |
Yes, those values are correct in my php.ini. I did some experiment and saw that when I add a "config" setting to the Prestashop code it will work: However, I don't know how to add that to php.ini. |
@musicpanda This is my local PHP configuration, check everything that contains "openssl" and try to find what you have different. It will work fine without code modification. We can then put it into https://devdocs.prestashop-project.org/. ;-) |
I ran "php -i" and I saw the following setting:
Obviously Xampp didn't put its files there and in fact the directory "C:\Program Files\Common Files\SSL" doesn't even exist on my computer. What I understand is that OpenSSL takes its default directory from the time when it was compiled and the only way around that is setting a Windows environment variable (as you did with OPENSSL_CONF). Making a setting in php.ini seems impossible. So the only viable way I see for Prestashop to get this working for Windows is to get the php.ini setting for openssl.cafile. That will give you the Apache directory and from there you can make a guess where the openssl.cfg file is located. You can check whether the file exists and then make a call setting the OPENSSL_CONF environment variable. As some people have more than one Xampp installation on their computer this should be done before each call that uses this setting. I am not sure whether that will work for WAMP and Laragon. |
An alternative might be that Prestashop owns its own openssl.cnf. When I searched for openssl.cnf I notice that quite a few modules have their own version. I saw it for ps_accounts, ps_metrics, ps_eventbus and ps_checkout, although not for all versions. |
@musicpanda The environment variable is set by XAMPP. Can you check? Open httpd-xampp.conf and check that you have the OPENSSL_CONF specified.
Update, I also have it as windows environment variable. Please try it and tell me if it fixes the issue. ;-) |
No, none of these variables is set in my Windows environment. It makes me wonder what this "IfModule env_module" checks for. |
OK, so try to set OPENSSL_CONF like I have. |
I tried quite a few variations. But none had the effect that the PS upgrade passed the test. |
When I checked on Stackoverflow I noticed that more people complain that it doesn't work for them. I get the impression that it worked in the past but no longer. |
Same issue under Wamp, This is clearly an issue beacause it worked in previous versions. It happens also if you configure PS in http mode (should not)! |
@ComonSoft You need to properly configure your environment, I suggest getting help of a skilled Windows admin or googling. :-) |
This reaction doesn't make sense. If you want to claim that people don't have their Windows properly configured you should specify where. Windows is not Linux: its users don't extensively configure it. Most installations look exactly the same. |
We might add documentation about it, but configuration differs whether you use WAMPP, XAMPP, Laragon, or whatever other app there is on Windows. |
@musicpanda The stack people are using is not correctly configured, I am sure that if you googled and we compared our configurations, it will work properly.
Yep, for normal use, but if you want to run a webserver on it, it needs some configuration. And XAMPP is not configured well for it by default. Didn't you have to properly enable all extensions, setup opcache, memory limits etc. when you installed XAMPP? ;-) I will try it on a clean windows PC and update the docs for steps. ;-) |
Initially setting OPENSSL_CONF didn't work. But when I came back a few days later and also changed the php directory in PATH it suddenly worked. But it annoys me that all this humbug is necessary on a Windows installation that usually is meant as the experimentation copy of a life shop. It is also annoying as I have several Xampp installations for different PHP versions. Unfortunately there are yet more serious problems. PS 8.x has serious cache problems under Windows - probably due to Symfony malfunctioning. This goes to such an extent that I am puzzled how Prestashop could adopt this. When you can't get the most basic things right under Windows I don't trust you to get anything else right. I see the below type of errors daily. Refreshing the page usually helps. But the wondering how this could happen remains: I tried PS 8.1 both as an update and a fresh installation. The update (from 8.1.0) succeeded now at once. The installation has failed four times now and the end is not in sight. And every time the error is different. The first time the installation stopped at 67% and I got the message that the ps_edition_basic module could not be installed. Interestingly the errorlog contained a hundred messages, most about undefined constants. Amazing that it still reached 67%.
The following times there were hardly any error messages. The second time a.o. some translation messages:
The third time produced just like the first time a message that a module could not be installed. Only this time it concerned two modules: The fourth time I had enabled debug mode. This time I got a message that I should use at least PHP 8.1 (I use 7.4). |
Here another victim: https://www.prestashop.com/forums/topic/1080264-turnkey-lamp-cant-install-ps8/ |
@musicpanda Firstly, glad to hear that your issue has been fixed, but we are starting to mix pears and apples. :-)
Setting up PHP on Windows requires some configuration, you see that it was matter of one minute to set it up. It's mentioned here in the official PHP documentation. https://www.php.net/manual/en/openssl.installation.php Prestashop has nothing to do with this.
You can setup multiple PHP instances on xampp, then setup which folder should use which PHP version. Or there are alternatives like MAMP PRO, where you can switch versions.
It sucks, I know, it happens to me also from time to time, but it does so only locally, so I can live with it. I never experienced it on Linux webservers. It would be cool if you could get it fixed and submit a PR for it. Regarding the errors you sent and the link to forums, all these errors are coming from Prestashop company edition of the sofware, which we unfortunately can't control. :( Please use the clean edition to install it - https://github.com/PrestaShop/PrestaShop/releases/tag/8.1.1, it doesn't contain any tracking, buggy modules. |
It's still a thing
Implementing a check is a good thing. But you must also implement a clear and simple solution to it.. I've been using Prestashop from time to times (I mainly use Wordpress & Drupal, and I often teach PHP/SQL/CMS to students), and EVERYTIME Prestashop is the CMS giving me the hard time on local installation !!!! I use Wamp 3.3.0 (PHP 8.1) on Windows 10 Prestashop, plz fix. |
@BenoitAdam94 We can't implement tutorials to properly configure your web server environment, sorry. |
I can't recommend my students and my clients to use Prestashop then. We talk about basic local windows environment here, not a random linux VPS. |
You simply need to install OpenSSL from Shining Light Productions (slproweb.com). |
Prerequisites
Describe the bug and add attachments
When upgrading from PS 8.1 to PS 8.1.1 under Windows I got the following error: Unable to generate private keys using openssl_pkey_new. Check your OpenSSL configuration, especially the path to openssl.cafile.
PHP's Openssl module is installed and previous Prestashops versions didn't give this problem.
See also this error on the forum about a failed installation: https://www.prestashop.com/forums/topic/1079137-unable-to-generate-private-keys-using-openssl_pkey_new/
The file paths in this report suggest it is WIndows too.
Expected behavior
flawless installation
Steps to reproduce
Install PS 8.1.
Upgrade to PS 8.1.1
PrestaShop version(s) where the bug happened
8.1.1
PHP version(s) where the bug happened
7.4
If your bug is related to a module, specify its name and its version
No response
Your company or customer's name goes here (if applicable).
No response
The text was updated successfully, but these errors were encountered: