Assigning the return value of new by reference is deprecated

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
meritweb
Regular
Posts: 43
Joined: Fri Jan 25, 2008 4:40 am

Assigning the return value of new by reference is deprecated

Post by meritweb » Sun Aug 05, 2012 6:29 pm

Can anyone help me with this error I am receiving? Our blog site is located at: http://www.meritsolutions.com/meritmatters/

Deprecated: Assigning the return value of new by reference is deprecated in /home/meritweb/public_html/meritmatters/include/plugin_api.inc.php on line 558
Query failed:
SELECT


e.id,
e.title,
e.timestamp,
e.comments,
e.exflag,
e.authorid,
e.trackbacks,
e.isdraft,
e.allow_comments,
e.last_modified,

a.realname AS author,
a.username AS loginname,
a.email
, e.body, e.extended

FROM
serendipity_entries AS e
LEFT JOIN serendipity_authors a
ON e.authorid = a.authorid
LEFT JOIN serendipity_entrycat ec
ON e.id = ec.entryid
LEFT JOIN serendipity_category c
ON ec.categoryid = c.categoryid
LEFT JOIN serendipity_authorgroups AS acl_a
ON acl_a.authorid = 0
LEFT JOIN serendipity_access AS acl_acc
ON ( acl_acc.artifact_mode = 'read'
AND acl_acc.artifact_type = 'category'
AND acl_acc.artifact_id = c.categoryid
)
WHERE isdraft = 'false' AND e.timestamp <= 1344185700 AND (
c.categoryid IS NULL
OR ( acl_acc.groupid = 0)
OR ( acl_acc.artifact_id IS NULL

)
)
GROUP BY e.id
ORDER BY timestamp DESC
LIMIT 15
/ Table 'meritweb_ser1.serendipity_entries' doesn't exist

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Assigning the return value of new by reference is deprec

Post by Timbalu » Sun Aug 05, 2012 9:39 pm

That looks like 2 Problems in one...

The first is due to your PHP version and is just a deprecation warning.
You can try to finetune the error reporting variable in serendipity_config.inc.php like this

Code: Select all

    error_reporting(E_ALL & ~E_NOTICE ^ E_DEPRECATED);
around ~line 54

the second is possibly ...
garvinhicking wrote:The error means that no database table 'serendipity_entries' exists. Seems your installation actually failed or you manually droped/removed DB tables...

You should delete the serendipity_config_local.inc.php file, retry the installation and watch out for error messages why the DB table might not get created.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

meritweb
Regular
Posts: 43
Joined: Fri Jan 25, 2008 4:40 am

Re: Assigning the return value of new by reference is deprec

Post by meritweb » Sun Aug 05, 2012 10:09 pm

Thanks for the response Timbalu. What is the cause of this?

Our blog has been online for years - we did not just try to install / update. Everything was working fine on Friday when I left work. I'm the only one who has access to the blog - and I have not made any changes over the weekend. So what caused everything to shut down?

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Assigning the return value of new by reference is deprec

Post by Timbalu » Mon Aug 06, 2012 8:50 am

Well, its not really a matter of Serendipity, so ask your Provider. Possibly they have made some upgrades to PHP and MySql (or whatever StorageEngine you use) and the later went wrong somehow... or has been moved to another place... or the table is not gone and this error appears while missing the correct access permission.
That is why your table does not exist or isn't reachable.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

meritweb
Regular
Posts: 43
Joined: Fri Jan 25, 2008 4:40 am

Re: Assigning the return value of new by reference is deprec

Post by meritweb » Mon Aug 06, 2012 2:31 pm

Thanks again Ian. So I made the code change to line 54, and it seems to have removed the first error. Now I just see the error below.

Can you help me understand what I need to do next? I'm not a pro at this, and I don't want to lose everything we have.

So I delete the serendipity_config_local.inc.php file, and then what? Do I have to go to the Serendipity site and re-download and install the whole thing again? If so, will I lose all of my articles already created?

Is there any way I can go in and save / backup all of our articles? I can't login to our blog admin panel - so wondering what I need to do. Any way you can break this down for me step by step.

Thanks again,

Code: Select all

Query failed: 
SELECT 
                    

                    e.id,
                    e.title,
                    e.timestamp,
                    e.comments,
                    e.exflag,
                    e.authorid,
                    e.trackbacks,
                    e.isdraft,
                    e.allow_comments,
                    e.last_modified,

                    a.realname AS author,
                    a.username AS loginname,
                    a.email
                     , e.body, e.extended
                     
                FROM
                    serendipity_entries AS e
                    LEFT JOIN serendipity_authors a
                        ON e.authorid = a.authorid
                    LEFT JOIN serendipity_entrycat ec
                        ON e.id = ec.entryid
                    LEFT JOIN serendipity_category c
                        ON ec.categoryid = c.categoryid
                     LEFT JOIN serendipity_authorgroups AS acl_a
                                   ON acl_a.authorid = 0
                            LEFT JOIN serendipity_access AS acl_acc
                                   ON (    acl_acc.artifact_mode = 'read'
                                       AND acl_acc.artifact_type = 'category'
                                       AND acl_acc.artifact_id   = c.categoryid
                                      )
                    WHERE isdraft = 'false' AND e.timestamp <= 1344257700 AND     (
                                 c.categoryid IS NULL
                                 OR ( acl_acc.groupid = 0)
                                 OR ( acl_acc.artifact_id IS NULL
                                      
                                    )
                               )
                     GROUP BY e.id
            ORDER BY timestamp DESC
                      LIMIT 15
/ Table 'meritweb_ser1.serendipity_entries' doesn't exist

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Assigning the return value of new by reference is deprec

Post by Timbalu » Mon Aug 06, 2012 3:50 pm

As far I understood, you did not touch or upgrade Serendipity yourself...

So IMHO this must be something you hoster did to your database..., or the server had a bad dream... ;-)

But before going the hard way deleting the serendipty_config_local.inc.php, backup that file or copy its settings to be sure to remember...
Before going ahead, ask your hoster what they have done to the server on friday...! That may answer some further questions (the logs also might provide some infos).
Then check first, if you have access to your db otherwise. Use PhpMyAdmin or the tool your hoster provided to access it.

- Is it still the 'meritweb_ser1' database and do you have the rights to access it properly? (Try with that query manually - PhpMyAdmin also has a repair table option) If not, ask your Provider to get you on the way.

- If everything is fine and your serendipity_entries table and all others exist, check your serendipty_config_local.inc.php file, if it has the same settings to access the db.

- Does that file have correct read/write permissions (chmod 0775 or even 0777)?

Maybe one of these steps already solves that issue.

Deleting the serendipty_config_local.inc.php file does not automatically mean upgrading by re-download, it just tells serendipity to run through the update/upgrade process again, check permissions etc.. If the database tables exist, they normally do not get rewritten or destroyed, if you use you old working access settings. In case you want to get sure about that, run a backup with PhpMyAdmin first (which is always a good idea).

Btw, we are talking about which Serendipity version?
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

meritweb
Regular
Posts: 43
Joined: Fri Jan 25, 2008 4:40 am

Re: Assigning the return value of new by reference is deprec

Post by meritweb » Mon Aug 06, 2012 9:49 pm

Ian - You were right - the problem was resolved by our hosting partner. Thanks again for your help!!

Josh

meritweb
Regular
Posts: 43
Joined: Fri Jan 25, 2008 4:40 am

Re: Assigning the return value of new by reference is deprec

Post by meritweb » Mon Aug 06, 2012 10:17 pm

OK, I thought everything was resolved. While I can access our blog posts now, I can't access our admin section to create posts, etc...

When I bring up our admin login page, I receive the following error:
Warning: Cannot modify header information - headers already sent by (output started at /home/meritweb/public_html/meritmatters/serendipity_config.inc.php:1) in /home/meritweb/public_html/meritmatters/serendipity_admin.php on line 11
When I login to the homepage, I receive the following error messages:
Warning: Cannot modify header information - headers already sent by (output started at /home/meritweb/public_html/meritmatters/serendipity_config.inc.php:1) in /home/meritweb/public_html/meritmatters/include/functions_config.inc.php on line 567

Warning: Cannot modify header information - headers already sent by (output started at /home/meritweb/public_html/meritmatters/serendipity_config.inc.php:1) in /home/meritweb/public_html/meritmatters/include/functions_config.inc.php on line 584

Warning: Cannot modify header information - headers already sent by (output started at /home/meritweb/public_html/meritmatters/serendipity_config.inc.php:1) in /home/meritweb/public_html/meritmatters/include/functions_config.inc.php on line 584

Warning: Cannot modify header information - headers already sent by (output started at /home/meritweb/public_html/meritmatters/serendipity_config.inc.php:1) in /home/meritweb/public_html/meritmatters/include/functions_config.inc.php on line 567

Warning: Cannot modify header information - headers already sent by (output started at /home/meritweb/public_html/meritmatters/serendipity_config.inc.php:1) in /home/meritweb/public_html/meritmatters/plugins/serendipity_plugin_adduser/serendipity_event_adduser.php on line 159

Warning: Cannot modify header information - headers already sent by (output started at /home/meritweb/public_html/meritmatters/serendipity_config.inc.php:1) in /home/meritweb/public_html/meritmatters/serendipity_admin.php on line 11
Then when I click a link like "New Post", "Edit Posts", etc... I get taken back to the login page again.

Is this another hosting problem, or something I can fix on my own?

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Assigning the return value of new by reference is deprec

Post by Timbalu » Tue Aug 07, 2012 10:23 am

That looks like you placed some whitespace or line break before the starting <?php in serendipity_config.inc.php, when you edited that file... That is not allowed.

The better way to solve that issue, is to upgrade to the latest Serendipity version, which will bring along a lot of improvements, fixes, etc.

:-I
I really never understand why people stick with such old versions for decades...
Software (and yes, even Serendipity ;-)) is never perfect, so updating is a principal duty.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

Post Reply