Strict Standards: Assigning the return value of new by reference is deprecated...

"Strict Standards: Assigning the return value of new by reference is deprecated..." I tried to setup wordpress version 2.3 in my computer where Apache webserver is also installed. However, the installation was throwing errors as shown below (refer images) .


The first image shows these errors when trying to install wordpress. Paths are intentionally edited.

Strict Standards: Assigning the return value of new by reference is deprecated in C:\..\..\wp-settings.php on line 271

Strict Standards: Assigning the return value of new by reference is deprecated in C:\..\..\\wp-settings.php on line 273

Strict Standards: Assigning the return value of new by reference is deprecated in C:\..\..\wp-settings.php on line 274

Strict Standards: Assigning the return value of new by reference is deprecated in C:\..\..\wp-settings.php on line 291

Warning: Cannot modify header information - headers already sent by (output started at C:\..\..\wp-settings.php:271) in C:\..\..\wp-admin\install.php on line 16



The second image shows these errors. Paths are intentionally edited.

Strict Standards: Assigning the return value of new by reference is deprecated in C:\..\..\wp-settings.php on line 271

Strict Standards: Assigning the return value of new by reference is deprecated in C:\..\..\wp-settings.php on line 273

Strict Standards: Assigning the return value of new by reference is deprecated in C:\..\..\wp-settings.php on line 274

Strict Standards: Assigning the return value of new by reference is deprecated in C:\..\..\wp-settings.php on line 291

Warning: Cannot modify header information - headers already sent by (output started at C:\..\..\wp-settings.php:271) in C:\..\..\wp-login.php on line 12

Warning: Cannot modify header information - headers already sent by (output started at C:\..\..\wp-settings.php:271) in C:\..\...\wp-login.php on line 24

Although the error is there I continued until the wordpress login screen. When I keyed in the username and pasword it denied access. I am testing my computer as a web host. The intention is to test php scripts and web pages before loading to a external webhost.

I am using the following versions:

  • Apache 2.2.4(win32)
  • PHP 5.2.4
  • Wordpress Version 2.3
  • MySQL Server version: 5.0.45-community-nt MySQL Community Edition (GPL)

The recommended requirements for Wordpress 2.3 are PHP version 4.2 or higher and MySQL version 4.0 or higher. This is not a problem compared to my installation. Coming back to the issue, I did a google search for available solution for the problem. I found an explaination posted regarding the issue, below is the explaination from the link shown below.

http://wordpress.org/support/topic/104918

"This is not a standards violation, it's a difference between versions of PHP.

Strict Standards: Assigning the return value of new by reference is deprecated...

What's going on here has to do with lines like these:

$variable = & new SomeObject();

In PHP4, the ampersand is necessary to get the variable and not a copy of it. In PHP5, this behavior is the default and the ampersand is not needed, thus generating that error message when Strict mode is enabled.

Since Wordpress is designed to work on PHP4 *and* PHP5, that ampersand is necessary to make it work on PHP4.

Therefore, you need to disable strict mode. Or, at least, disable reporting of E_STRICT. "

However the suggestion to "disable strict mode or disable reporting of E_STRICT." did not solve the problem.I retained my error_reporting setting in php.ini as shown below.

; - Show all errors except for notices and coding standards warnings
;
;error_reporting = E_ALL & ~E_NOTICE (original)
error_reporting = E_ALL E_NOTICE E_STRICT

Based on the explaination provided in the link "In PHP5, this behavior is the default and the ampersand is not needed." I edited wp-settings.php as shown below. I duplicated the variables and commented the original settings. Then I removed the ampersand sign from the copy of variables. Refer below for the changes I made in wp-settings.php.

//Original variables commented
//$wp_the_query =& new WP_Query();
//$wp_query =& $wp_the_query;
//$wp_rewrite =& new WP_Rewrite();
//$wp =& new WP();

//Copied variables and removed ampersand
$wp_the_query = new WP_Query();
$wp_query = $wp_the_query;
$wp_rewrite = new WP_Rewrite();
$wp = new WP();
.
.
//Original variable commented
//$wp_locale =& new WP_Locale();

//Copied variable and removed ampersand
$wp_locale = new WP_Locale();

It worked! I didn't get any errors. I fired the browser and keyed http://localhost/.../wp-admin/install.php and it brought up the screen shown below without any errors. It says Wordpress already installed.


So I typed http://localhost/../wp-login.php in the browser location and the login screen appeared without error messages.

I was able to login and the wordpress welcome screen was shown, see screenshot.

I hope this could help those are facing similar problem. This may or may not help everyone as the installation configuration may vary and I would advice getting professional help. This post only explains how I managed to solve the problem which I was facing. Good luck!

Work from home

Hello, welcome! You have reached another site trying to explain about work from home opportunity. Well, I am just another person like you seeking the same opportunity. I am not an expert in this area but I will share with you my experience of searching for work from home opportunity.

I recently signed up as a member with a site offering outsourced IT projects. The site offers various projects posted by "service buyers"(those offering projects) to "service providers"(those accepting projects). Membership is free however you can opt to be a paying member. A free service provider member is charged 10% of the project cost. If you are a member then no commision charge on successful bids, but a monthly fee is applicable. You need to bid for the projects and it's not neccessarily the lowest bidder is offered the job. To find more information you can visit this link or click on the banner displayed below.


Get custom programming done at GetAFreelancer.com!

There are many projects listed in system administration, data processing, web hosting, designing, writing and other categories. New projects are emailed to you and trust me you will receive alerts quite often. Proof of new projects posted into my e-mail shown below.

You can choose and bid for projects which fits your profile. I found the projects are mainly web related. So if you possess knowledge in MySql, Apache, PHP, Linux and some experience in designing website, image editing, creating logos and banners you can give it a try. The only hurdle is bidding! If you are good then the chances of securing more projects is huge. Give it a try, after all it's free membership (opt to be a paying member if you are satisfied) and experience work from home.

Free Paid Survey

Looking to make money with free paid surveys? I realise the opportunity for users not from US, UK, Canada and Australia are low. The list of survey companies opened for international users are limited, majority of them target US, UK and a few extend to Australia and Canada. I signed up with less than ten sites. Since joining, only one send a questionnaire. I am still waiting (a month now) for the rest of them to send me the questionnaires.

There are genuine surveysite which do pay cash, some gives points which can be redeemed after accumulating certain sum of points, some enlist you to sweepstakes (you got to be lucky to win!) and some award gift vouchers (I don't know if one can redeem it in their own country other than US, UK, Australia or Canada). If you are given points, then per point may fetch you US 0.05 cents and you need to collect 1000 or more points before redemption. Per survey may fetch you 50 - 100 points depending on the survey program. Imagine answering one survey per month which gives you 50 points and waiting to accumulate 1000 points. It will take more than a year before you can redeem! Do not dream of making it a full time job! You may join several sites but as mentioned earlier, chances for Asia members are limited. However you could join them to earn some extra income (at least to cover your internet surfing cost!).

Don't be discouraged. Join them for free and answer surveys. At least 2 to 5 surveys may earn you $10 - $25 per month. Even if you don't earn cash directly, you might be lucky to win sweepstakes which gives out cash or other items. Provide true information about yourself when joining. The sites which I have joined are not scams and they didn't spam.

A free international paid survey site which you may consider to join. The list will be updated.
There are some sites which claims to have a database of free surveysites for international prospects. You are required to pay a fee to join. I haven't tried them. Users from US have many free survey sites that they could be a member and they could make this as a full time job, especially for housewives.

Actually, I am considering other online opportunities instead of paid surveys. Surveys will remain an extra income option.