New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2: Class __PHP_Incomplete_Class has no unserializer in /srdb/srdb.class.php on line 735 #176

Open
damiencarbery opened this Issue Sep 9, 2016 · 33 comments

Comments

Projects
None yet
@damiencarbery

damiencarbery commented Sep 9, 2016

Using version 3.1 on PHP 5.5.38.
When I run dry or live run it reports:
2: Class __PHP_Incomplete_Class has no unserializer in /srdb/srdb.class.php on line 735

This line is in recursive_unserialize_replace() function.

As far as I can tell the changes are still correctly made.

I am happy to help debug this issue.

@mbiebusch

This comment has been minimized.

Show comment
Hide comment
@mbiebusch

mbiebusch Sep 13, 2016

I had the same problem running PHP as a FPM application with Apache. Changing the version of PHP did not work out for me (tried 5.5 and 5.6). Switching to FPM with nginx (coincidentally both are installed on my server) and PHP 5.6 solved the problem. Maybe switching to FastCGI might work, too.

mbiebusch commented Sep 13, 2016

I had the same problem running PHP as a FPM application with Apache. Changing the version of PHP did not work out for me (tried 5.5 and 5.6). Switching to FPM with nginx (coincidentally both are installed on my server) and PHP 5.6 solved the problem. Maybe switching to FastCGI might work, too.

@Luckyfella73

This comment has been minimized.

Show comment
Hide comment
@Luckyfella73

Luckyfella73 Sep 28, 2016

@damiencarbery

this issue has already been discussed here:
#165

I guess you tried to replace a Wordpress DB and have yoast seo plugin installed?
I had the same problem and was able to solve it by disabling xml sitemaps in yoast options in the WP backend. Export your database after disabling and try again.

Luckyfella73 commented Sep 28, 2016

@damiencarbery

this issue has already been discussed here:
#165

I guess you tried to replace a Wordpress DB and have yoast seo plugin installed?
I had the same problem and was able to solve it by disabling xml sitemaps in yoast options in the WP backend. Export your database after disabling and try again.

@celorodovalho

This comment has been minimized.

Show comment
Hide comment
@celorodovalho

celorodovalho Oct 6, 2016

I have the same problem!

celorodovalho commented Oct 6, 2016

I have the same problem!

@fadupla

This comment has been minimized.

Show comment
Hide comment
@fadupla

fadupla Mar 21, 2017

@Luckyfella73 thank you very much ! It worked like a charm !

fadupla commented Mar 21, 2017

@Luckyfella73 thank you very much ! It worked like a charm !

@khejduk

This comment has been minimized.

Show comment
Hide comment
@khejduk

khejduk Apr 13, 2017

I have this issue, but I do not have Yoast installed.

khejduk commented Apr 13, 2017

I have this issue, but I do not have Yoast installed.

@devrap

This comment has been minimized.

Show comment
Hide comment
@devrap

devrap Jul 19, 2017

I have this issue even after disabling Yoast site indexing and the entire Yoast plugin.

devrap commented Jul 19, 2017

I have this issue even after disabling Yoast site indexing and the entire Yoast plugin.

@zoot

This comment has been minimized.

Show comment
Hide comment
@zoot

zoot Aug 9, 2017

Similar scenario here. Even when excluding the Yoast tables, the above error is thrown. If only there was a clearer reason for the issue, to lead one towards an obvious solution, rather than suggested workarounds which make no sense.

zoot commented Aug 9, 2017

Similar scenario here. Even when excluding the Yoast tables, the above error is thrown. If only there was a clearer reason for the issue, to lead one towards an obvious solution, rather than suggested workarounds which make no sense.

@dhaupin

This comment has been minimized.

Show comment
Hide comment
@dhaupin

dhaupin Dec 20, 2017

The error is not in the Yoast tables, its in the wp_options table or anywhere else the WPSEO_Sitemap_Cache_Data serialization occurs. Do a search for that and it should show handfuls of rows.

So, first goto Yoast XML Sitemap setting, and totally disable them. This should wipe out those caches. Try running the find replace DRY RUN again and the errors should disappear. If it works, don't forget to re-eable Yoast sitemaps.

Additionally, when doing F&R don't forget that these rows use escaped serialization, ie https:\/\/example.com. Have fun!

dhaupin commented Dec 20, 2017

