Skip to content
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

Solution for "Undefined symbol: crypto_core_ristretto255_scalar_invert" Error with PHP libsodium #525

Open
coladrian opened this issue Mar 21, 2024 · 1 comment

Comments

@coladrian
Copy link

Hello,

Recently, I stumbled upon the OneinStack project and, out of curiosity, took a moment to delve into its capacities in detail.

I've encountered an issue with the PHP libsodium extension that results in the following error when using PHP versions 8.2/8.3:

Undefined symbol: crypto_core_ristretto255_scalar_invert

After some investigation and testing, I've found a solution that resolves this error by upgrading the underlying libsodium library to version 1.0.19 and then adjusting the library symlink to ensure compatibility with PHP 8.2/8.3. I believe this solution might be beneficial for others facing the same issue, and possibly, it could be included in the documentation or troubleshooting guide.

Here are the steps I followed:

  1. Download and extract the libsodium version 1.0.19:
wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.19-stable.tar.gz
tar -xvf libsodium-1.0.19-stable.tar.gz
  1. Compile and install the downloaded version:
cd libsodium-stable/
./configure
make && make check
sudo make install
  1. Due to the version mismatch issue with PHP 8.2/8.3 expecting libsodium.so.23 but the installed version being libsodium.so.26, create a symlink or copy the file to match the expected version:
cd /usr/local/lib/
cp libsodium.so.26 libsodium.so.23

Note: This step replaces the older version (libsodium.so.23) with the new one (libsodium.so.26). If preserving the original is desired, consider using a symlink or adjusting the environment's library path to prioritize the newer version.

I hope this solution can help others facing the same issue. Perhaps the maintainers could evaluate the feasibility of integrating a similar fix or guide into the official documentation or troubleshooting sections for those using newer PHP versions with libsodium.

Thank you for your attention and the great work on this extension!

Best regards,
Adrian

@oneinstack
Copy link
Owner

Thank you for the reminder, I will update the version level of libsodium when PHP is 8.2/8.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants