Home  >  Article  >  Backend Development  >  PHPCMS cannot log in or register

PHPCMS cannot log in or register

WBOY
WBOYOriginal
2016-08-08 09:32:041096browse

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
After searching, it was found that the fsockopen function and pfsockopen function have security issues and have been disabled by the server

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.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn