Apr 29

Message:

PHP Warning: Parameter 1 to stats_admin_bar_menu() expected to be a reference, value given

Error type: warning

Symptoms:

A warning is displayed even though the function call seems to have the correct number of parameters.

Sample Code:

<?php
function stats_admin_bar_menu( &$wp_admin_bar ) {
// …
}
call_user_func_array(‘stats_admin_bar_menu’, 1);
?>

Cause:

When a function that has one of the parameters defined as a reference is called with constants, this warning is issued.

Fix:

Check where parameters are defined as reference and pay attention on what parameters are sent at the function call. If a parameter is defined as a reference, it must receive a variable and not a constant.

Apr 29

Message:

PHP Warning: fsockopen(): unable to connect to domain.com:80 (Operation now in progress) in /home/user/public_html/browser.php on line 724

Error type: warning

Symptoms:

When you try to open a socket (for example load a file from an external server), you just receive a warning.

Cause:

The destination is unreachable.

Fix:

Re-establish the connection between the two servers. Most likely the location you are trying to connect to has a period of downtime.

Apr 29

Messages:

Database error: MySQL server has gone away
Database error: Query execution was interrupted
Database error: Lost connection to MySQL server during query

Error type: error

Symptoms:

The query that is executed on a MySQL database returns this error instead of the expected result.

Cause:

The MySQL server connection has been interrupted – either the TCP connection has timed out or the MySQL server has stopped.

Fix:

Check if the connection between the current server and the MySQL server is active.

Restart MySQL: /etc/init.d/mysql restart