I'm unsure if this is the best forum for this topic but I can't find a better one :)

I am attempting to migrate a Drupal 8 site from shared hosting to a VPS.

I have setup the directory and propagated the Database.

I have setup the mobile only sub domain m.domain.com.

At first I was not able to go to any page(on the primary domain) apart from the front of the website because I would get a 404 error.
I solved this by changing the owner of the files (initially they were set to root) to the correct owner.
I was then able to go to any page of the site (with the primary domain) but I would still get the 404 error when trying to navigate with the sub domain(front page would still show).

Now for some reason the domains have swapped, I can only navigate the whole website using the sub domain and the normal domain only shows the from page with links giving a 404 error again.

What am I missing? I'm guessing it has something to do with WHM and I'm missing an Apache extension?

I've googled and can only find information about older Drupal versions.
Thanks for anyone's input :)

Here's the complete error log that I get after browsing the mobile domain as well as the main domain and getting a 404 error.

[17-Jun-2017 10:44:22 UTC] Error: Class 'Swift_Message' not found in /home/account_name/public_html/modules/swiftmailer/src/Plugin/Mail/SwiftMailer.php on line 172 #0 /home/account_name/public_html/modules/mailsystem/src/Adapter.php(50): Drupal\swiftmailer\Plugin\Mail\SwiftMailer->mail(Array)
#1 /home/account_name/public_html/core/lib/Drupal/Core/Mail/MailManager.php(291): Drupal\mailsystem\Adapter->mail(Array)
#2 /home/account_name/public_html/core/lib/Drupal/Core/Mail/MailManager.php(173): Drupal\Core\Mail\MailManager->doMail('update', 'status_notify', 'admin@name...', 'en', Array, NULL, true)
#3 /home/account_name/public_html/core/lib/Drupal/Core/Render/Renderer.php(574): Drupal\Core\Mail\MailManager->Drupal\Core\Mail\{closure}()
#4 /home/account_name/public_html/core/lib/Drupal/Core/Mail/MailManager.php(174): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#5 /home/account_name/public_html/modules/mailsystem/src/MailsystemManager.php(73): Drupal\Core\Mail\MailManager->mail('update', 'status_notify', 'admin@name...', 'en', Array, NULL, true)
#6 /home/account_name/public_html/core/modules/update/update.fetch.inc(41): Drupal\mailsystem\MailsystemManager->mail('update', 'status_notify', 'admin@name...', 'en', Array)
#7 /home/account_name/public_html/core/modules/update/update.module(261): _update_cron_notify()
#8 [internal function]: update_cron()
#9 /home/account_name/public_html/core/lib/Drupal/Core/Extension/ModuleHandler.php(391): call_user_func_array('update_cron', Array)
#10 /home/account_name/public_html/core/lib/Drupal/Core/Cron.php(223): Drupal\Core\Extension\ModuleHandler->invoke('update', 'cron')
#11 /home/account_name/public_html/core/lib/Drupal/Core/Cron.php(122): Drupal\Core\Cron->invokeCronHandlers()
#12 /home/account_name/public_html/core/lib/Drupal/Core/ProxyClass/Cron.php(75): Drupal\Core\Cron->run()
#13 /home/account_name/public_html/core/modules/automated_cron/src/EventSubscriber/AutomatedCron.php(65): Drupal\Core\ProxyClass\Cron->run()
#14 /home/account_name/public_html/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): Drupal\automated_cron\EventSubscriber\AutomatedCron->onTerminate(Object(Symfony\Component\HttpKernel\Event\PostResponseEvent), 'kernel.terminat...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#15 /home/account_name/public_html/vendor/symfony/http-kernel/HttpKernel.php(84): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.terminat...', Object(Symfony\Component\HttpKernel\Event\PostResponseEvent))
#16 /home/account_name/public_html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(32): Symfony\Component\HttpKernel\HttpKernel->terminate(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Render\HtmlResponse))
#17 /home/account_name/public_html/core/lib/Drupal/Core/DrupalKernel.php(634): Stack\StackedHttpKernel->terminate(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Render\HtmlResponse))
#18 /home/account_name/public_html/index.php(22): Drupal\Core\DrupalKernel->terminate(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Render\HtmlResponse))
#19 {main}
[17-Jun-2017 10:44:31 UTC] Error: Class 'Swift_Message' not found in /home/account_name/public_html/modules/swiftmailer/src/Plugin/Mail/SwiftMailer.php on line 172 #0 /home/account_name/public_html/modules/mailsystem/src/Adapter.php(50): Drupal\swiftmailer\Plugin\Mail\SwiftMailer->mail(Array)
#1 /home/account_name/public_html/core/lib/Drupal/Core/Mail/MailManager.php(291): Drupal\mailsystem\Adapter->mail(Array)
#2 /home/account_name/public_html/core/lib/Drupal/Core/Mail/MailManager.php(173): Drupal\Core\Mail\MailManager->doMail('update', 'status_notify', 'admin@name...', 'en', Array, NULL, true)
#3 /home/account_name/public_html/core/lib/Drupal/Core/Render/Renderer.php(574): Drupal\Core\Mail\MailManager->Drupal\Core\Mail\{closure}()
#4 /home/account_name/public_html/core/lib/Drupal/Core/Mail/MailManager.php(174): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#5 /home/account_name/public_html/modules/mailsystem/src/MailsystemManager.php(73): Drupal\Core\Mail\MailManager->mail('update', 'status_notify', 'admin@name...', 'en', Array, NULL, true)
#6 /home/account_name/public_html/core/modules/update/update.fetch.inc(41): Drupal\mailsystem\MailsystemManager->mail('update', 'status_notify', 'admin@name...', 'en', Array)
#7 /home/account_name/public_html/core/modules/update/update.module(261): _update_cron_notify()
#8 [internal function]: update_cron()
#9 /home/account_name/public_html/core/lib/Drupal/Core/Extension/ModuleHandler.php(391): call_user_func_array('update_cron', Array)
#10 /home/account_name/public_html/core/lib/Drupal/Core/Cron.php(223): Drupal\Core\Extension\ModuleHandler->invoke('update', 'cron')
#11 /home/account_name/public_html/core/lib/Drupal/Core/Cron.php(122): Drupal\Core\Cron->invokeCronHandlers()
#12 /home/account_name/public_html/core/lib/Drupal/Core/ProxyClass/Cron.php(75): Drupal\Core\Cron->run()
#13 /home/account_name/public_html/core/modules/automated_cron/src/EventSubscriber/AutomatedCron.php(65): Drupal\Core\ProxyClass\Cron->run()
#14 /home/account_name/public_html/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): Drupal\automated_cron\EventSubscriber\AutomatedCron->onTerminate(Object(Symfony\Component\HttpKernel\Event\PostResponseEvent), 'kernel.terminat...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#15 /home/account_name/public_html/vendor/symfony/http-kernel/HttpKernel.php(84): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.terminat...', Object(Symfony\Component\HttpKernel\Event\PostResponseEvent))
#16 /home/account_name/public_html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(32): Symfony\Component\HttpKernel\HttpKernel->terminate(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Render\HtmlResponse))
#17 /home/account_name/public_html/core/lib/Drupal/Core/DrupalKernel.php(634): Stack\StackedHttpKernel->terminate(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Render\HtmlResponse))
#18 /home/account_name/public_html/index.php(22): Drupal\Core\DrupalKernel->terminate(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Render\HtmlResponse))
#19 {main}
[17-Jun-2017 10:44:46 UTC] Error: Class 'Swift_Message' not found in /home/account_name/public_html/modules/swiftmailer/src/Plugin/Mail/SwiftMailer.php on line 172 #0 /home/account_name/public_html/modules/mailsystem/src/Adapter.php(50): Drupal\swiftmailer\Plugin\Mail\SwiftMailer->mail(Array)
#1 /home/account_name/public_html/core/lib/Drupal/Core/Mail/MailManager.php(291): Drupal\mailsystem\Adapter->mail(Array)
#2 /home/account_name/public_html/core/lib/Drupal/Core/Mail/MailManager.php(173): Drupal\Core\Mail\MailManager->doMail('update', 'status_notify', 'admin@name...', 'en', Array, NULL, true)
#3 /home/account_name/public_html/core/lib/Drupal/Core/Render/Renderer.php(574): Drupal\Core\Mail\MailManager->Drupal\Core\Mail\{closure}()
#4 /home/account_name/public_html/core/lib/Drupal/Core/Mail/MailManager.php(174): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#5 /home/account_name/public_html/modules/mailsystem/src/MailsystemManager.php(73): Drupal\Core\Mail\MailManager->mail('update', 'status_notify', 'admin@name...', 'en', Array, NULL, true)
#6 /home/account_name/public_html/core/modules/update/update.fetch.inc(41): Drupal\mailsystem\MailsystemManager->mail('update', 'status_notify', 'admin@name...', 'en', Array)
#7 /home/account_name/public_html/core/modules/update/update.module(261): _update_cron_notify()
#8 [internal function]: update_cron()
#9 /home/account_name/public_html/core/lib/Drupal/Core/Extension/ModuleHandler.php(391): call_user_func_array('update_cron', Array)
#10 /home/account_name/public_html/core/lib/Drupal/Core/Cron.php(223): Drupal\Core\Extension\ModuleHandler->invoke('update', 'cron')
#11 /home/account_name/public_html/core/lib/Drupal/Core/Cron.php(122): Drupal\Core\Cron->invokeCronHandlers()
#12 /home/account_name/public_html/core/lib/Drupal/Core/ProxyClass/Cron.php(75): Drupal\Core\Cron->run()
#13 /home/account_name/public_html/core/modules/automated_cron/src/EventSubscriber/AutomatedCron.php(65): Drupal\Core\ProxyClass\Cron->run()
#14 /home/account_name/public_html/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): Drupal\automated_cron\EventSubscriber\AutomatedCron->onTerminate(Object(Symfony\Component\HttpKernel\Event\PostResponseEvent), 'kernel.terminat...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#15 /home/account_name/public_html/vendor/symfony/http-kernel/HttpKernel.php(84): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.terminat...', Object(Symfony\Component\HttpKernel\Event\PostResponseEvent))
#16 /home/account_name/public_html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(32): Symfony\Component\HttpKernel\HttpKernel->terminate(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Render\HtmlResponse))
#17 /home/account_name/public_html/core/lib/Drupal/Core/DrupalKernel.php(634): Stack\StackedHttpKernel->terminate(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Render\HtmlResponse))
#18 /home/account_name/public_html/index.php(22): Drupal\Core\DrupalKernel->terminate(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Render\HtmlResponse))
#19 {main}
[17-Jun-2017 10:44:54 UTC] Error: Class 'Swift_Message' not found in /home/account_name/public_html/modules/swiftmailer/src/Plugin/Mail/SwiftMailer.php on line 172 #0 /home/account_name/public_html/modules/mailsystem/src/Adapter.php(50): Drupal\swiftmailer\Plugin\Mail\SwiftMailer->mail(Array)
#1 /home/account_name/public_html/core/lib/Drupal/Core/Mail/MailManager.php(291): Drupal\mailsystem\Adapter->mail(Array)
#2 /home/account_name/public_html/core/lib/Drupal/Core/Mail/MailManager.php(173): Drupal\Core\Mail\MailManager->doMail('update', 'status_notify', 'admin@name...', 'en', Array, NULL, true)
#3 /home/account_name/public_html/core/lib/Drupal/Core/Render/Renderer.php(574): Drupal\Core\Mail\MailManager->Drupal\Core\Mail\{closure}()
#4 /home/account_name/public_html/core/lib/Drupal/Core/Mail/MailManager.php(174): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#5 /home/account_name/public_html/modules/mailsystem/src/MailsystemManager.php(73): Drupal\Core\Mail\MailManager->mail('update', 'status_notify', 'admin@name...', 'en', Array, NULL, true)
#6 /home/account_name/public_html/core/modules/update/update.fetch.inc(41): Drupal\mailsystem\MailsystemManager->mail('update', 'status_notify', 'admin@name...', 'en', Array)
#7 /home/account_name/public_html/core/modules/update/update.module(261): _update_cron_notify()
#8 [internal function]: update_cron()
#9 /home/account_name/public_html/core/lib/Drupal/Core/Extension/ModuleHandler.php(391): call_user_func_array('update_cron', Array)
#10 /home/account_name/public_html/core/lib/Drupal/Core/Cron.php(223): Drupal\Core\Extension\ModuleHandler->invoke('update', 'cron')
#11 /home/account_name/public_html/core/lib/Drupal/Core/Cron.php(122): Drupal\Core\Cron->invokeCronHandlers()
#12 /home/account_name/public_html/core/lib/Drupal/Core/ProxyClass/Cron.php(75): Drupal\Core\Cron->run()
#13 /home/account_name/public_html/core/modules/automated_cron/src/EventSubscriber/AutomatedCron.php(65): Drupal\Core\ProxyClass\Cron->run()
#14 /home/account_name/public_html/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): Drupal\automated_cron\EventSubscriber\AutomatedCron->onTerminate(Object(Symfony\Component\HttpKernel\Event\PostResponseEvent), 'kernel.terminat...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#15 /home/account_name/public_html/vendor/symfony/http-kernel/HttpKernel.php(84): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.terminat...', Object(Symfony\Component\HttpKernel\Event\PostResponseEvent))
#16 /home/account_name/public_html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(32): Symfony\Component\HttpKernel\HttpKernel->terminate(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Render\HtmlResponse))
#17 /home/account_name/public_html/core/lib/Drupal/Core/DrupalKernel.php(634): Stack\StackedHttpKernel->terminate(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Render\HtmlResponse))
#18 /home/account_name/public_html/index.php(22): Drupal\Core\DrupalKernel->terminate(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Render\HtmlResponse))
#19 {main}

