SYSTEM:
I have Windows 10/x64, Apache24, MySQL 8.0, PHP 7.2.10
PHP CODE:
$conn = mysqli_connect('localhost', 'user', 'test123', 'ninja_project');
if (!$conn) {echo "Connection error:" . mysqli_connect_error();}
ERRORS:
Warning: mysqli_connect(): PHP was built without openssl extension, can't send password encrypted in C:\Users\User\www\phptutorial\ninjapizza\index.php on line 3
Warning: mysqli_connect(): (HY000/1045): Access denied for user 'user'@'localhost' (using password: YES) in C:\Users\User\www\phptutorial\ninjapizza\index.php on line 3 Connection error:Access denied for user 'user'@'localhost' (using password: YES)
I DID:
- Checked solution through same topics already discussed on stackoverflow, but found nothing helpful in my case.
- Enabled openssl in php.ini extension=openssl.dll
- Specified directory extension_dir = "c:\php\ext"
- Checked openssl status through CMD '''php -i''' - openssl support => enabled
- Checked openssl modul through CMD '''php -m''' - got openssl in list
- Checked localhost/index.php - openssl enabled
- Checked file php-cli.ini on my PC - don't have one
- I tried to rename
$conn = mysqli_connect('localhost'
to$conn = mysqli_connect('127.0.0.1'
. Doesn't work. Same problem. - Granted All privileges to User.
QUESTIONS:
What else I can do to eliminate this issue? I have file named openssl.cnf in Apache24 with default configuration status. Maybe I should do something inside this file to solve the problem? Please help!