Home > Article > Backend Development > PHPCMS cannot log in or register
Environment:
Operating system: Linux
Server software: nginx/1.1.16PHP/5.3.27
MySQL version: 5.5.34-log
PHPCMS program version: Phpcms V9.5.7 Release 20140625
Problem:
Local: Everything is normal in local debugging
On the server: PHPSSO communication in PHPCMS is successful, account registration and login cannot be performed, and through the tracking code, it is found that the $fp returned in the code below is empty
$fp = @fsockopen(($ip ? $ip : $host), $port, $errno, $errstr, $timeout);fsockopen function Replaced with the pfsockopen function, the return value is still empty
Security notification announcement website: http://www.xrnet.cn/store/2012 -01-10.html
Solution:
Replace the fsockopen and pfsockopen functions with other functions, such as stream_socket_client
Examples are as follows
Before modification:
$fp = fsockopen($host, 80, $errno, $errstr, 30);or
$fp = fsockopen($host, $port, $errno, $errstr, $connection_timeout);After modification:
$fp = stream_socket_client("tcp://".$host."80", $errno, $errstr, 30);or
$fp = stream_socket_client("tcp://".$host.":".$port, $errno, $errstr, $connection_timeout);
Comments : DISCUZ communication failure may also be due to this reason!
The above introduces the inability to log in and register with PHPCMS, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.