Warning: Module "openssl" is already loaded in Unknown on line 0

166 Views Asked by At

When I write PHP artisan serve in Laravel 10, This error always write in console. How to resolve this issue?

PS C:\xampp\htdocs\Laravel\test_proj> php artisan serve

*PHP Warning: Module "openssl" is already loaded in Unknown on line 0

Warning: Module "openssl" is already loaded in Unknown on line 0

WARN PHP Warning: Module "openssl" is already loaded in Unknown on line 0.*

1

There are 1 best solutions below

0
Jeyhun Rashidov On

Check both the php.ini file used by your web server (like Apache or Nginx) and the one used by PHP CLI. These files are often located in the PHP installation directory or a separate conf directory. Look for lines that include extension=openssl.so (on Linux) or extension=php_openssl.dll (on Windows). Ensure that these lines are not duplicated in either file.

You need to find all relevant php.ini files in your xampp directory and remove or comment out one of the module directives like this:

;extension=php_openssl.dll

After a server restart, this should solve it.