Home > Backend Development > PHP Tutorial > fsockopen The pfsockopen function is disabled and SMTP does not send emails properly. Solution_php tips

fsockopen The pfsockopen function is disabled and SMTP does not send emails properly. Solution_php tips

WBOY
Release: 2016-05-16 20:07:47
Original
1133 people have browsed it

1: Recently, hackers used fsockopen to carry out PHPDDOS attacks after exploiting program vulnerability injection, causing instability on some servers. Now the dangerous function fsockopen is temporarily disabled. Some program functions may have problems. The following lists the known problems and general solutions:

General solution:
Find the fsockopen function in the program and replace it with: pfsockopen to solve all problems. The difference between the two functions is that pfsockopen remains keep-alive, making it impossible for hackers to carry out connection number attacks.
The path of the program file that uses the fsockopen function is known (add p before fsockopen, that is, change fsockopen to pfsockopen)

Two: The server has disabled fsockopen and pfsockopen at the same time, then use other functions instead, such as stream_socket_client(). Note: The parameters of stream_socket_client() and fsockopen() are different.
Specific operations:
Search the string fsockopen( in the program and replace it with stream_socket_client(. Then, delete the port parameter "80" in the original fsockopen function and add it to $host.
An example is as follows

Before modification:

$fp = fsockopen($host, 80, $errno, $errstr, 30);

After modification:

$fp = stream_socket_client($host."80", $errno, $errstr, 30);
List of files in the website system of domestic mainstream PHP websites involving the fsockopen function:
List of files in the website system of domestic mainstream PHP websites involving the fsockopen function:

DEDECMS:

Copy code The code is as follows:

sourcefunctionfunction_core.php This file has 2 fsockopen and the other is pfsockopen, please pay attention to the distinction
uc_clientclient.php This file has 2 fsockopen and the other is pfsockopen, please pay attention to the distinction
uc_clientlibsendmail.inc.php
This file uc_clientmodelmisc.php has 2 fsockopens and the other is pfsockopen. Please pay attention to the distinction
This file uc_serverinstallfunc.inc.php has 2 fsockopens and the other is pfsockopen. Please pay attention to the distinction
uc_serverlibsendmail.inc.php
The file uc_servermodelmisc.php has 2 fsockopens and the other is pfsockopen. Please pay attention to the distinction

Discuz! 2.5:

Copy code The code is as follows:

sourcefunctionfunction_core.php This file has 2 fsockopen and the other is pfsockopen, please pay attention to the distinction
uc_clientclient.php This file has 2 fsockopen and the other is pfsockopen, please pay attention to the distinction
uc_clientlibsendmail.inc.php
This file uc_clientmodelmisc.php has 2 fsockopens and the other is pfsockopen. Please pay attention to the distinction
This file uc_serverinstallfunc.inc.php has 2 fsockopens and the other is pfsockopen. Please pay attention to the distinction
uc_serverlibsendmail.inc.php
The file uc_servermodelmisc.php has 2 fsockopens and the other is pfsockopen. Please pay attention to the distinction

ecms (Empire):

eclassclass.smtp.php

ECSHOP:

Copy code The code is as follows:

adminindex.php
demoincludeslib_updater.php
includescls_smtp.php
includescls_transport.php
includeslib_base.php
includesmodulespaymentpaypal.php


shopex:

Copy code The code is as follows:

coreapiincludeapi_utility.php
coreapitools1.0api_b2b_1_0_tools.php
corefunc_ext.php
corelibnusoap.php
corelibuc_clientclient.php
instalsvinfo.php
pluginspassportpassport.ucenter.php
pluginspaymentpay.nochek.php
pluginspay.paypal.php
pluginspay.paypal.server.php
pluginspay.paypal_cn.php
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template