Topic: Can't add new company

Hi

I am using FrontAccounting 2.2.7 and I want add new company. I have made new fresh install but still the same problem.
I am getting always fallowing error:
Cannot open the extension setup file '../company/1/installed_extensions.php' for writing.
And filebase and database tables for new company are not created. Meanwhile it shows me in company lists - but I can't log-in with this company - as its shows, that all tables are missing and admin is unknow user.

I even made two screenshots of this.
I want to add Portal Invest OÜ and how You can see - I am getting errors and no files/tables are created.

So - where can be problem. I made three absolutely fresh install - but still the same thing.

Look the screenshots: http://spottraining.org/2010/04/02/frontaccounting-errors/

Re: Can't add new company

You have invalid permissions set on some parts of your installation. Look into System Diagnostics screen to find what is wrong.
Janusz

Re: Can't add new company

Look, what is wrong?
http://spottraining.org/2010/04/02/frontaccounting-v2/
How I understand - all permissions are OK.
It shows error, that company 1 is not writable - but it doesn't have even this directory.

Re: Can't add new company

No, they are not. At least company directory and all its subdirs should be writable. Probably you have ignored problems signalized during FA install, so when you try add new company the related company folder cannot be created.

Janusz

Re: Can't add new company

That and is the problem - I installed three times it and all permissions are fine.

I renamed config files for restarting again the installer and here is the screen:
http://spottraining.org/wp-content/uploads/2010/04/front5.png

company directory and all its subfolders are 777 permissions.

So any other ideas?

Re: Can't add new company

Perhaps this is something to do with sub-domains.
I have found that FrontAccounting gets quirky when using the subdomain

ex. Installing on http://sub.domain.com/ wnet through fine except for some last screen hang. The files etc all created ok but could not login. The alternative http://domain.com/sub/ worked out for me.

Imay be off base on this but this issue troubled my installation.

Re: Can't add new company

If you fixed the wrong permissions on company folders, the situation has changed, so what is the error message now? Surely when you have note that some file cannot be  written this is permissions problem.

zenx, seems subdomain folder is not writable. FA does not need to know exact place of installation as it use only relative urls, so thihave to be local site setup problem.

Janusz

8 (edited by spott 04/03/2010 06:42:48 am)

Re: Can't add new company

I haven't changed any permissions - I only showing You that all permissions are set to 777 - even installer confirms, that it can be write to company folder. And even sub-domain folder is writable.
Look my added pictures - there You can see - that all permissions are fine.

EDIT: checked with other installation - its not related with sub-domain.

Re: Can't add new company

I can't understand, why its doesn't make any folders or what FA looking?
Can some-one confirm overall, that creating new companys working with latest FA? Maybe it is bug inside.

Re: Can't add new company

I can confirm that installing a company with latest release (2.2.7) works.  I even had it installed at a subdomain (FA.DOMAIN.COM)

Joe

Re: Can't add new company

But what is then wrong with my installation?

Re: Can't add new company

I have now set up 4 different companies in 4 different subdomains, so that part works well.

I wonder if the problem has to do with your host? On some shared hosts, you can only use one database, hence the 0,1 etc. on set up.

Look at your company setup screen when you are adding a new company. What is the table pref that you are using? It defaults to 1, however, that you would use only if you are on a shared host or if your local setup will not allow multiple databases. I notice from your screen shot that you are writing to the same database, yet you have no table pref set for the second company.

Try setting up a different database for the additional companies, and setting table pref to "none" on the company setup, pointing the new company to the new database.

Let us know if that works... good luck.

Janusz, please step in if I got any of this incorrect, but it seems to work for me.

Re: Can't add new company

Yes, if you use one database for more than one company you _have_to_ use prefixes for all of them. Thank you for pointing this out, I have not found it on first glance. I will inspect checking procedures in Create Company screen and eventually fix this in sources.
Janusz

Re: Can't add new company

My first company has prefix 0 and all other company's, when I am creating them - FrontAccounting letting to chose 1 or none for prefix.

Now I switched on the debug mode and checked out all setup check messages. Everywhere I get OK - except installed_extensions.php file. File is chomd 777 with all write permissions - but it still shows this error.

