Assigning the return value of new by reference is deprecated


WordPress Deprecated: Assigning the return value of new by reference is deprecated /home/domainname/wordpress/wp-settings.php on line 512

when we have installed our wordpress we had old php version might be 4 or below php 5. as our server update php 4 to php 5 or more, this error start showing as our wordpress codes are php 4 compatible. so we have 2 options,

1, reinstall new fresh wordpress.

2. use below solution to avoid errors.

I think the better solution you can do the second one.


You need to edit two php files,


search this code

if (defined(’WP_DEBUG’) and WP_DEBUG == true) {
} else {
error_reporting(E_ALL ^ E_NOTICE ^ E_USER_NOTICE);

Replace with

if (defined(’WP_DEBUG’) and WP_DEBUG == true) {
} else {

now the second file


may sure keep a backup of these files before make any change, may be it can stop working your entire website

just add this code at top of this file


save the file and check the website the error will be done.

It’s worked for me 🙂


HTTP Error occurred during the API request


Here we explaning how you can fixed the ” error An Unexpected HTTP Error occurred during the API request ” in the wordpress websites.

An Unexpected HTTP Error occurred during the API request.

It’s very simple just for begin go to the Installed Plugins in your admin page and delete the SexyBookmarks if you installed it.

1 – go to the FTP for your website

2 – go to the wp-includes directory and open the class-http.php go to the line number 86 find number 5 Increase to 60. ’timeout’ => apply_filters( ‘http_request_timeout’, 60),

3 – go to the wp-admin/includes/plugin-install.php go to the line number 44 find the number 15 Increase to 60. $request = wp_remote_post(‘’, array( ‘timeout’ => 60, ‘body’ => array(‘action’ => $action, ‘request’ => serialize($args))) );

Please wait for some seconds and click retry again or refresh the page.

Upgrade WordPress with out prompting FTP login in Cpanel


In cpanel server WordPress upgrades will get you to permission issues most of the time. The easy solution is to configure wordpress with FTP login credentials. To get this done add following lines to wp-config.php file – assumed that WordPress installed under wordpress directory in public_html

define(‘FS_METHOD’, ‘ftpext’);
define(‘FTP_BASE’, ‘/public_html/wordpress/’);
define(‘FTP_CONTENT_DIR’, ‘/public_html/wordpress/wp-content/’);
define(‘FTP_PLUGIN_DIR ‘, ‘/public_html/wordpress/wp-content/plugins/’);
define(‘FTP_PUBKEY’, ‘/home/username/.ssh/’);
define(‘FTP_PRIKEY’, ‘/home/username/.ssh/id_rsa’);
define(‘FTP_USER’, ‘username’);
define(‘FTP_PASS’, ‘password’);
define(‘FTP_HOST’, ‘localhost’);
define(‘FTP_SSL’, false);

Where “username” is your cpanel account name and “password” is cpanel account password. Adding these lines will keep you away from prompting FTP username and password when you try upgrade.