The error is not in the Yoast tables, its in the wp_options table or anywhere else the WPSEO_Sitemap_Cache_Data serialization occurs. Do a search for that and it should show handfuls of rows.

So, first goto Yoast XML Sitemap setting, and totally disable them. This should wipe out those caches. Try running the find replace DRY RUN again and the errors should disappear. If it works, don't forget to re-eable Yoast sitemaps.

Additionally, when doing F&R don't forget that these rows use escaped serialization, ie https:\/\/example.com. Have fun!

@Mte90

This comment has been minimized.

Show comment
Hide comment
@Mte90

Mte90 Apr 12, 2018

Any updates for this one?

Mte90 commented Apr 12, 2018

Any updates for this one?

@buckmanhands

This comment has been minimized.

Show comment
Hide comment
@buckmanhands

buckmanhands Apr 22, 2018

Thanks @dhaupin - this works exactly as you describe it if you have the Yoast!

buckmanhands commented Apr 22, 2018

Thanks @dhaupin - this works exactly as you describe it if you have the Yoast!

@jhume

This comment has been minimized.

Show comment
Hide comment
@jhume

jhume Apr 27, 2018

I had this problem on a Drupal 8 database and resolved it by omitting the following tables:

  • All tables beginning with cache
  • router
  • key_value

Also note that if you proceed to a live run without omitting those tables it wrecks the serialised data in those tables and your site will break.

jhume commented Apr 27, 2018

I had this problem on a Drupal 8 database and resolved it by omitting the following tables:

  • All tables beginning with cache
  • router
  • key_value

Also note that if you proceed to a live run without omitting those tables it wrecks the serialised data in those tables and your site will break.

@Franz333

This comment has been minimized.

Show comment
Hide comment
@Franz333

Franz333 Jun 27, 2018

Hello guys,

I also have that problem with 2: Class __PHP_Incomplete_Class has no unserializer

I have deactivated the Yoast XML Sitemap but it doesn't help.

In some articles people speak about default settings of yoast but there is no button "Restore to default"..

I don't want to risk running the script with that error..

Anyone found a solution ever since?

Thanks a lot

Franz333 commented Jun 27, 2018

Hello guys,

I also have that problem with 2: Class __PHP_Incomplete_Class has no unserializer

I have deactivated the Yoast XML Sitemap but it doesn't help.

In some articles people speak about default settings of yoast but there is no button "Restore to default"..

I don't want to risk running the script with that error..

Anyone found a solution ever since?

Thanks a lot

@Luckyfella73

This comment has been minimized.

Show comment
Hide comment
@Luckyfella73

Luckyfella73 Jun 28, 2018

@Franz333 Are you sure you saved the Yoast settings after disabling XML sitemap and did a new DB dump after that? Beeing in a hurry it happens to skip one of the steps - happened to me once at least ;)

Luckyfella73 commented Jun 28, 2018

@Franz333 Are you sure you saved the Yoast settings after disabling XML sitemap and did a new DB dump after that? Beeing in a hurry it happens to skip one of the steps - happened to me once at least ;)

@fadupla

This comment has been minimized.

Show comment
Hide comment
@fadupla

fadupla Jun 28, 2018

Hello @Franz333
Even if you don't select the yoast tables with a dry test you have this error ?

fadupla commented Jun 28, 2018

Hello @Franz333
Even if you don't select the yoast tables with a dry test you have this error ?

@Franz333

This comment has been minimized.

Show comment
Hide comment
@Franz333

Franz333 Jun 28, 2018

