Home > Article > CMS Tutorial > What to do if login fails in phpcms v9
phpcms v9 login failed? phpcmsv9 full site https ssl member login failure solution
Many friends encountered this when using phpcmsv9 Such a problem is that after converting the whole site to https, the member center cannot log in normally. Specifically, there is no return value and prompts login failure. The main reason is that when the system initializes phpsso, it cannot transmit the data to the corresponding method through 443. To troubleshoot the problem, you can see that in client.class.php, the default port used by the system is 80, so we only need to modify it as follows to solve the problem of members being unable to log in after https:
##phpcms/modules/member/classes/client.class.php
$port = !empty($matches['port']) ? $matches['port'] : ( strtolower($matches['scheme'])=='https' ? 443 : 80 );Line 386 replaces:
$fp = @fsockopen(($ip ? $ip : $host), $port, $errno, $errstr, $timeout);with
$contextOptions = array( 'ssl' => array( 'verify_peer' => false, 'verify_peer_name' => false ) ); //如果有签名的证书 //$contextOptions = array( // 'ssl' => array( // 'verify_peer' => true, // 'cafile' => '/path/to/cacert.pem', // //'CN_match' => 'indexroot.net', // 匹配域名 // 'ciphers' => 'HIGH:!SSLv2:!SSLv3', // 'disable_compression' => true, // ) //); $context = stream_context_create($contextOptions); $fp = stream_socket_client("ssl://{$host}:{$port}", $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT, $context);PHP Chinese website, a large number of free
PHPCMS tutorials, welcome to learn online!
The above is the detailed content of What to do if login fails in phpcms v9. For more information, please follow other related articles on the PHP Chinese website!