{"id":4643,"date":"2019-08-30T04:14:01","date_gmt":"2019-08-30T04:14:01","guid":{"rendered":"http:\/\/myprojects.advchaweb.com\/?p=4643"},"modified":"2022-07-02T15:50:46","modified_gmt":"2022-07-02T15:50:46","slug":"opencart-3","status":"publish","type":"post","link":"https:\/\/myprojects.advchaweb.com\/index.php\/2019\/08\/30\/opencart-3\/","title":{"rendered":"OpenCart 3"},"content":{"rendered":"<p>Download opencart from https:\/\/www.opencart.com<br \/>\nThen extract it in your root web directory<br \/>\nRead install.txt file to setup and install opencart<\/p>\n<pre class=\"lang:default decode:true \">...\r\n2. Rename config-dist.php to config.php and admin\/config-dist.php to admin\/config.php\r\n\r\n3. For Linux\/Unix make sure the following folders and files are writable.\r\n\r\n\t\tchmod 0755 or 0777 system\/storage\/cache\/\r\n\t\tchmod 0755 or 0777 system\/storage\/download\/\r\n\t\tchmod 0755 or 0777 system\/storage\/logs\/\r\n\t\tchmod 0755 or 0777 system\/storage\/modification\/\r\n\t\tchmod 0755 or 0777 system\/storage\/session\/\r\n\t\tchmod 0755 or 0777 system\/storage\/upload\/\r\n\t\tchmod 0755 or 0777 system\/storage\/vendor\/\r\n\t\tchmod 0755 or 0777 image\/\r\n\t\tchmod 0755 or 0777 image\/cache\/\r\n\t\tchmod 0755 or 0777 image\/catalog\/\r\n\t\tchmod 0755 or 0777 config.php\r\n\t\tchmod 0755 or 0777 admin\/config.php\r\n\r\n\t\tIf 0755 does not work try 0777.\r\n...<\/pre>\n<p>Set the file permissions<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~\/Documents\/works\/opencart-3.0.3.2\/upload$ sudo chmod -R 0755 system\/*\r\n[sudo] password for teddy: \r\nteddy@teddy:~\/Documents\/works\/opencart-3.0.3.2\/upload$ sudo chmod -R 0755 image\/*\r\nteddy@teddy:~\/Documents\/works\/opencart-3.0.3.2\/upload$ sudo chmod -R 0755 config.php \r\nteddy@teddy:~\/Documents\/works\/opencart-3.0.3.2\/upload$ sudo chmod -R 0755 admin\/config.php<\/pre>\n<p>&nbsp;<\/p>\n<p>Setup with Nginx<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~\/Documents\/works\/opencart-3.0.3.2\/upload$ sudo gedit \/etc\/nginx\/sites-available\/opencart3.test<\/pre>\n<p>Here is the 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\/opencart-3.0.3.2\/upload; #your document root\r\n    server_name www.opencart3.test opencart3.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.2-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\/opencart-3.0.3.2\/upload\/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<p>NOTE: don&#8217;t forget to create the log file in var\/log\/system.log<br \/>\nThen<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~\/Documents\/works\/opencart-3.0.3.2\/upload$ sudo ln -s \/etc\/nginx\/sites-available\/opencart3.test \/etc\/nginx\/sites-enabled\/opencart3.test<\/pre>\n<p>Then<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~\/Documents\/works\/opencart-3.0.3.2\/upload$ sudo gedit \/etc\/hosts<\/pre>\n<p>Insert this line:<\/p>\n<pre class=\"lang:default decode:true \">...\r\n127.0.0.1 \topencart3.test\r\n...<\/pre>\n<p>Then check the nginx config and restart nginx<\/p>\n<pre class=\"lang:default decode:true\">teddy@teddy:~\/Documents\/works\/opencart-3.0.3.2\/upload$ sudo nginx -t\r\nnginx: [warn] conflicting server name \"\" on 0.0.0.0:80, ignored\r\nnginx: the configuration file \/etc\/nginx\/nginx.conf syntax is ok\r\nnginx: configuration file \/etc\/nginx\/nginx.conf test is successful\r\nteddy@teddy:~\/Documents\/works\/opencart-3.0.3.2\/upload$ sudo service nginx restart<\/pre>\n<p>Set the files owner<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~\/Documents\/works\/opencart-3.0.3.2\/upload$ sudo chown www-data:www-data -R .<\/pre>\n<p>Open it on your browser http:\/\/opencart3.test. For the first time, it&#8217;ll install OpenCart.<br \/>\nNote: Create a new database &#8216;opencart3&#8217; with collation utf8-general-ci<br \/>\nAdmin:<br \/>\n<span class=\"rcp-restricted-content-message\">SORRY, ONLY ADMIN CAN SHOW THIS!<\/span><br \/>\nThen follow the instructions<br \/>\nNOTE: I also need to change the PHP setting in php.ini (IN THE opencart DIR). Change some settings like<\/p>\n<pre class=\"lang:default decode:true \">...\r\n;memory_limit = 64M\r\nmemory_limit = 1280M\r\n...<\/pre>\n<p>admin url: http:\/\/opencart3.test\/admin<\/p>\n<p>opencart version 3.0.3.2 (\/home\/teddy\/Documents\/works\/opencart-3.0.3.2\/upload\/index.php)<\/p>\n<p>Create Apache2 Setting<br \/>\nCREATE A CONF<\/p>\n<pre class=\"lang:default decode:true\">sudo gedit \/etc\/apache2\/sites-available\/opencart3.test.conf<\/pre>\n<p>CONTENT<\/p>\n<pre class=\"lang:default decode:true\">&lt;VirtualHost opencart3.test:80&gt;\r\n  ServerName opencart3.test\r\n  DocumentRoot \"\/home\/satria\/Documents\/projects\/opencart-3.0.3.8\/upload\"\r\n  DirectoryIndex index.php\r\n  &lt;Directory \"\/home\/satria\/Documents\/projects\/opencart-3.0.3.8\/upload\"&gt;\r\n      AllowOverride All\r\n      Allow from All\r\n      Require all granted\r\n  &lt;\/Directory&gt;\r\n  ErrorLog \/var\/log\/apache2\/opencart3.error.log\r\n  CustomLog \/var\/log\/apache2\/opencart3.access.log combined\r\n&lt;\/VirtualHost&gt;<\/pre>\n<p>ENABLE THE VIRTUALHOST<\/p>\n<pre class=\"lang:default decode:true\">sudo a2ensite opencart3.test.conf<\/pre>\n<p>RELOAD APACHE2<\/p>\n<pre class=\"lang:default decode:true\">sudo systemctl reload apache2<\/pre>\n<p>CREATE THE HOST<\/p>\n<pre class=\"lang:default decode:true\">sudo gedit \/etc\/hosts<\/pre>\n<pre class=\"lang:default decode:true\">127.0.0.1 opencart3.test<\/pre>\n<p>RELOAD APACHE2<\/p>\n<pre class=\"lang:default decode:true\">sudo systemctl reload apache2<\/pre>\n<p>RENAME config-dist.php AND admin\/config-dist.php TO config.php TO admin\/config.php<br \/>\nSET THE FILE PERMISSIONS &amp; RELOAD APACHE2<\/p>\n<pre class=\"lang:default decode:true\">satria@teddy:~\/Documents\/projects\/opencart-3.0.3.8\/upload$ sudo chmod -R 0755 .\r\nsatria@teddy:~\/Documents\/projects\/opencart-3.0.3.8\/upload$ sudo chmod -R 0777 system\/storage\/\r\nsatria@teddy:~\/Documents\/projects\/opencart-3.0.3.8\/upload$ sudo chmod 777 config.php\r\nsatria@teddy:~\/Documents\/projects\/opencart-3.0.3.8\/upload$ sudo chmod 777 admin\/config.php\r\nsatria@teddy:~\/Documents\/projects\/opencart-3.0.3.8\/upload$ sudo chmod -R 777 image\/<\/pre>\n<p>Open: http:\/\/opencart3.test<\/p>\n<span class=\"rcp-restricted-content-message\">SORRY, ONLY ADMIN CAN SHOW THIS!<\/span>\n","protected":false},"excerpt":{"rendered":"<p>Download opencart from https:\/\/www.opencart.com Then extract it in your root web directory Read install.txt file to setup and install opencart &#8230; 2. Rename config-dist.php to config.php and admin\/config-dist.php to admin\/config.php 3. For Linux\/Unix make sure the following folders and files are writable. chmod 0755 or 0777 system\/storage\/cache\/ chmod 0755 or 0777 system\/storage\/download\/ chmod 0755 or &hellip; <a href=\"https:\/\/myprojects.advchaweb.com\/index.php\/2019\/08\/30\/opencart-3\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;OpenCart 3&#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":[102],"tags":[],"class_list":["post-4643","post","type-post","status-publish","format-standard","hentry","category-opencart"],"_links":{"self":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/4643","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=4643"}],"version-history":[{"count":9,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/4643\/revisions"}],"predecessor-version":[{"id":9814,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/4643\/revisions\/9814"}],"wp:attachment":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/media?parent=4643"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/categories?post=4643"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/tags?post=4643"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}