Topic: Installation problem

Hi, I am new to the Frontaccounting. I am having a problem when go to install in local server. The error is given below:

Fatal error: Uncaught Error: Call to undefined function user_company() in C:\xampp\htdocs\frontaccounting\includes\errors.inc:87 Stack trace: #0 C:\xampp\htdocs\frontaccounting\install\isession.inc(72): error_handler(8192, 'Methods with th...', 'C:\\xampp\\htdocs...', 19, Array) #1 C:\xampp\htdocs\frontaccounting\install\isession.inc(72): include_once() #2 C:\xampp\htdocs\frontaccounting\install\index.php(18): include('C:\\xampp\\htdocs...') #3 {main} thrown in C:\xampp\htdocs\frontaccounting\includes\errors.inc on line 87


What will be the solution. Please tell me if you have a solution.

Re: Installation problem

State which version of XAMPP / PHP and OS, FA you are using.

In both FA 2.3.x and 2.4.x, the function user_company() is defined in includes/current_user.inc file.

See if any info in this post solves your issue.

Last edited by apmuthu (05/13/2016 07:07:18 pm)

Re: Installation problem

I am receiving the same error on Windows Installation for FA2.4.1 and XAMP 3.2.2 and PHP Version 7.05 and Windows Version 64-Bit. Any ideas?

I have gone through the post mentioned above and Uncommented following line on session.inc as suggested in the final post.

ini_set('session.save_path', dirname(__FILE__).'/../tmp/');

But still the problem is not resolved.

Re: Installation problem

In the function cache_invalidate in file install/isession.inc, replace:

include_once($path_to_root . "/includes/errors.inc");
// collect all error msgs
set_error_handler('error_handler' /*, errtypes */);

include_once($path_to_root . "/includes/current_user.inc");
include_once($path_to_root . "/includes/lang/language.inc");
include_once($path_to_root . "/includes/ajax.inc");
include_once($path_to_root . "/includes/ui/ui_msgs.inc");
include_once($path_to_root . "/includes/prefs/sysprefs.inc");

with

include_once($path_to_root . "/includes/current_user.inc");
include_once($path_to_root . "/includes/lang/language.inc");
include_once($path_to_root . "/includes/ajax.inc");
include_once($path_to_root . "/includes/ui/ui_msgs.inc");
include_once($path_to_root . "/includes/prefs/sysprefs.inc");

include_once($path_to_root . "/includes/errors.inc");
// collect all error msgs
set_error_handler('error_handler' /*, errtypes */);

Re: Installation problem

That worked for installation but after installation same error appeared when running the application. Then I made the similar changes in includes/session.inc. I changed with below code

wrote:

include_once($path_to_root . "/includes/current_user.inc");
  include_once($path_to_root . "/boxygen.php");
  include_once($path_to_root . "/admin/db/security_db.inc");
  include_once($path_to_root . "/includes/lang/language.php");
  include_once($path_to_root . "/config_db.php");
  include_once($path_to_root . "/includes/ajax.inc");
  include_once($path_to_root . "/includes/ui/ui_msgs.inc");
  include_once($path_to_root . "/includes/prefs/sysprefs.inc");
 
include_once($path_to_root . "/includes/errors.inc");
// colect all error msgs
set_error_handler('error_handler' /*, errtypes */);

It worked but it gives following notice 6 times

wrote:

Notice: Trying to get property of non-object in C:\xampp\htdocs\fa241\includes\errors.inc on line 74


The Same I tried with FA2325 but during installation following error is showing

wrote:

Your PHP has to have MySQL extension enabled.

Re: Installation problem

This error has been sorted out in FA 2.4.1+ in this commit.

Replace your includes/errors.inc with this file.

Using MySQLi with FA 2.3.x has been experimented with in some post in the forum and will not work out of the box.

Re: Installation problem

OK which version of php and xampp will support 2.3.25?

Re: Installation problem

Upto FA 2.3.26+ is supported and tested on XAMPP 1.7.3 and 1.7.7 on WinXP SP3 onwards.
FA has been known to run upto PHP 5.3.x and MySQL upto v5.5.x and Apache 2.2 and 2.4 flawlessly.
FA 2.3.x series uses the MySQL driver instead of your MySQLi driver natively.

Re: Installation problem

apmuthu wrote:

This error has been sorted out in FA 2.4.1+ in this commit.

How can I follow each commit in main FA Repo?

Re: Installation problem

FA 2.4.x Commit links
https://sourceforge.net/p/frontaccounting/git/commit_browser
https://github.com/FrontAccountingERP/FA/commits/master
https://github.com/apmuthu/FA24extensions/commits/master
https://github.com/apmuthu/frontac24/commits/master

Read the wiki.

Re: Installation problem

Hi,

I had the same installation problem with FA2.4.2 and XAMPP3.2.2. Failed with:

  Fatal error: Uncaught Error: Call to undefined function user_company() in ...

I have fixed this and many deprecated messages. My changes can be found in https://github.com/PaulShipley/fa24

Cloned from https://github.com/FrontAccountingERP/FA on 14Aug2017 (last commit 5Aug2017). Tested with Windows 10 and XAMPP 3.2.2 (Apache 2.4.25, PHP 7.1.4, MariaDB 10.1.22).

Thanks

Re: Installation problem

Whilst @PaulShipley's solution does the job (and degrades gracefully), the constructors can be replaced straightaway unless they are called specifically in the code as we now officially support only PHP  5+.

From the PHP Manual:

Warning:
Old style constructors are DEPRECATED in PHP 7.0, and will be removed in a future version. You should always use __construct() in new code.

Re: Installation problem

PaulShipley wrote:

Hi,

I had the same installation problem with FA2.4.2 and XAMPP3.2.2. Failed with:

  Fatal error: Uncaught Error: Call to undefined function user_company() in ...

I have fixed this and many deprecated messages. My changes can be found in https://github.com/PaulShipley/fa24

Cloned from https://github.com/FrontAccountingERP/FA on 14Aug2017 (last commit 5Aug2017). Tested with Windows 10 and XAMPP 3.2.2 (Apache 2.4.25, PHP 7.1.4, MariaDB 10.1.22).

Thanks


I am trying with your updated code but i get following error when i click continue on the first installation page:

method_exists(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "language" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in G:\Web\htdocs\fac\install\isession.inc on line 128


I have resolved this by editing the isession.inc file by substituting:

$_SESSION['language']->set_language($_SESSION['language']->code);
    $GetText->add_domain( $_SESSION['language']->code, $path_to_root."/install/lang");

with this:

if(isset($_SESSION['language']))
{
    $_SESSION['language']->set_language($_SESSION['language']->code);
    $GetText->add_domain( $_SESSION['language']->code, $path_to_root."/install/lang");
}

Now I am able to proceed with the installation smile

Last edited by amrsha (08/16/2017 12:48:45 pm)

Re: Installation problem

apmuthu wrote:

Whilst @PaulShipley's solution does the job (and degrades gracefully), the constructors can be replaced straightaway unless they are called specifically in the code as we now officially support only PHP  5+.

From the PHP Manual:

Warning:
Old style constructors are DEPRECATED in PHP 7.0, and will be removed in a future version. You should always use __construct() in new code.

Thanks @apmuthu. I wasn't sure if any of the old style constructors were being called directly and (as you say) the solution degrades gracefully for the cost of a few extra lines. A more complete fix would be to remove the old style constructors completely and correct any issues.

Re: Installation problem

Also need to address classes in the reporting/includes/tcpdf.php and other pdf classes.