Home  >  Article  >  CMS Tutorial  >  What to do if phpcms v9 communication fails

What to do if phpcms v9 communication fails

藏色散人
藏色散人Original
2020-01-07 10:47:193199browse

What to do if phpcms v9 communication fails

What should I do if phpcms v9 communication fails? What should I do if Phpcms v9 fails to communicate with Phpsso and members cannot register or log in?

A friend said this:

The other configurations of the server are correct, but the communication always fails. The reason has been found:

Since servers with firewalls usually use port mapping, this leads to external network The website can be accessed normally through the domain name, but the website cannot be accessed through the domain name on the intranet. The communication interface address between v9 and phpsso is linked through the domain name, which always leads to communication failure. This is a flaw of v9 itself, and the developers did not fully consider this.

Hope the official fix this BUG as soon as possible.

Some friends also said:

There is no such file in the phpsso_server file in the official downloaded installation package. So the solution is to copy it from the phpcms/libs/classes/ folder of v9, and then create a sessions directory under the phpsso_server/caches/ file, otherwise the file cannot be written.

Of course, there is also a method on the Internet, which is to put the 21st line statement session_start(); in the session_mysql.class.php file before the previous sentence. In this case, it can also be solved, but v9 will not use the database. The storage method will only use file storage, and the storage location of the session is not stored according to the location set in system.php. It will be saved in the directory set in the php.ini file.

Provide a solution:

Change line 361 of phpcms\modules\member\classes\client.class.php

$fp = @fsockopen(($ip ? $ip : $host), $port, $errno, $errstr, $timeout);

to

$fp = stream_socket_client("tcp://".($ip ? $ip : $host).":".$port, $errno, $errstr, $timeout);

after After testing, you can log in successfully.

Many friends have encountered this problem, but under Linux Apache, this problem is relatively rare.

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 phpcms v9 communication fails. For more information, please follow other related articles on the PHP Chinese website!

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