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.

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

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.

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.

www.boxygen.pk

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.

www.boxygen.pk

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?

www.boxygen.pk

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?

www.boxygen.pk

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.

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

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

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.

Re: Installation problem

Thanks @apmuthu. I have updated the remaining old style constructors that I missed.

Re: Installation problem

Whilst your 3 commits address the state of the codebase on the date of your fork, check to see if any subsequent changes need to be incorporated.
https://github.com/PaulShipley/fa24/commit/c78c771ef159c7df95984127a2f82895ffaec13c
https://github.com/PaulShipley/fa24/commit/0a9c6fc6c3559b15c9be9bf9417159a20869bf77
https://github.com/PaulShipley/fa24/commit/4992f088c4d299b3443d8852df2cbeeeb9460afa

A simple shell script of sed constructs to achieve the same would be in order.

Re: Installation problem

Hi @apmuthu,

I have merged my changes with current (Oct 2nd) master as one commit
https://github.com/PaulShipley/fa24/commit/3e7d2ed1d60d63b3f85654258fd07312d2e31855

and created a patch file in 
https://github.com/PaulShipley/fa24/blob/master/patches/0001-Installation-issues-with-XAMPP-3.2.2-Apache-2.4.25-P.patch


Hope this helps.

Re: Installation problem

@PaulShipley: Thanks. It has been Wiki-ed.

Although the last link in your post is correct, it may have been named wrongly: FA 2.4.25 ??

Re: Installation problem

That is the XAMPP Apache version (Apache-2.4.25). Git auto-generated the name from the commit comment. Sorry for the confusion.

Re: Installation problem

wink

Re: Installation problem

Where shall I copy this patch in FA Core to avoid this installation issue?

www.boxygen.pk

Re: Installation problem

@PaulShipley's Post #10's commit link has all the necessary files to be copied into the modules/<module name> subfolder. The patch file is used in linux CLI to apply on existing files without having to copy the other replacement files.

Re: Installation problem

Hi,

I had the same installation problem with FA2.4.7 and XAMPP3.2.4. Failed with:

Fatal error: Uncaught Error: Class 'application' not found in C:\xampp\htdocs\frontaccounting\applications\activityevents.php:12 Stack trace: #0 {main} thrown in C:\xampp\htdocs\frontaccounting\applications\activityevents.php on line 12

Re: Installation problem

Try with XAMPP v1.7.7 first.