{"id":4827,"date":"2019-09-24T13:44:42","date_gmt":"2019-09-24T13:44:42","guid":{"rendered":"http:\/\/myprojects.advchaweb.com\/?p=4827"},"modified":"2019-10-04T09:38:08","modified_gmt":"2019-10-04T09:38:08","slug":"install-vtiger-7-open-source-on-ubuntu-16-04","status":"publish","type":"post","link":"https:\/\/myprojects.advchaweb.com\/index.php\/2019\/09\/24\/install-vtiger-7-open-source-on-ubuntu-16-04\/","title":{"rendered":"Install VTiger 7 Open Source On Ubuntu 16.04"},"content":{"rendered":"<p>Download from https:\/\/sourceforge.net\/projects\/vtigercrm\/<br \/>\nExtract the downloaded file.<\/p>\n<p>My environment: PHP 7.3 FPM, MySQL 5.7, Nginx<\/p>\n<p>SETUP LOCAL WITH NGINX<\/p>\n<pre class=\"lang:default decode:true\">sudo gedit \/etc\/nginx\/sites-available\/vtigercrm.test<\/pre>\n<p>content:<\/p>\n<pre class=\"lang:default decode:true\">server {\r\n    listen 80; \r\n    listen [::]:80;\r\n    root \/home\/teddy\/Documents\/works\/vtigercrm; #your document root\r\n    server_name www.vtigercrm.test vtigercrm.test ;  # Your server name\r\n    index index.php index.html index.htm ;\r\n\r\n    # Webfonts,fonts\r\n    location ~* \\.(?:ttf|ttc|otf|eot|woff|woff2)$ {\r\n        add_header \"Access-Control-Allow-Origin\" \"*\";\r\n        expires 1y;\r\n        access_log off;\r\n        add_header Cache-Control \"public\";\r\n    }\r\n\r\n    # Media: images, icons, video, audio, HTC\r\n    location ~* \\.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {\r\n        expires 1y;\r\n        access_log off;\r\n        add_header Cache-Control \"public\";\r\n    }\r\n\r\n    # Js, Css\r\n    location ~* \\.(?:css|js)$ {\r\n        expires 1y;\r\n        access_log off;\r\n        add_header Cache-Control \"public\";\r\n    }\r\n\r\n    # Serve static files without touching php\r\n    location \/ {\r\n        try_files $uri $uri\/ \/index.php?$args;\r\n    } \r\n    # pass requests for dynamic content to site\r\n    location ~ [^\/]\\.php(\/|$) {\r\n        try_files $uri \/index.php; \r\n        fastcgi_pass unix:\/run\/php\/php7.3-fpm.sock;\r\n        \r\n        fastcgi_buffers 1024 4k;\r\n\r\n        fastcgi_read_timeout 600s;\r\n        fastcgi_connect_timeout 600s;\r\n\r\n        fastcgi_index index.php;\r\n        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\r\n        #include fastcgi_params;\r\n        #FOR DEVELOPMENT MODE ONLY - BEGIN\r\n        fastcgi_param MAGE_IS_DEVELOPER_MODE true;\r\n        fastcgi_param PHP_VALUE  display_startup_errors=on;\r\n        fastcgi_param PHP_VALUE  display_errors=on;\r\n        fastcgi_param PHP_VALUE  html_errors=on;\r\n        fastcgi_param PHP_VALUE  log_errors=on;\r\n        fastcgi_param PHP_VALUE  error_log=\/home\/teddy\/Documents\/works\/vtigercrm\/var\/log\/system.log;\r\n        #FOR DEVELOPMENT MODE ONLY - END\r\n        include fastcgi_params;\r\n    }\r\n\r\n    gzip on;\r\n    gzip_disable \"msie6\";\r\n\r\n    gzip_comp_level 6;\r\n    gzip_min_length 1100;\r\n    gzip_buffers 16 8k;\r\n    gzip_proxied any;\r\n    gzip_types\r\n    text\/plain\r\n    text\/css\r\n    text\/js\r\n    text\/xml\r\n    text\/javascript\r\n    application\/javascript\r\n    application\/x-javascript\r\n    application\/json\r\n    application\/xml\r\n    application\/xml+rss\r\n    image\/svg+xml;\r\n    gzip_vary on;\r\n\r\n    # Banned locations (only reached if the earlier PHP entry point regexes don't match)\r\n    location ~* (\\.php$|\\.htaccess$|\\.git) {\r\n        deny all;\r\n    }\r\n}<\/pre>\n<ul>\n<li>Enable file config\n<pre class=\"lang:default decode:true\">sudo ln -s \/etc\/nginx\/sites-available\/vtigercrm.test \/etc\/nginx\/sites-enabled\/vtigercrm.test<\/pre>\n<\/li>\n<li>Register the host on my system\n<pre class=\"lang:default decode:true\">sudo gedit \/etc\/hosts<\/pre>\n<p>Like this:<\/p>\n<pre class=\"lang:default decode:true\">...\r\n127.0.0.1 \tvtigercrm.test\r\n...<\/pre>\n<\/li>\n<li>CHECK THE NGINX SETTING AND RESTART IT:\n<pre class=\"lang:default decode:true\">teddy@teddy:~$ sudo nginx -t\r\nnginx: the configuration file \/etc\/nginx\/nginx.conf syntax is ok\r\nnginx: configuration file \/etc\/nginx\/nginx.conf test is successful<\/pre>\n<pre class=\"lang:default decode:true\">sudo service nginx restart<\/pre>\n<p>&nbsp;<\/li>\n<li>Set file permission and owner:\n<pre class=\"lang:default decode:true\">teddy@teddy:~\/Documents\/works$ sudo chown www-data:www-data -R vtigercrm\/<\/pre>\n<p>CREATE A NEW DATABASE: vtigercrm COLLATION utf8mb4_general_ci<\/p>\n<p>Test: http:\/\/vtigercrm.test\/ &#8211;&gt; INSTALLATION WORKING. THE INSTALLATION TOOK SAME TIME<\/p>\n<p>Admin<br \/>\nusername: admin<br \/>\npassword: Admtiger<\/p>\n<p>BUT I GOT THIS ERROR:<\/p>\n<pre class=\"lang:default decode:true\">MySQL Server should be configured with:\r\nsql_mode = ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION<\/pre>\n<p>DEBUG STEP:<br \/>\n\/vtigercrm\/languages\/en_us\/Install.php:<\/p>\n<pre class=\"lang:default decode:true \">'ERR_DB_SQLMODE_NOTFRIENDLY' =&gt; 'MySQL Server should be configured with:&lt;br&gt; sql_mode = ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION',<\/pre>\n<p>\/vtigercrm\/modules\/Install\/models\/Utils.php:<\/p>\n<pre class=\"lang:default decode:true\">...\r\npublic static function checkDbConnection($db_type, $db_hostname, $db_username, $db_password, $db_name, $create_db=false, $create_utf8_db=true, $root_user='', $root_password='') {\r\n    ...\r\n    $db_sqlmode_support = false; \/\/ does the database having friendly sql_mode?\r\n\r\n    \/\/Checking for database connection parameters\r\n    if($db_type) {\r\n        ...\r\n        if(@$conn-&gt;Connect($db_hostname,$db_username,$db_password)) {\r\n            ...\r\n            $db_sqlmode_support = self::isMySQLSqlModeFriendly($conn);\r\n            if($create_db &amp;&amp; $db_sqlmode_support) {\r\n                ...\r\n            }\r\n\r\n            ...\r\n        }\r\n    }\r\n    ...\r\n\r\n    if(!$db_type_status || !$db_server_status) {\r\n        ...\r\n    } elseif(!$db_sqlmode_support) {\r\n        $error_msg = getTranslatedString('ERR_DB_SQLMODE_NOTFRIENDLY', 'Install');\r\n    } elseif($db_creation_failed) {\r\n        ...\r\n    }\r\n    ...\r\n}\r\n...\r\npublic static function isMySQLSqlModeFriendly($conn) {\r\n    $rs = $conn-&gt;Execute(\"SHOW VARIABLES LIKE 'sql_mode'\");\r\n    if ($rs &amp;&amp; ($row = $rs-&gt;fetchRow())) {\r\n        $values = explode(',', strtoupper($row['Value']));\r\n        $unsupported = array('ONLY_FULL_GROUP_BY', 'STRICT_TRANS_TABLES', 'NO_ZERO_IN_DATE', 'NO_ZERO_DATE');\r\n        foreach ($unsupported as $check) {\r\n            if (in_array($check, $values)) {\r\n                return false;\r\n            }\r\n        }\r\n    }\r\n    return true;\r\n}\r\n...<\/pre>\n<p>SOLUTION: MODIFY THE MYSQL SETTING IN \/etc\/mysql\/my.cnf<\/p>\n<pre class=\"lang:default decode:true \">sudo gedit \/etc\/mysql\/my.cnf<\/pre>\n<p>MODIFY THE &#8216;sql_mode&#8217; VALUES: &#8211;&gt; PLS READ: https:\/\/www.percona.com\/blog\/2016\/10\/18\/upgrading-to-mysql-5-7-beware-of-the-new-strict-mode\/<\/p>\n<pre class=\"lang:default decode:true \">...\r\n#sql_mode = \"STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION\"\r\nsql_mode = \"ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION\"\r\n...<\/pre>\n<p>SAVE AND THE RESTART MYSQL SERVICE<\/p>\n<pre class=\"lang:default decode:true \">sudo service mysql restart<\/pre>\n<p>&nbsp;<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Download from https:\/\/sourceforge.net\/projects\/vtigercrm\/ Extract the downloaded file. My environment: PHP 7.3 FPM, MySQL 5.7, Nginx SETUP LOCAL WITH NGINX sudo gedit \/etc\/nginx\/sites-available\/vtigercrm.test content: server { listen 80; listen [::]:80; root \/home\/teddy\/Documents\/works\/vtigercrm; #your document root server_name www.vtigercrm.test vtigercrm.test ; # Your server name index index.php index.html index.htm ; # Webfonts,fonts location ~* \\.(?:ttf|ttc|otf|eot|woff|woff2)$ { add_header &#8220;Access-Control-Allow-Origin&#8221; &hellip; <a href=\"https:\/\/myprojects.advchaweb.com\/index.php\/2019\/09\/24\/install-vtiger-7-open-source-on-ubuntu-16-04\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Install VTiger 7 Open Source On Ubuntu 16.04&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,78,106],"tags":[],"class_list":["post-4827","post","type-post","status-publish","format-standard","hentry","category-ubuntu","category-ubuntu-16-04","category-vtiger"],"_links":{"self":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/4827","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/comments?post=4827"}],"version-history":[{"count":7,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/4827\/revisions"}],"predecessor-version":[{"id":4932,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/4827\/revisions\/4932"}],"wp:attachment":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/media?parent=4827"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/categories?post=4827"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/tags?post=4827"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}