adam2314 / linet3

Linet accounting application
16 stars 18 forks source link

New Install on ubuntu #669

Open tamar-it opened 8 years ago

tamar-it commented 8 years ago

Hi,

I am trying to install linet3 on ubuntu 16.04

The composer failed due to lack of memory (I have 8G RAM and 16G swap. when memory limit is not given to php - it uses all machine memory and cause high load. at the end the console crushes and the update doesn't complete)

I downloaded the yii2 from github, copying the "framework/" content into yii2 directory (https://github.com/yiisoft/yii2.git), and installed php5.6 and mbstring, mysql, mcrypt, zip, curl and sqlite3 modules for php5.6

more needed updates: https://github.com/yiisoft/yii2-bootstrap.git

Now the installer is running.

The current problems are:

I would appreciate any help Thanks

tamar-it commented 8 years ago

some nasty thing i have done in order to make a company to work: under protected directory: sed -e 's/\(CREATE TABLE|INSERT INTO \)/\1CA1_/' ./data/company.sql |sed -e 's/CREATE TABLE(CA1[[:alnum:]]+(\?[[:alnum:]]+)+)/DROP TABLE IF EXISTS\1;\n CREATE TABLE\1/' |sed -e "s/timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'/timestamp DEFAULT NULL/g" | sed -e "s/'0000-00-00 00:00:00'/NULL/g"|sed -e 's/INSERT INTOCA1_itemVatCat(id,name)/INSERT INTOCA1_itemVatCat(id,name,tax_rate)/' |mysql linet -u [username] -p

(the above code has backtick in it, it probably lost due to github Markdown) in mysql: alter table CA1_config alter column priority set default 0;

I added some lines to auth tables, but really not sure what worked (I got 403 error constantly, and something stpped it)

yhacohen commented 7 years ago

Hi. I seem to be facing the same issue. can you please described where exactly did you put those files? thanks!

tamar-it commented 7 years ago

Actually, I gave up. things hadn't work. sorry :-(

avielw commented 7 years ago

So I had the all those problems and I fixed everything.

For some reason composer needs a lot of memory. In my computer it was about 18GB (actually, because he use fork() you need about 36GB). I just created a temporary 100GB file and used it as a swap file - and it fixed the installation.

Then I had another problem. After a successful login I received an exception from php:

 PHP Warning – yii\base\ErrorException
Creating default object from empty value

    1. in /var/www/html/protected/helpers/Linet3Helper.php at line 95
    8687888990919293949596979899100101102103104

                else
                    return true;

            return $setting->value;
        }

        public static function setTheme() {
            $theme = \Yii::$app->user->getParam('theme');
            if ($theme !== '') {
                Yii::$app->view->theme->pathMap = [
                    '@app/views' => '@webroot/themes/' . $theme,
                    '@app/widgets' => '@webroot/themes/' . $theme . '/widgets',
                    '@app/modules' => '@webroot/themes/' . $theme . '/modules',
                ];
            }
        }

        public static function setSetting($id, $value) {
            if (\Yii::$app->db->schema->getTableSchema('{{%config}}') === null) {
...
...

I solve this problem by changing: if ($theme !== '') { to: if ($theme && $theme !== '') {

This is a bug that I hope they will fix!

Good luck!