Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Fatal error: Class 'ConfigPHP' not found in C:\xampp\htdocs\classes\website.php on line 47.

Antes desse erro tava dando esse:

More info: ERROR: #C-2 : Class::ConfigLUA - LUA config file doesn't exist. Path: C:/Users/Administrador/Desktop/arenatibia/otserv/config.lua

 

File: C:\xampp\htdocs\xampp\classes/configlua.php   Line: 24

File: C:\xampp\htdocs\xampp\classes/configlua.php   Line: 12

File: C:\xampp\htdocs\xampp\system/load.init.php   Line: 42

File: C:\xampp\htdocs\xampp/index.php   Line: 18

 

Meu website.php.

 

 

<?php
if(!defined('INITIALIZED'))
    exit;

class Website extends WebsiteErrors
{
    public static $serverConfig;
    public static $websiteConfig;
    public static $vocations;
    public static $groups;
    public static $SQL;
    public static $passwordsEncryptions = array(
    'plain' => 'plain',
    'md5' => 'md5',
    'sha1' => 'sha1',
    'sha256' => 'sha256',
    'sha512' => 'sha512',
    'vahash' => 'vahash'
    );
    private static $passwordsEncryption;

    public static function setDatabaseDriver($value)
    {
        self::$SQL = null;

        switch($value)
        {
            case Database::DB_MYSQL:
                self::$SQL = new Database_MySQL();
                break;
            case Database::DB_SQLITE:
                self::$SQL = new Database_SQLite();
                break;
        }
    }

    public static function getDBHandle()
    {
        if(isset(self::$SQL))
            return self::$SQL;
        else
            new Error_Critic('#C-9', 'ERROR: <b>#C-9</b> : Class::Website - getDBHandle(), database driver not set.');
    }    

    public static function loadWebsiteConfig()
    {
        self::$websiteConfig = new ConfigPHP();
        global $config;
        self::$websiteConfig->setConfig($config['site']);
    }

    public static function getWebsiteConfig()
    {
        if(!isset(self::$websiteConfig))
            self::loadWebsiteConfig();

        return self::$websiteConfig;
    }

    public static function loadServerConfig()
    {
        self::$serverConfig = new ConfigPHP();
        global $config;
        self::$serverConfig->setConfig($config['server']);
    }

    public static function getServerConfig()
    {
        if(!isset(self::$serverConfig))
            self::loadServerConfig();

        return self::$serverConfig;
    }

    public static function getConfig($fileNameArray)
    {
        $fileName = implode('_', $fileNameArray);

        if(Functions::isValidFolderName($fileName))
        {
            $_config = new ConfigPHP('./config/' . $fileName . '.php');
            return $_config;
        }
        else
            new Error_Critic('', __METHOD__ . ' - invalid folder/file name <b>' . htmlspecialchars('./config/' . $fileName . '.php') . '</b>');
    }

    public static function getFileContents($path)
    {
        $file = file_get_contents($path);

        if($file === false)
            new Error_Critic('', __METHOD__ . ' - Cannot read from file: <b>' . htmlspecialchars($path) . '</b>');

        return $file;
    }

    public static function putFileContents($path, $data, $append = false)
    {
        if($append)
            $status = file_put_contents($path, $data, FILE_APPEND);
        else
            $status = file_put_contents($path, $data);

        if($status === false)
            new Error_Critic('', __METHOD__ . ' - Cannot write to: <b>' . htmlspecialchars($path) . '</b>');

        return $status;
    }

    public static function deleteFile($path)
    {
        unlink($path);
    }

    public static function fileExists($path)
    {
        return file_exists($path);
    }

    public static function setPasswordsEncryption($encryption)
    {
        if(isset(self::$passwordsEncryptions[strtolower($encryption)]))
            self::$passwordsEncryption = strtolower($encryption);
        else
            new Error_Critic('#C-12', 'Invalid passwords encryption ( ' . htmlspecialchars($encryption) . '). Must be one of these: ' . implode(', ', self::$passwordsEncryptions));
    }
    
    public static function getPasswordsEncryption()
    {
        return self::$passwordsEncryption;
    }

    public static function validatePasswordsEncryption($encryption)
    {
        if(isset(self::$passwordsEncryptions[strtolower($encryption)]))
            return true;
        else
            return false;
    }
    
    public static function encryptPassword($password, $account = null)
    {
        // add SALT for 0.4
        if(isset(self::$passwordsEncryption))
            if(self::$passwordsEncryption == 'plain')
                return $password;
            else
                return hash(self::$passwordsEncryption, $password);
        else
            new Error_Critic('#C-13', 'You cannot use Website::encryptPassword(\$password) when password encryption is not set.');
    }

    public static function loadVocations()
    {
        $path = self::getWebsiteConfig()->getValue('serverPath');
        self::$vocations = new Vocations($path . 'data/XML/vocations.xml');
    }

    public static function getVocations()
    {
        if(!isset(self::$vocations))
            self::loadVocations();

        return self::$vocations;
    }

    public static function getVocationName($id)
    {
        if(!isset(self::$vocations))
            self::loadVocations();

        return self::$vocations->getVocationName($id);
    }

    public static function loadGroups()
    {
        $path = self::getWebsiteConfig()->getValue('serverPath');
        self::$groups = new Groups($path . 'data/XML/groups.xml');
    }

    public static function getGroups()
    {
        if(!isset(self::$groups))
            self::loadGroups();

        return self::$groups;
    }

    public static function getGroupName($id)
    {
        if(!isset(self::$groups))
            self::loadGroups();

        return self::$groups->getGroupName($id);
    }

