Support Forums - Classified Ads Script Osclass

General osclass questions => General discussion => Topic started by: Izzyboi on December 04, 2020, 09:10:11 AM

Title: Unable to install osclass 4.2 in localhost
Post by: Izzyboi 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
Title: Re: Unable to install osclass 4.2 in localhost
Post by: MB Themes 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 ;)
Title: Re: Unable to install osclass 4.2 in localhost
Post by: Izzyboi 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
Title: Re: Unable to install osclass 4.2 in localhost
Post by: Izzyboi on December 04, 2020, 05:59:56 PM
I've tried your suggestion. Here's what I got
Title: Re: Unable to install osclass 4.2 in localhost
Post by: Izzyboi 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
Title: Re: Unable to install osclass 4.2 in localhost
Post by: MB Themes 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
Title: Re: Unable to install osclass 4.2 in localhost
Post by: MB Themes 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 :)
Title: Re: Unable to install osclass 4.2 in localhost
Post by: Bhagwati Suthar 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?
Title: Re: Unable to install osclass 4.2 in localhost
Post by: MB Themes on December 04, 2020, 07:58:59 PM
@Bhagwati Suthar
I am not sure if you can switch from there.
Title: Re: Unable to install osclass 4.2 in localhost
Post by: Izzyboi 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
Title: Re: Unable to install osclass 4.2 in localhost
Post by: MB Themes on December 04, 2020, 09:26:23 PM
Let me know  ;)
Title: Re: Unable to install osclass 4.2 in localhost
Post by: mocody 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.


Title: Re: Unable to install osclass 4.2 in localhost
Post by: Izzyboi 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
Title: Re: Unable to install osclass 4.2 in localhost
Post by: MB Themes on December 09, 2020, 12:35:36 PM
@Izzyboi
Everything should work ok now with 4.2.1 release.
https://osclass-classifieds.com/changelog
Title: Re: Unable to install osclass 4.2 in localhost
Post by: Izzyboi 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
Title: Re: Unable to install osclass 4.2 in localhost
Post by: MB Themes on December 14, 2020, 09:41:59 AM
That simply means that in step where you defined database & server configuration, config.php file could not be created as WEB_PATH is created here.
Title: Re: Unable to install osclass 4.2 in localhost
Post by: Izzyboi on December 14, 2020, 12:47:43 PM
Installed successfully finally!
Title: Re: Unable to install osclass 4.2 in localhost
Post by: MB Themes on December 14, 2020, 01:04:24 PM
@Izzyboi
Thanks for feedback, updates those were made will be published with 4.2.2
Title: Re: Unable to install osclass 4.2 in localhost
Post by: Izzyboi on December 14, 2020, 10:22:06 PM
@Izzyboi
Thanks for feedback, updates those were made will be published with 4.2.2
Okay, thank you