Two days ago, because of too many spam comments, Akismet was opened. When Akismet was enabled, it was found that the effect was good, and I didn't take a look At Akismet settings too carefully, click here today to check that the connection status of the Akismet server shows that the network function is disabled.
650) this. width = 650; "title =" akismet [[[[[[" src = "http://www.bkjia.com/uploads/allimg/131228/051Q14B7-0.png" alt = "135153879.png"/>
Server connection status
The network function is disabled.
Your host seems to have disabled PHP's fsockopen or gethostbynamel function. Before the problem is fixed, Akismet cannot work. Contact your host service administrator or firewall administrator and provide them with Akismet running environment requirements.
By checking that the phpinfo () method is run in the space, it is found that the fsockopen method is indeed disabled on the VM. What should I do.
Check that the php. ini file under the root directory of the VM is not the wwwroot directory. open the file and find allow_url_fopen.
allow_url_fopen = On
This is correct. This line of configuration allows access to network files. If it is Off, change it to On
Find disable_functions and find
disable_functions = fsockopen
Okay. Find the problem. The fsockopen method is disabled in this line of configuration. delete or comment out this line of code. Annotation method. Add ";" at the beginning of the line)
After the configuration is modified, check the Akismet configuration again, and the network connection is normal.
If you cannot modify the php. ini file or the modification is invalid, refer to the following methods.
1. If only fsockopen is disabled and the pfsockopen method is not disabled, you can change all the places that use the fsockopen method to pfsockopen. If it is called by a plug-in, you can only modify the code of the plug-in.
2. If the server also disables pfsockopen, you can use the stream_socket_client method instead. However, the parameters of stream_socket_client and fsockopen are different.
Specific Operation: Search for the character string fsockopen in the Program (replace it with stream_socket_client (, and then delete the port parameter "80" in the original fsockopen function and add it to $ host. Example:
Before modification:
$fp = fsockopen($host, 80, $errno, $errstr, 30);
After modification
$fp = stream_socket_client($host."80", $errno, $errstr, 30);
3. If you are very unfortunate that both the fsockopen and pfsockopen methods are disabled, and if your php version is earlier than 5.0, there is no stream_socket_client method, You have to manually write one.
Reference code:
function b_fsockopen($host, $port, &$errno, &$errstr, $timeout) { $ip = gethostbyname($host); $s = socket_create(AF_INET, SOCK_STREAM, 0); if (socket_set_nonblock($s)) { $r = @socket_connect($s, $ip, $port); if ($r || socket_last_error() == EINPROGRESS) { $errno = EINPROGRESS; return $s; } } $errno = socket_last_error($s); $errstr = socket_strerror($errno); socket_close($s); return false;}
Specific operations:
1. First find the code segment that uses the fsockopen function, add the code above to its top, and search for the string fsockopen in the code segment (replace it with B _fsockopen (.
2. because the fsockopen function returns the file pointer, it can be operated by the file function, but this B _fsockopen function does not return the file pointer. You need to modify the code segment: Use socket_read (replace fread (, use socket_write (replace fwrite (and use socket_close (replace fclose (.
This article from "Uncle monkey blog" blog, please be sure to keep this source http://glitter.blog.51cto.com/7943065/1299145