    public static function getCountryCode($IP)
    {
        $a = explode(".",$IP);
        if($a[0] == 10) // IPs 10.0.0.0 - 10.255.255.255 = private network, so can't geolocate
            return 'unknown';
        if($a[0] == 127) // IPs 127.0.0.0 - 127.255.255.255 = local network, so can't geolocate
            return 'unknown';
        if($a[0] == 172 && ($a[1] >= 16 && $a[1] <= 31)) // IPs 172.16.0.0 - 172.31.255.255 = private network, so can't geolocate
            return 'unknown';
        if($a[0] == 192 && $a[1] == 168) // IPs 192.168.0.0 - 192.168.255.255 = private network, so can't geolocate
            return 'unknown';
        if($a[0] >= 224) // IPs over 224.0.0.0 are not assigned, so can't geolocate
            return 'unknown';
        $longIP = $a[0] * 256 * 256 * 256 + $a[1] * 256 * 256 + $a[2] * 256 + $a[3]; // we need unsigned value
        if(!file_exists('cache/flags/flag' . $a[0]))
        {
            $flagData = @file_get_contents('http://country-flags.ots.me/flag' . $a[0]);
            if($flagData === false)
                return 'unknown';
            if(@file_put_contents('cache/flags/flag' . $a[0], $flagData) === false)
                return 'unknown';
        }
        $countries = unserialize(file_get_contents('cache/flags/flag' . $a[0])); // load file
        $lastCountryCode = 'unknown';
        foreach($countries as $fromLong => $countryCode)
        {
            if($fromLong > $longIP)
                break;
            $lastCountryCode = $countryCode;
        }
        return $lastCountryCode;
    }
}

 

Editado por erick10 (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • Moderador
1 hora atrás, erick10 disse:

Eu troquei e ainda da o mesmo erro.

tente os caminho assim

 

C:/Users/Administrador/Desktop/arenatibia/otserv/config.lua

 

C:/Users/Administrador/Desktop/arenatibia/otserv/

 

C:/Users/Administrador/Desktop/arenatibia/otserv

 

tente os 3 caminhos e outra remova todos os espaço e comentários do seu config.lua

 

Editado por Alexy Brocanello (veja o histórico de edições)

 

20230912_034613.png.cf49b650c34dd7d7b1f79bd49c70f53c.png

Eu sou um entusiasta da programação apaixonado por ajudar a comunidade open source a crescer. Sempre em busca de novos desafios e oportunidades para contribuir com meu código.  #OpenSource #Programação #Contribuição

 

Link para o post
Compartilhar em outros sites

Mas não e mais esse erro que ta dando agora esta dando este: Fatal error: Class 'ConfigPHP' not found in C:\xampp\htdocs\classes\website.php on line 47.

Link para o post
Compartilhar em outros sites

@erick10

Não poste o script inteiro e sim a linha que informa o erro. E se for postar o script inteiro, poste em spoiler.

Enfim, poste a linha 47 do website.php. Sobre trocar de database, isso não tem nada a ver, lol.

Editado por Azhaurn (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • 2 years later...
  • 6 months later...

o meu está com um erro parecido...

 

Error occured!

Error ID: #C-12
More info: Invalid passwords encryption ( ). Must be one of these: plain, md5, sha1, sha256, sha512, vahash

File: C:\xampp\htdocs\classes/website.php   Line: 134
File: C:\xampp\htdocs/install.php   Line: 178

 

1- Line 134=

 

{
            new Error_Critic('#C-12', 'Invalid passwords encryption ( ' . htmlspecialchars($encryption) . '). Must be one of these: ' . implode(', ', self::$passwordsEncryptions));
        }

 

2- Line 178=

 

            new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_PASS . '</b> in server config file.');
        Website::updatePasswordEncryption();

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.


  • Conteúdo Similar

    • Por Ragnar Lothbrook
      Bom pessoal, estou com um problema um pouco sério.
       
      Abri um OT na minha maquina, com internet compartilhada. Mas eu liberei umas portas no roteador, que acabam fixando meu IP. Quando abro o OT, eu entro normalmente, assim como qualquer pessoa, sem hamachi nem nada. Apenas o IP normal. Mas no meu site ninguém consegue entrar, além de mim. Eu uso Xampp, e minha maquina não tem modem normal, o modem é o ARRIS TG862, da NET COMBO, para internet de 30 mega+. Então não tem modem fixo. O modem ja é roteador. Ja tentei de tudo. Liberei as portas 443, 4499, 80 e 8090 no firewall e no modem, mas o site continua off pra todo mundo. Apenas eu consigo acessar.
       
      Ja mudei tudo que era possivel mudar nas configurações do xampp, coloquei port 8090, 80, 8080... Todas as possibilidades que encontrei. Mas não consegui concertar.
       
      Se alguém puder me ajudar, eu agradeceria muito. É um pouco urgente.
       
      Agradeço desde já.
       
      (rep+ pra solução)
    • Por snaikpp9
      600 MOEDA NO OTSERVLIST DA PRA COLOCA AKELES NEGOCIO DE TEMPO PRO SERVIDOR ABRIR E NOME AMARELO ?


    • Por GustavoColetti
      TO FICANDO LOUCO TENTANDO RESOLVER ISSO
      ALGUEM ME AJUDAR PELO AMOR DE DEUS UHAUH
       

    • Por GustavoColetti
      Bom, estou com muita dificuldade em conseguir mecher no site do wodbo rox 8.6 ( Encontrado aqui no tibia king ) 
      Alguem poderia por favor fazer um tutorial do inicio me ensinando a mecher e colocar o site online??
      Por favor !!
       

       
      Muito Obrigado..
    • Por shoorkill
      Consigo criar conta normalmente pelo site,mas quando e crio ela fica na pasta do site ao inves de ir para a pasta de accounts do meu servidor, uso swelia aac,alguem poderia me ajudar? agradeço desde ja!
       
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo