ApacheFriends / xampp-build

XAMPP Build system
Apache License 2.0
41 stars 10 forks source link

php-sodium not always available under Windows #34

Open stronk7 opened 6 months ago

stronk7 commented 6 months ago

Hi,

we have got various reports about the PHP 8.2 packages for Windows (note that the problem may apply also to older PHP versions) not loading properly the php-sodium extension under Apache.

Curiously, it doesn't seem to affect to all Windows machines (maybe because some have some extra PATH setup that allows them to find the needed libraries, aka libsodium.dll.

There are a couple of workarounds for that that seem to work:

  1. The easy one, but ugly: Just copy the /xampp/php/libsodium.dll file to the apache/bin directory, restart XAMPP and done.
  2. The harder one, but correct: Edit the /xampp/apache/conf/extra/httpd-xampp.conf file, add LoadFile "/xampp/php/libsodium.dll", restart and done.

With both workarounds apache should be able to find the libsodium.dll file, allowing php-sodium to load ok.

Again, it's not reproducible in all Windows machines and, surely it also applies to older PHP versions.

So this is a request to provide the 2nd solution above (if it's correct, I've seen that we are already loading other PHP stuff there) in the next releases. That way... everybody will be able to use php-sodium under Windows if wanted to (for us, it's a requirement to have it enabled, for example).

Ciao :-)

fellipebadaro commented 6 months ago

I wasn't able to find the path /xampp/apache/conf/extra/httpd-xampp.conf in my WAMP64bits installation. May I'm missing something? I've checked and sodium extension it's enabled, but I can't find in phpinfo() content.