Comments

jaypan’s picture

Well, this is your error:

Error: Class 'Swift_Message' not found in /home/account_name/public_html/modules/swiftmailer/src/Plugin/Mail/SwiftMailer.php

Look in that file for the use declaration for the class Swift_Message. See if the file exists in the correct file, and has the correct namespace definition. Ensure the class name matches the file name.


Contact me to contract me for D7 -> D10/11 migrations.
Or anything really. I'm friendly, and open to work or conversation.
KrypticBit’s picture

Hi Jaypan,
I've looked in that location and that module does exist with all of its files. Inside the SwiftMailer.php file there is a use Swift_Message;. Howevere I'm not sure what you mean by

Ensure the class name matches the file name.

Inside the Swiftmailer.php I can see many use

namespace Drupal\swiftmailer\Plugin\Mail;

use Drupal\Component\Render\MarkupInterface;
use Drupal\Component\Utility\Html;
use Drupal\Component\Utility\Unicode;
use Drupal\Component\Utility\UrlHelper;
use Drupal\Core\Config\ImmutableConfig;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Mail\MailInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Render\Markup;
use Drupal\Core\Render\RendererInterface;
use Drupal\Core\Site\Settings;
use Drupal\swiftmailer\Utility\Conversion;
use Exception;
use Html2Text\Html2Text;
use Psr\Log\LoggerInterface;
use stdClass;
use Swift_Attachment;
use Swift_FileSpool;
use Swift_Image;
use Swift_Mailer;
use Swift_MailTransport;
use Swift_Message;
use Swift_SendmailTransport;
use Swift_SmtpTransport;
use Swift_SpoolTransport;
use Symfony\Component\DependencyInjection\ContainerInterface;

