Home> CMS Tutorial> PHPCMS> body text

How to solve the problem that PHPCMS does not support the fsockopen function?

Guanhui
Release: 2020-07-20 13:39:03
Original
2157 people have browsed it

How to solve the problem that PHPCMS does not support the fsockopen function?

#PHPCMS does not support the fsockopen function. How to solve the problem?

1. When installing, directly change "step=3" in the address bar and skip this step;

2. Replace the fsockopen function with the pfsockopen function;

3. Modify the code in "client.class.php".

PHP fsockopen function description

Syntax:

resource fsockopen ( string $hostname [, int KaTeX parse error: Expected 'EOF', got '&' at position 20: … = -1 [, int &̲errno [, string &$errstr [, float $timeout = ini_get(“default_socket_timeout”) ]]]] )
Copy after login

Enable PHP fsockopen function

PHP fsockopen requires the allow_url_fopen option in PHP.ini to be turned on.

allow_url_fopen = On
Copy after login

Parameters:

  • hostname If OpenSSL is installed, you may want to add the access protocol ssl:// or tls:/ in front of your hostname address. /, so that you can use the SSL or TLS client based on the TCP/IP protocol to connect to the remote host.

  • port port number. If -1 is passed to this parameter, it means that the port is not used, such as unix://.

  • errno If the return value of errno is 0, and the return value of this function is FALSE, then this indicates that the error occurred before the socket connection (connect()) call, resulting in The most likely reason for the connection failure is that an error occurred when initializing the socket.

  • errstr The error message will be returned as a string.

  • timeout Set the time limit for the connection, in seconds.

Return value:

fsockopen() will return a file handle, which can later be called by other file class functions (for example: fgets(), fgetss(), fwrite () , fclose() and feof() ). If the call fails, FALSE will be returned.

Recommended tutorials: "PHP" "PHPCMS Tutorial"

The above is the detailed content of How to solve the problem that PHPCMS does not support the fsockopen function?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!