@Luckyfella73 Yes I made sure I saved the settings and I also made a DB back up (which I don't understand why it matters by the way).. :-)

Franz333 commented Jun 28, 2018

@Luckyfella73 Yes I made sure I saved the settings and I also made a DB back up (which I don't understand why it matters by the way).. :-)

@Franz333

This comment has been minimized.

Show comment
Hide comment
@Franz333

Franz333 Jun 28, 2018

@fadupla Yes even with ignoring the yoast tables.. :-(

Franz333 commented Jun 28, 2018

@fadupla Yes even with ignoring the yoast tables.. :-(

@Luckyfella73

This comment has been minimized.

Show comment
Hide comment
@Luckyfella73

Luckyfella73 Jun 28, 2018

@Franz333

I also made a DB back up (which I don't understand why it matters by the way).. :-)

I said that because I use to duplicate the whole DB and do the replacement on that (duplicated) database. Mostly it's that I replace local URLs with productive URLs and I don't want to rewrite them again to the local version when continuing development. But of cause you might have a different workflow or the task you need to do is just different =)

Hope you gonna find the issue soon

Luckyfella73 commented Jun 28, 2018

@Franz333

I also made a DB back up (which I don't understand why it matters by the way).. :-)

I said that because I use to duplicate the whole DB and do the replacement on that (duplicated) database. Mostly it's that I replace local URLs with productive URLs and I don't want to rewrite them again to the local version when continuing development. But of cause you might have a different workflow or the task you need to do is just different =)

Hope you gonna find the issue soon

@fadupla

This comment has been minimized.

Show comment
Hide comment
@fadupla

fadupla Jun 29, 2018

@Franz333 Ok
Pretty boring debug but you should find the table (and therefor the plugin) that causes your issue by lanching a dry run table by table (or by dichotomy). Good luck

fadupla commented Jun 29, 2018

@Franz333 Ok
Pretty boring debug but you should find the table (and therefor the plugin) that causes your issue by lanching a dry run table by table (or by dichotomy). Good luck

@Franz333

This comment has been minimized.

Show comment
Hide comment
@Franz333

Franz333 Jun 29, 2018

@Luckyfella73 Oh I see.. If I understood well you run the script onto your local version first to see if everything goes well and then upload your new DB with replaced URL onto the online version?

Franz333 commented Jun 29, 2018

@Luckyfella73 Oh I see.. If I understood well you run the script onto your local version first to see if everything goes well and then upload your new DB with replaced URL onto the online version?

@Franz333

This comment has been minimized.

Show comment
Hide comment
@Franz333

Franz333 Jun 29, 2018

@fadupla the worst is that I actually checked what modifications would be done by the script and yoast was part of it.. I don't understand really.. does my head in :-(

Franz333 commented Jun 29, 2018

@fadupla the worst is that I actually checked what modifications would be done by the script and yoast was part of it.. I don't understand really.. does my head in :-(

@fadupla

This comment has been minimized.

Show comment
Hide comment
@fadupla

fadupla Jun 29, 2018

@Franz333 quelle que soit la table que tu sélectionnes tu as l'erreur Class __PHP_Incomplete_Class has no unserializer en dry run ?

fadupla commented Jun 29, 2018

@Franz333 quelle que soit la table que tu sélectionnes tu as l'erreur Class __PHP_Incomplete_Class has no unserializer en dry run ?

@Franz333

This comment has been minimized.

Show comment
Hide comment
@Franz333

Franz333 Jun 29, 2018

@fadupla comment as tu deviné que j'étais francophone? :-)
j'ai fait un test dry run en prenant bien soin de ne pas sélectionner les tables Yoast.. et l'erreur est quand même survenue.. en allant vérifier quels changements seraient effectués par le script, j'ai vu que yoast serait quand même concerné.. c'est vraiment bizarre

Franz333 commented Jun 29, 2018

@fadupla comment as tu deviné que j'étais francophone? :-)
j'ai fait un test dry run en prenant bien soin de ne pas sélectionner les tables Yoast.. et l'erreur est quand même survenue.. en allant vérifier quels changements seraient effectués par le script, j'ai vu que yoast serait quand même concerné.. c'est vraiment bizarre

@takotakot

This comment has been minimized.

Show comment
Hide comment
@takotakot

takotakot Aug 24, 2018

Sorry for multi posting.

I think that "PHP does not know SOME_CLASS" caused this problem.

If you are using WPSEO that is from: WPSEO_Sitemap_Cache_Data.

Add

require_once '../wp-content/plugins/wordpress-seo/inc/sitemaps/interface-sitemap-cache-data.php';
require_once '../wp-content/plugins/wordpress-seo/inc/sitemaps/class-sitemap-cache-data.php';

to srdb.class.php works well.

So, please try:

  1. use dry run and check class name (like WPSEO_Sitemap_Cache_Data in Yoast/wordpress-seo#4571 (comment))
  2. require classes and reload
  3. run again

takotakot commented Aug 24, 2018

Sorry for multi posting.

I think that "PHP does not know SOME_CLASS" caused this problem.

If you are using WPSEO that is from: WPSEO_Sitemap_Cache_Data.

Add

require_once '../wp-content/plugins/wordpress-seo/inc/sitemaps/interface-sitemap-cache-data.php';
require_once '../wp-content/plugins/wordpress-seo/inc/sitemaps/class-sitemap-cache-data.php';

to srdb.class.php works well.

So, please try:

  1. use dry run and check class name (like WPSEO_Sitemap_Cache_Data in Yoast/wordpress-seo#4571 (comment))
  2. require classes and reload
  3. run again
@Franz333

This comment has been minimized.

Show comment
Hide comment
@Franz333

Franz333 Sep 7, 2018

Hello,

It's been a while. I have solved the problem with another trick, can't even remember what.

But thanks for giving advice, that might help later on. It will for sure.

Thank you very much

Franz333 commented Sep 7, 2018

Hello,

It's been a while. I have solved the problem with another trick, can't even remember what.

But thanks for giving advice, that might help later on. It will for sure.

Thank you very much

@ordinatheur

This comment has been minimized.

Show comment
Hide comment
@ordinatheur

ordinatheur Sep 10, 2018

Hi, I'm trying to shift my site from http to https and I get nearly the same line...
2: Class __PHP_Incomplete_Class has no unserializer in /home/(my website)/www/(name of the file)/srdb.class.php on line 735

I am lost as to how to deal with it... :(

Could you give me a step by step procedure, please ?
Thanks for your help.

ordinatheur commented Sep 10, 2018

Hi, I'm trying to shift my site from http to https and I get nearly the same line...
2: Class __PHP_Incomplete_Class has no unserializer in /home/(my website)/www/(name of the file)/srdb.class.php on line 735

I am lost as to how to deal with it... :(

Could you give me a step by step procedure, please ?
Thanks for your help.

@takotakot

This comment has been minimized.

Show comment
Hide comment
@takotakot

takotakot Sep 10, 2018

@ordinatheur You may have some plugin that have serialize and unserialize.

  1. Search the plugin. There are some ways.
    1. The content of the error DB record have the class name. Ref: #176 (comment)
    2. Look for serialize/unserialize method in the source code.
  2. Require (once) manually in srdb.class.php
    • If you don't know how to require_once and report the plugin name, someone will help you.
  3. srdb works. You have to reload.

takotakot commented Sep 10, 2018

@ordinatheur You may have some plugin that have serialize and unserialize.

  1. Search the plugin. There are some ways.
    1. The content of the error DB record have the class name. Ref: #176 (comment)
    2. Look for serialize/unserialize method in the source code.
  2. Require (once) manually in srdb.class.php
    • If you don't know how to require_once and report the plugin name, someone will help you.
  3. srdb works. You have to reload.
@ordinatheur

This comment has been minimized.

Show comment
Hide comment
@ordinatheur

ordinatheur Sep 10, 2018

@takotakot Thanks for your help, unfortunately I don't understand it at all. :(
I'm really tired, I will look into it on Wednesday as I am working all day tomorrow.

ordinatheur commented Sep 10, 2018

@takotakot Thanks for your help, unfortunately I don't understand it at all. :(
I'm really tired, I will look into it on Wednesday as I am working all day tomorrow.

@takotakot

This comment has been minimized.

Show comment
Hide comment
@takotakot

takotakot Sep 10, 2018

@ordinatheur If there is the error record like Yoast/wordpress-seo#4571 (comment) the content of the data is important.
If you don't care, ignore the error and replace.

takotakot commented Sep 10, 2018

@ordinatheur If there is the error record like Yoast/wordpress-seo#4571 (comment) the content of the data is important.
If you don't care, ignore the error and replace.

@dhaupin

This comment has been minimized.

Show comment
Hide comment
@dhaupin

dhaupin Sep 10, 2018

@ordinatheur you really need to have developer access/experience to complete the steps @takotakot mentioned.

If you have Yoast, you can try this with the sitemaps: #176 (comment)

dhaupin commented Sep 10, 2018

@ordinatheur you really need to have developer access/experience to complete the steps @takotakot mentioned.

If you have Yoast, you can try this with the sitemaps: #176 (comment)

@ordinatheur

This comment has been minimized.

Show comment
Hide comment
@ordinatheur

ordinatheur Sep 10, 2018

Thanks @takotakot and @dhaupin, unfortunately I don't have this experience,
I'm just trying to switch my Wordpress blog from http to https : I wanted to redirect all urls to https but am stuck at that point... :(

ordinatheur commented Sep 10, 2018

Thanks @takotakot and @dhaupin, unfortunately I don't have this experience,
I'm just trying to switch my Wordpress blog from http to https : I wanted to redirect all urls to https but am stuck at that point... :(

@dhaupin

This comment has been minimized.

Show comment
Hide comment
@dhaupin

dhaupin Sep 10, 2018

@ordinatheur Yeah it's an annoying quirk. Do you use Yoast SEO plugin, and does your site have an xml sitemap (yourdomain.com/sitemap.xml or /sitemap_index.xml)?

If so, this may be causing the hiccup. By disabling the Yoast sitemap(s) temporarily, it should clear out the funky data, and may allow the find and replace to work without error.

dhaupin commented Sep 10, 2018

@ordinatheur Yeah it's an annoying quirk. Do you use Yoast SEO plugin, and does your site have an xml sitemap (yourdomain.com/sitemap.xml or /sitemap_index.xml)?

If so, this may be causing the hiccup. By disabling the Yoast sitemap(s) temporarily, it should clear out the funky data, and may allow the find and replace to work without error.

@ordinatheur

This comment has been minimized.

Show comment
Hide comment
@ordinatheur

ordinatheur Sep 11, 2018

@dhaupin
Thanks for still trying to reach out. Yes, I had the Yoast SEO extension but before posting my question here, I read this thread, realized Yoast might be the problem, and so I deactivated it, cleared the cache... But the error remained.
I also have a sitemap, though I'm not sure if it is a Yoast one...

ordinatheur commented Sep 11, 2018

@dhaupin
Thanks for still trying to reach out. Yes, I had the Yoast SEO extension but before posting my question here, I read this thread, realized Yoast might be the problem, and so I deactivated it, cleared the cache... But the error remained.
I also have a sitemap, though I'm not sure if it is a Yoast one...

@robots4life

This comment has been minimized.

Show comment
Hide comment
@robots4life

robots4life Sep 16, 2018

Hi, I'm trying to shift my site from http to https

@ordinatheur

Started using the script today.
Have a live site on https and a local site on http.
All I replace is the domain.tld part but not the protocol, the http or https part.
(In fact I can select between http and https on the local server but I find it does not matter when using the Search and Replace script, at least in my scenario.)
So e.g. I do

--search catsanddogs.com --replace localhost/catsanddogs

going from live to local or

--search localhost/catsanddogs --replace catsanddogs.com

going from local to live.
Works for me.
I leave the protocol untouched.

So in WP settings in General tab where it says WordPress Address (URL) and GeneralSettings (URL) I think you can just type https and the domain of your site and it will work.

If you are on the live server make sure to set up a free https certificate with https://letsencrypt.org/ for example. Most web hosts have this in their web panel done in a single click.

When you activate that for your domain you can just type https in the above two settings fields and it should work. At least it does it when I do so.

Also this might help you. It creates an .htaccess file rule that makes sure your site loads with the https protocol. Just make the .htaccess file, put it on the root of your web folder where your WP install is and include the rules mentioned. Hope this helps.

But perhaps this is all wrong because the problem is something else.

robots4life commented Sep 16, 2018

Hi, I'm trying to shift my site from http to https

@ordinatheur

Started using the script today.
Have a live site on https and a local site on http.
All I replace is the domain.tld part but not the protocol, the http or https part.
(In fact I can select between http and https on the local server but I find it does not matter when using the Search and Replace script, at least in my scenario.)
So e.g. I do

--search catsanddogs.com --replace localhost/catsanddogs

going from live to local or

--search localhost/catsanddogs --replace catsanddogs.com

going from local to live.
Works for me.
I leave the protocol untouched.

So in WP settings in General tab where it says WordPress Address (URL) and GeneralSettings (URL) I think you can just type https and the domain of your site and it will work.

If you are on the live server make sure to set up a free https certificate with https://letsencrypt.org/ for example. Most web hosts have this in their web panel done in a single click.

When you activate that for your domain you can just type https in the above two settings fields and it should work. At least it does it when I do so.

Also this might help you. It creates an .htaccess file rule that makes sure your site loads with the https protocol. Just make the .htaccess file, put it on the root of your web folder where your WP install is and include the rules mentioned. Hope this helps.

But perhaps this is all wrong because the problem is something else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment