mysql - PHP Laravel compare binary string with raw string
one text
I'm running php 7.4 on centos 7 with nginx, mysql
I got problem when i try to compare (md5 binary) string that queried from mysql (via eloquent) with the md5 binary string (use md5 function)
This is result i got from Tinker
Psy Shell v0.9.12 (PHP 7.4.30 ???��cli) by Justin Hileman
>>> Users::findByName('test')->passwd2
[!] Aliasing 'Users' to 'App\Models\Users' for this Tinker session.
=> "?��IG\x06V?\x01\fB?`?\x08L\x15x"
>>> md5('testxxxxxxx',true)
=> b"?��IG\x06V?\x01\fB?`?\x08L\x15x"
>>> Users::findByName('test')->passwd2 == md5('testxxxxxxx',true)
=> false
But it works fine when i run it with apache (instead of nginx) Am i miss any config or lib?
Source