This topic contains a post which is marked as Best Answer. Press here if you would like to see it.
*

Izzyboi

  • ***
  • 59 posts
Unable to install osclass 4.2 in localhost
« on: December 04, 2020, 09:10:11 AM »
Hello

I want to test osclass 4.2 locally before going live but I'm unable to install it.

I was able to install 4.1 successfully but I'm getting an error message when trying to do a fresh install.

The error is attached below
I use easyphp

*

MB Themes

Re: Unable to install osclass 4.2 in localhost
« Reply #1 on: December 04, 2020, 10:18:38 AM »
@Izzyboi
Error code means you are trying to add records for those foreign key (parent) does not exists.
This is from importing of :
oc-includes/osclass/installer/basic_data.sql
oc-includes/osclass/installer/pages.sql
oc-content/languages/' . osc_current_admin_locale() . '/mail.sql

You will have to look into database and find out where it was stopped.

You could also get description.
In oc-includes/osclass/install-functions.php find (there can be multiple instances):
Code: [Select]
$error_num = $comm->getErrorLevel();
edit to:
Code: [Select]
$error_num = $comm->getErrorLevel();
$error_desc = $comm->getErrorDesc();

and then:
Code: [Select]
        return array ( 'error' => sprintf( __( "Can't insert basic configuration. Error number: %s" ) , $error_num ) );

into:
Code: [Select]
        return array ( 'error' => sprintf( __( "Can't insert basic configuration. Error number: %s" ) , $error_num . ' - ' . $error_desc ) );
Maybe it will tell what was the issue ;)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Izzyboi

  • ***
  • 59 posts
Re: Unable to install osclass 4.2 in localhost
« Reply #2 on: December 04, 2020, 11:29:54 AM »
@Izzyboi
Error code means you are trying to add records for those foreign key (parent) does not exists.
This is from importing of :
oc-includes/osclass/installer/basic_data.sql
oc-includes/osclass/installer/pages.sql
oc-content/languages/' . osc_current_admin_locale() . '/mail.sql

You will have to look into database and find out where it was stopped.

You could also get description.
In oc-includes/osclass/install-functions.php find (there can be multiple instances):
Code: [Select]
$error_num = $comm->getErrorLevel();
edit to:
Code: [Select]
$error_num = $comm->getErrorLevel();
$error_desc = $comm->getErrorDesc();

and then:
Code: [Select]
        return array ( 'error' => sprintf( __( "Can't insert basic configuration. Error number: %s" ) , $error_num ) );

into:
Code: [Select]
        return array ( 'error' => sprintf( __( "Can't insert basic configuration. Error number: %s" ) , $error_num . ' - ' . $error_desc ) );
Maybe it will tell what was the issue ;)

Thank you, I'll try this

*

Izzyboi

  • ***
  • 59 posts
Re: Unable to install osclass 4.2 in localhost
« Reply #3 on: December 04, 2020, 05:59:56 PM »
I've tried your suggestion. Here's what I got

*

Izzyboi

  • ***
  • 59 posts
Re: Unable to install osclass 4.2 in localhost
« Reply #4 on: December 04, 2020, 06:03:32 PM »
The I ran this command in sql, a suggestion from a friend
SET FOREIGN_KEY_CHECKS=0;

But I got another error again

*

MB Themes

Re: Unable to install osclass 4.2 in localhost
« Reply #5 on: December 04, 2020, 06:04:08 PM »
So basically static page description is not inserted, because that locale code is missing in oc_t_locale table
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

MB Themes

Re: Unable to install osclass 4.2 in localhost
« Reply #6 on: December 04, 2020, 06:20:54 PM »
Regarding your image.
In oc-includes/osclass/classes/database/DBConnectionClass.php

Find:
Code: [Select]
      if(function_exists('osc_is_admin_user_logged_in')) {
        $is_admin_logged = osc_is_admin_user_logged_in();
      }

replace with:
Code: [Select]

    if(!defined('OSC_INSTALLING')) {
      if(function_exists('osc_is_admin_user_logged_in') && class_exists('Admin') && class_exists('Session')) {
        $is_admin_logged = osc_is_admin_user_logged_in();
      }
    }

Regarding issue with SQL, it might be related to above error that inserting of locales was not done successfully.
But it's weird as I tried several installations and did not get any of your issues :)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Re: Unable to install osclass 4.2 in localhost
« Reply #7 on: December 04, 2020, 07:36:30 PM »
currently, i am using Osclass Evolution 4.3 but I want to move on osclasspoint script, but updating not working nor admin panel login works after files upload. what can I do plz help?

*

MB Themes

Re: Unable to install osclass 4.2 in localhost
« Reply #8 on: December 04, 2020, 07:58:59 PM »
@Bhagwati Suthar
I am not sure if you can switch from there.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Izzyboi

  • ***
  • 59 posts
Re: Unable to install osclass 4.2 in localhost
« Reply #9 on: December 04, 2020, 08:54:48 PM »
Regarding your image.
In oc-includes/osclass/classes/database/DBConnectionClass.php

Find:
Code: [Select]
      if(function_exists('osc_is_admin_user_logged_in')) {
        $is_admin_logged = osc_is_admin_user_logged_in();
      }

replace with:
Code: [Select]

    if(!defined('OSC_INSTALLING')) {
      if(function_exists('osc_is_admin_user_logged_in') && class_exists('Admin') && class_exists('Session')) {
        $is_admin_logged = osc_is_admin_user_logged_in();
      }
    }

Regarding issue with SQL, it might be related to above error that inserting of locales was not done successfully.
But it's weird as I tried several installations and did not get any of your issues :)

Thank you, I'll try this. If it doesn't work. I guess I have to do the testing on a live server.

Maybe I messed something up. I didn't get any issues installing 4.1
Thanks

*

MB Themes

Re: Unable to install osclass 4.2 in localhost
« Reply #10 on: December 04, 2020, 09:26:23 PM »
Let me know  ;)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

mocody

  • ****
  • 139 posts
  • Only Marketing matters
Re: Unable to install osclass 4.2 in localhost
« Reply #11 on: December 04, 2020, 09:35:36 PM »
@Izzyboi
I did it the test on several times and I didn't see the Issue,  I think it's about the configuration files of easyphp,.
try to use XAMPP local server , and in the meantime stop the apache and mysql from the easyphp dialog.



*

Izzyboi

  • ***
  • 59 posts
Re: Unable to install osclass 4.2 in localhost
« Reply #12 on: December 05, 2020, 07:49:11 AM »
@Izzyboi
I did it the test on several times and I didn't see the Issue,  I think it's about the configuration files of easyphp,.
try to use XAMPP local server , and in the meantime stop the apache and mysql from the easyphp dialog.
Alright, I'll download XAMPP and give you feedback. I'll try the Apache thing too

Marked as best answer by frosticek on December 09, 2020, 12:35:39 PM
*

MB Themes

Re: Unable to install osclass 4.2 in localhost
« Reply #13 on: December 09, 2020, 12:35:36 PM »
@Izzyboi
Everything should work ok now with 4.2.1 release.
https://osclass-classifieds.com/changelog
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Izzyboi

  • ***
  • 59 posts
Re: Unable to install osclass 4.2 in localhost
« Reply #14 on: December 14, 2020, 05:53:41 AM »
@Izzyboi
Everything should work ok now with 4.2.1 release.
https://osclass-classifieds.com/changelog

Thank you. I've installed XAMPP and tried v4.2 and 4.2.1 and I get this same error

I'll try the 4.2.1 on Easyphp and see what happens
« Last Edit: December 14, 2020, 06:05:19 AM by Izzyboi »