T
T
Tanya2019-03-22 22:53:36
PHP
Tanya, 2019-03-22 22:53:36

Fatal Error Woops/Run in WordPress how to fix?

Good afternoon! For the first time I encountered such a problem when transferring the site to a new hosting and domain. Previously, this was not the case, I did everything according to the rules, changed the links in the database to the necessary ones, imported, uploaded all the files, edited config.php, that is, there were no questions about this in the error. First, after installation, it threw on the WP download page after fixing this error and reinstalling, the following error began to pop up:

Fatal error: Uncaught Error: Class 'Whoops\Run' not found in /home/psg2q17vvphs/public_html/remote-how/wp-content/themes/know-how/lib/boot.php:59 Stack trace: #0 /home/psg2q17vvphs/public_html/remote-how/wp-content/themes/know-how/functions.php(3): include() #1 /home/psg2q17vvphs/public_html/remote-how/wp-settings.php(426): include('/home/psg2q17vv...') #2 /home/psg2q17vvphs/public_html/remote-how/wp-config.php(89): require_once('/home/psg2q17vv...') #3 /home/psg2q17vvphs/public_html/remote-how/wp-load.php(37): require_once('/home/psg2q17vv...') #4 /home/psg2q17vvphs/public_html/remote-how/wp-login.php(12): require('/home/psg2q17vv...') #5 {main} thrown in /home/psg2q17vvphs/public_html/remote-how/wp-content/themes/know-how/lib/boot.php on line 59

I just don’t know how to fix it and what the problem is, I haven’t had this yet.
There, standard errors such as php version or memory limit are not the same, incorrect .httaccess settings immediately disappear, can anyone come across a similar one? Please help, otherwise I don’t understand at all that there is no
Boot.php file
<?php
/**
 * Bootstrap framework dependencies & helpers
 */
require __DIR__ . '/../vendor/autoload.php';
//require_once __DIR__ . '/autoload.php';

function isProduction()
{
    return (!isStaging() || isLocalhost());
}

function isStaging()
{
    return !isLocalhost();
}

function isLocalhost()
{
    return apply_filters('is_localhost', $_SERVER['HTTP_HOST'] == 'localhost' || $_SERVER['HTTP_HOST'] == 'virtual.movecloser.pl');
}

function isLocal()
{
    return isLocalhost();
}
function useWebpackDevServer(){
    //return false;
    return isLocal();
}
function vd($p)
{
    array_map('var_dump', $p);
}

function dd(...$p)
{
    array_map('var_dump', $p);
    die();
}

function pr($arr)
{
    echo '<pre>';
    print_r($arr);
    echo '</pre>';
}

function prd($arr)
{
    die(pr($arr));
}


if (isLocal()) {
    error_reporting(E_ALL & ~(E_NOTICE | E_WARNING));
}

$whoops = new \Whoops\Run;
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler);
$whoops->register();


//date_default_timezone_set('UTC');

and autoload
are both in the lib folder
<?php
function framework_autoload($class_name)
{
  $filename = __DIR__ . '/' . str_replace('\\', '/', ucwords($class_name)) . '.php';;
  if (file_exists($filename)) {
    include $filename;
  }
}

spl_autoload_register('framework_autoload');

composer.json file
{
  "name": "maciek/domwaluty",
  "authors": [
    {
      "name": "partyka1",
      "email": "[email protected]"
    }
  ],
  "require": {
    "filp/whoops": "^2.1"
  }
}

I would be extremely grateful to those who at least know something about this, thanks!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
MSAFT, 2019-03-22
@Silvanassss

Judging by the error, it swears that the class that is registered in composer.json is missing
In the terminal, write "composer install" in the folder where the composer.json file is located

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question