NamelessMC

Internet Explorer

Internet Explorer is not supported. Please upgrade to a more modern browser.

Firaman3D

Member

Feed

There are no wall posts here yet.

About

Registered:
over 6 years ago
Last Seen:
about 1 year ago
Profile Views:
980
Minecraft
Firaman3D

Latest Posts

about 1 year ago
Deprecated Errors

Sorry about the post over here.
Unfortunately, I can neither edit nor delete my own post.

about 1 year ago
Deprecated Errors

My ajax_initialise.php

 

<?php
if (isset($_POST['perform']) && $_POST['perform'] == 'true') {
    try {
        if ($_GET['initialise'] === 'db') {
            $message = PhinxAdapter::migrate();

            $redirect_url = (($_SESSION['action'] == 'install') ? '?step=site_configuration' : '?step=upgrade');

            $json = [
                'message' => $language->get('installer', 'database_configured'),
                'redirect_url' => $redirect_url,
            ];

            if (!str_contains($message, 'All Done')) {
                $json['error'] = $message;
            } else {
                $_SESSION['database_initialized'] = true;
            }

        } else {
            if ($_GET['initialise'] === 'site') {
                DatabaseInitialiser::runPreUser($conf);

                $json = [
                    'success' => true,
                    'redirect_url' => '?step=admin_account_setup',
                ];

                $_SESSION['site_initialized'] = true;

            } else if ($_GET['initialise'] === 'upgrade') {
                define('UPGRADE', true);

                require(dirname(__DIR__) . '/includes/upgrade_perform.php');

                $json = [
                    'success' => !isset($errors) || !count($errors),
                    'errors' => $errors ?? [],
                    'message' => $language->get('installer', 'upgrade_error'),
                    'redirect_url' => '?step=finish',
                ];

                $_SESSION['admin_setup'] = true;

            } else {
                throw new RuntimeException('Invalid initialisation');
            }
        }
    } catch (Exception $e) {
        $json = [
            'error' => true,
            'message' => $e->getMessage(),
        ];
    }

    header('Content-Type: application/json');
    echo json_encode($json);
    die();
}

 

 

 

 




My database_initialization.php

 

 

<?php
if (isset($_SESSION['database_initialized']) && $_SESSION['database_initialized'] == true) {
    Redirect::to('?step=site_configuration');
}

if (!isset($_SESSION['charset'])) {
    Redirect::to('?step=database_configuration');
}

$scripts = [
    '
    <script><br />        $(document).ready(function() {<br />            $.post("?step=ajax_initialise&initialise=db", {perform: "true"}, function(response) {<br />                if (response.success) {<br />                    window.location.replace(response.redirect_url);<br />                } else {<br />                    if (response.error) {<br />                        $("#info").parent().attr("class", "ui red message");<br />                        $("#info").html(response.error);<br />                        $("#continue-button").before("<button onclick=\"window.location.reload()\" class=\"ui small button\" id=\"reload-button\">' . $language->get('installer', 'reload') . '");<br />                    } else if (response.redirect_url) {<br />                        $("#info").html(response.message);<br />                        $("#continue-button").attr("href", response.redirect_url);<br />                        $("#continue-button").removeClass("disabled");<br />                    }<br />                }<br />            });<br />        });<br />    </script>
    '
];
?>


   

       


            <?php echo $language->get('installer', 'database_configuration'); ?>
       


   

   

       
           
            <?php echo $language->get('installer', 'installer_now_initialising_database'); ?>
       

   

   

 

about 1 year ago
Deprecated Errors

Hey Samerton,

I have played through the whole thing 5 times now without success.
It still does not seem to work for me.
During the installation the error from the picture appears.

 


and in the Fatal Error I get the following message:

[2022-07-25, 22:43:28] /var/www/settla/core/classes/Database/DB.php(151): SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`nameless2`.`nl2_users_groups`, CONSTRAINT `nl2_users_groups_ibfk_2` FOREIGN KEY (`group_id`) REFERENCES `nl2_groups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE)

about 1 year ago
Deprecated Errors

I checked the file cache/logs/fatal-log.log for errors

 

[2022-07-24, 11:53:40] /var/www/settla/core/classes/Database/DB.php(151): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nameless2.nl2_phinxlog' doesn't exist
[2022-07-24, 11:53:59] /var/www/settla/core/classes/Database/DB.php(151): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nameless2.nl2_phinxlog' doesn't exist
[2022-07-24, 11:54:20] /var/www/settla/core/classes/Database/DB.php(151): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nameless2.nl2_settings' doesn't exist
[2022-07-24, 11:54:20] /var/www/settla/core/classes/Database/DB.php(151): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nameless2.nl2_phinxlog' doesn't exist
[2022-07-24, 11:54:22] /var/www/settla/core/classes/Database/DB.php(151): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nameless2.nl2_phinxlog' doesn't exist
[2022-07-24, 11:54:22] /var/www/settla/core/classes/Database/DB.php(151): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nameless2.nl2_phinxlog' doesn't exist
[2022-07-24, 11:55:17] /var/www/settla/core/classes/Database/DB.php(151): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nameless2.nl2_phinxlog' doesn't exist
[2022-07-24, 11:55:17] /var/www/settla/core/classes/Database/DB.php(151): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nameless2.nl2_phinxlog' doesn't exist
[2022-07-24, 11:57:52] /var/www/settla/core/classes/Database/DB.php(151): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nameless2.nl2_settings' doesn't exist

 

But i also did the following and it doesnt work

https://github.com/NamelessMC/Nameless/issues/2822

about 1 year ago
Deprecated Errors

Hey Samerton,

downgrading PHP is unfortunately not a solution.
Unfortunately the upgrade of the website fails, maybe I'm doing the upgrade wrong.

My procedure for the upgrade:
1. move web FTP files to a subfolder "OLD".
2. unpack the release from https://github.com/NamelessMC/Nameless/releases/tag/v2.0.0-pr13 in the web directory
3. create a new account and database with PHPMyAdmin
4. open the installer via web page and select upgrade
5. specify new and migrating database

Now I get the error.
What can I do to install the upgrade successfully?

Thanks in advance.

Best regards Robin