And now, when I try add new company, I am getting fallowing errors (debug is switched on)
Undefined index: tbpref in file: /home/portal/domains/portalinvest.com/public_html/intra/admin/create_coy.php at line 150
Undefined index: tbpref in file: /home/portal/domains/portalinvest.com/public_html/intra/admin/db/maintenance_db.inc at line 92
Cannot open the extension setup file '../company/1/installed_extensions.php' for writing.
Undefined index: tbpref in file: /home/portal/domains/portalinvest.com/public_html/intra/admin/create_coy.php at line 281

But table pref is 1_ from setup screen and I checked before database - there is only 0_ tables - so 1_ is free.

avb3 wrote:

I have now set up 4 different companies in 4 different subdomains, so that part works well.

I wonder if the problem has to do with your host? On some shared hosts, you can only use one database, hence the 0,1 etc. on set up.

Look at your company setup screen when you are adding a new company. What is the table pref that you are using? It defaults to 1, however, that you would use only if you are on a shared host or if your local setup will not allow multiple databases. I notice from your screen shot that you are writing to the same database, yet you have no table pref set for the second company.

Try setting up a different database for the additional companies, and setting table pref to "none" on the company setup, pointing the new company to the new database.

Let us know if that works... good luck.

Janusz, please step in if I got any of this incorrect, but it seems to work for me.

Re: Can't add new company

spott wrote:

My first company has prefix 0 and all other company's, when I am creating them - FrontAccounting letting to chose 1 or none for prefix.

System offers both prefixed and non-prefixed tables in selector, but the selected option is checked on save and usage of both prefixed and non-prefixed tables in the same database is forbidden (check error is displayed in this case and company is not created).

Now I switched on the debug mode and checked out all setup check messages. Everywhere I get OK - except installed_extensions.php file. File is chomd 777 with all write permissions - but it still shows this error.

No idea why the file is not writable on your system, but surely it have to be writable for www server process to perform company creation without errors.

And now, when I try add new company, I am getting fallowing errors (debug is switched on)
Undefined index: tbpref in file: /home/portal/domains/portalinvest.com/public_html/intra/admin/create_coy.php at line 150
Undefined index: tbpref in file: /home/portal/domains/portalinvest.com/public_html/intra/admin/db/maintenance_db.inc at line 92
Cannot open the extension setup file '../company/1/installed_extensions.php' for writing.
Undefined index: tbpref in file: /home/portal/domains/portalinvest.com/public_html/intra/admin/create_coy.php at line 281

It mean that company/1 folder is not writable for server (or cannot be created), or the file is readonly.

Janusz

Re: Can't add new company

the company folder is with permissions 777 and system check also confirms, that FA can write to this directory.
But where FA wants to copy these folders? Maye is in this place something wrong with permissions.

Re: Can't add new company

Now I found what is the problem. And here is some comment to developers - error messages needs to be better - or wiki updated.

I want empty company with empty chart of account to make new chart of account for Estonia. So - I did not upload any SQL scripts, as I first understand, that this is for pre made chart of accounts or when You want set up tables in new database.
And that was the problem. As I now see - it is impossible to make company without choosing and uploading SQL script. And how all can see - error messages are far far from this point - all pointing to some permission problem.

So please make for futher these messages better - when no sql file are chosen - then and error message need to say it - not that: Cannot open the extension setup file '../company/1/installed_extensions.php' for writing.

Re: Can't add new company

Yes, this is a bug. There is no big sense in creating company without creating database based on provided script at the same time. Will be fixed n next minor release. Thank you for pointing this out.
Janusz

Re: Can't add new company

Bug fixed. CVS Main trunk updated. Affected file /admin/create_coy.php.

You can download the file here:



/Joe

Re: Can't add new company

Where do you get the script necessary to create the tables for the database when adding a new company? Both (1) using the same database as existing company and choosing 1_ for table pref, and (2) using a new database and choosing NONE in table pref.

Re: Can't add new company

Two scripts for US are included in distribution package (those are /sql/en_US-*.sql files). If you need another localized COA look at our 'Download Chart of Accounts 2.2' page.
Janusz