Thanks for your help. I'm going to try and re-install swift mailer and see what happens.

KrypticBit’s picture

Just tried to re-add swiftmailer via composer and it give me this error:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for egulias/email-validator (locked at 1.2.14, required as 1.2.*) -> satisfiable by egulias/email-validator[1.2.14].
    - swiftmailer/swiftmailer 6.0.x-dev requires egulias/email-validator ~2.0 -> satisfiable by egulias/email-validator[2.0.x-dev].
    - swiftmailer/swiftmailer v6.0.0 requires egulias/email-validator ~2.0 -> satisfiable by egulias/email-validator[2.0.x-dev].
    - swiftmailer/swiftmailer v6.0.1 requires egulias/email-validator ~2.0 -> satisfiable by egulias/email-validator[2.0.x-dev].
    - Conclusion: don't install egulias/email-validator 2.0.x-dev
    - Installation request for swiftmailer/swiftmailer ^6.0 -> satisfiable by swiftmailer/swiftmailer[6.0.x-dev, v6.0.0, v6.0.1].


Installation failed, reverting ./composer.json to its original content.
jaypan’s picture

Well you're definitely missing the library. I can't help you with that though, sorry.


Contact me to contract me for D7 -> D10/11 migrations.
Or anything really. I'm friendly, and open to work or conversation.
KrypticBit’s picture

No worries mate. Strange that you point out something that wouldn't be causing the problem and then say you can't help but, meh. I've uninstalled that module from the one working sub domain for now and added it to the to-do list :)

jaypan’s picture

Strange that you point out something that wouldn't be causing the problem and then say you can't help

Well, the missing library was definitely causing the problem - that was the error that was being thrown. But I couldn't help with how to install the library.


Contact me to contract me for D7 -> D10/11 migrations.
Or anything really. I'm friendly, and open to work or conversation.
KrypticBit’s picture

Well, it definitely isn't causing the problem because the website was running fine on shared hosting with the same error being thrown. If it was causing the problem disabling the module would have fixed it, yes? It didn't.

jaypan’s picture

Well, that was a fatal error, not a notice, so it was one of your problems. You should be finding something different in the logs now.


Contact me to contract me for D7 -> D10/11 migrations.
Or anything really. I'm friendly, and open to work or conversation.
KrypticBit’s picture

Well, the only difference with the logs is that error is no longer showing up. There is nothing new. I give up, I'm starting from scratch and going to restore from a backup.

jaypan’s picture

You should look at the server logs then, not the Drupal logs.


Contact me to contract me for D7 -> D10/11 migrations.
Or anything really. I'm friendly, and open to work or conversation.
KrypticBit’s picture

I gave up dude, restoring from a cPanel backup into WHM looks like a better way to go anyway ;)

KrypticBit’s picture

After completing a restore from a backup I now have a rather strange Error:
Error: Call to undefined function Drupal\Component\Uuid\uuid_create() in /home/user/public_html/core/lib/Drupal/Component/Uuid/Pecl.php on line 14 Should this not work since it's in core? Any ideas as to what needs to be added to the server for it to work?

jaypan’s picture

How are you transferring the files? Sounds like your upload may have not completed properly or that you have a permissions problem.


Contact me to contract me for D7 -> D10/11 migrations.
Or anything really. I'm friendly, and open to work or conversation.
KrypticBit’s picture

I used cPanels backup Secure Copy (SCP) to push the backup directly to the VPS server(it was roughly 20GB). The restore went alright as far as I could tell, everything looks like it's there. What sort of permissions problem could it be? Shouldn't it be identical to the working shared hosting copy?

KrypticBit’s picture

Hmm, here's a strange thought and it's quite possibly the reason why this is happening. My VPS only has 25 GB of storage and the backup was 19-ish GB. With the backup on the VPS there wouldn't have been enough space to do a restore. Is my thinking right? Why didn't this occur to me before, Ahh!!! I've sent a message to my host asking if they can perform the backup while temporarily raising my storage space. Thanks for the the infos, you're a life saver :)

jaypan’s picture

That's a very good possibility.


Contact me to contract me for D7 -> D10/11 migrations.
Or anything really. I'm friendly, and open to work or conversation.
sprite’s picture

Restore the backup locally, on your local personal machine to check its size.

spritefully yours
Technical assistance provided to the Drupal community on my own time ...
Thank yous appreciated ...

sprite’s picture

With this kind of conflict on D8 and using composer the fix turns out to be easy and only takes a few minutes.
The following solution relies on the concept that you can always refresh your Drupal 8 code using composer, completely, without a problem.

1. Delete the /core and /vendor directories completely.
2. Delete the composer.lock file.
3. run composer install
4. run composer update

The foregoing process will completely rebuild the D8 installation by downloading all of it again from the necessary servers. With this process, the idiot composer utility will resolve the versioning conflicts, because the conflicts it created in its composer.lock file, and elsewhere in the installation, will no longer exist. It is essential to always keep in mind that the composer utility is actually "dumb" software, not smart software, it is crude and archaic, without any heuristic ability to actually resolve the software conflicts it actually ought to.

spritefully yours
Technical assistance provided to the Drupal community on my own time ...
Thank yous appreciated ...

KrypticBit’s picture

Thank you for the information, Sprite :). It's funny that Composer is as you say "dumb" I always assumed it was a bit "smarter" than that, lol! I'll be sure to follow the steps you've provided to fix the library issue I have.

So an update: My webhost has now restored a fresh backup to my system. Apparently they changed the WHM root password and I'm waiting to here back from them for the new one.

But in the mean time in the Drupal error logs I can see two errors that need to be fixed:

[18-Jun-2017 15:22:54 UTC] PHP Fatal error:  Allowed memory size of 33554432 bytes exhausted (tried to allocate 32 bytes) in /home/user/public_html/core/lib/Drupal/Core/Cache/DatabaseBackend.php on line 138
[18-Jun-2017 15:41:38 UTC] PHP Fatal error:  Call to undefined function Drupal\Component\Uuid\uuid_create() in /home/user/public_html/core/lib/Drupal/Component/Uuid/Pecl.php on line 14
[18-Jun-2017 15:58:34 UTC] PHP Fatal error:  Allowed memory size of 33554432 bytes exhausted (tried to allocate 34654 bytes) in /home/user/public_html/core/lib/Drupal/Component/Serialization/PhpSerialize.php on line 14
[18-Jun-2017 16:55:50 UTC] PHP Fatal error:  Call to undefined function Drupal\Component\Uuid\uuid_create() in /home/user/public_html/core/lib/Drupal/Component/Uuid/Pecl.php on line 14

Obviously I need to get into WHM and change the allowed memory for PHP but the Uuid error is STILL there? Any idea why this is happening? Note that the backup was taken from a working Drupal installation on shared hosting.

KrypticBit’s picture

Making progress this is the only error in the log now:
[19-Jun-2017 08:08:19 UTC] PHP Fatal error: Call to undefined function Drupal\Component\Uuid\uuid_create() in /home/user/public_html/core/lib/Drupal/Component/Uuid/Pecl.php on line 14

KrypticBit’s picture

I'm trying to use the method sprite suggested to re-download all of cores files but I'm getting this error:

Class Drupal\Core\Composer\Composer is not autoloadable, can not call pre-autoload-dump script
Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-autoload-dump script

I created a backup of the core and vendor folders just in case it didn't work but now after restoring those folders I'm getting this error:
[19-Jun-2017 08:43:10 UTC] PHP Fatal error: Class 'Drupal\Core\DrupalKernel' not found in /home/user/public_html/index.php on line 16
What a headache this has turned out to be!

jaypan’s picture

What version of PHP is your server running?


Contact me to contract me for D7 -> D10/11 migrations.
Or anything really. I'm friendly, and open to work or conversation.
KrypticBit’s picture

Lol, my host left it set to 55 I jut upped it to 70 :) I'm now getting the uuid error again however this time it's longer.
Anyone know what PHP profile will work with Drupal 8? Or what Modules and extensions are required? I think the issues there!
Edit: I have now fix the uuid error by switching the PHP handler to suphp.

This error now shows in the logs:

 Error: Call to a member function getPathname() on null in /home/user/public_html/core/includes/bootstrap.inc on line 239 #0 /home/user/public_html/core/includes/bootstrap.inc(273): drupal_get_filename('module', 'token')
#1 /home/user/public_html/core/includes/module.inc(134): drupal_get_path('module', 'token')

More Headaches :/ I found php70-php in the PHP extensions and it's disabled, should I enable it? Enabling it will disable

mod_mpm_worker
mod_cgid

and will also enable

mod_mpm_prefork
mod_cgi

php70-libc-client-static is also a disabled extension.

KrypticBit’s picture

Restored Drupal, Oh, 3-5 times.
But here be the solution for the uuid error and all the other errors!

It's finally working :)

I fixed the first error by editing this file /core/lib/Drupal/Component/Uuid/Pecl.php
The Error is on line 14 so I change that function from this:

<?php

namespace Drupal\Component\Uuid;

/**
 * Generates a UUID using the PECL extension.
 */
class Pecl implements UuidInterface {

  /**
   * {@inheritdoc}
   */
  public function generate() { 
    return uuid_create(UUID_TYPE_DEFAULT);
  }

}

To this:

<?php

namespace Drupal\Component\Uuid;

/**
 * Generates a UUID using the PECL extension.
 */
class Pecl implements UuidInterface {

  /**
   * {@inheritdoc}
   */
  public function generate() { if (isset($module)) { 
    return uuid_create(UUID_TYPE_DEFAULT);
  }}

}

There were four of these errors. They were for these files:

/core/lib/Drupal/Component/Uuid/Pecl.php on line 14
/core/lib/Drupal/Core/Extension/ModuleHandler.php on line 711
/core/lib/Drupal/Core/Template/Loader/FilesystemLoader.php on line 33
/core/includes/bootstrap.inc on line 239

I found all the functions that threw errors and wrapped it with:
{ if (isset($module)) {FUNCTION} }.

No idea why it works, but $module must stop all these functions from running if it's not a set variable .