Today, I’m attempting to install OpenCart, an open source ecommerce package. OpenCart was chosen as the runner-up of the 2010 Open Source Awards as published by Packt Publishing.
I first looked through the OpenCart Online Documentation. The most current stable release as of this writing is OpenCart v1.4.9.3. OpenCart requires PHP, and MySQL. I currently have both installed on my Windows Server 2008 platform. It should also work fine running under Windows IIS 7.
As a side note, the OpenCart Tools section outlines some great suggestions for free tools. I use some of them, like Jing, others I’m excited to check out.
Installation is pretty straight forward. First, download the software. I usually download to an install directory whereby I can easily start over if necessary. I then used MySQL Workbench to create an “opencart” schema and user.
Next, I created a root folder for the opencart Web Site application to reside. I then copied the contents from the “install\opencart\upload” folder to the “www\opencart” folder.
I then went into the IIS7 Manager and added the new Web Site to port 8002. I also added a binding for the local IP address “192.10.11.21”. I then opened port 8002 on the firewall.
At this point, I pointed my browser to the OpenCart Web Site and with through the installation instructions. This was a simple one step process of entering the database connection and admin account credentials. The last step is to delete the installation folder. I was unable to do this as it was in use. So I shut down the Web Server, renamed the folder, then started it back up again.
The installation should now be complete, however, when I browse to the site, it still attempts to take me to the installation page. After looking at the index.php file, I’ve noticed that it’s looking for a variable ‘DIR_APPLICATION’. This variable should be defined in the config.php file. However, when I look at the config.php file, it’s empty. So there is a problem with the installation.
I immediately think it’s a permission problem. After doing some Googling, I found several posts discussing similar issues, but nothing that definitively solving the problem. I then Googled on ‘ii7 php file permissions’ and the first result answered my question. To implement the solution, I created a “temp” folder under my “www” folder, and then altered the PHP.ini file’s “upload_tmp_dir” variable to point to the new temp file location. I then used file explorer and gave IIS_IUSRS; Read; Write’; List folder contents; Read & execute permissions to the “www” folder and sub-folders. To the “temp” folder, I gave IIS_IUSRS; Full control.
Using MySQL Workbench, I dropped and recreated the “opencart” schema. Using IIS7 Manager, I stopped the Web Service, and deleted the contents of the opencart folder and re-copied the contents back from the install\upload folder. I then re-started the Web Server, and re-ran the installation. This time, it worked fine, and the installation was complete.
After confirming I was able to browse the site, I created a robots.txt file in the root directory to prevent this site from being spidered by Google’s WebBot. Here’s the file:
# go away
User-agent: *
Disallow: /
My next hurdle was gaining access to the site administration. The username and password I provided upon installation didn’t seem to work. So I went into MySQL Workbench and looked at the “user” table, in my case the “oc_user” table. I ran a quick update as follows:
use opencart; update oc_user set password=md5('admin')
That fixed it! I am now able to get signed on to the system. I then began to configure it. That was easy!
I’ll update this post with additional findings as I continue to work with OpenCart.
You’re welcome to view my OpenCart demo site here. It will most likely only be available during the day when I’m at my desk working. If you should need help with your installation, drop me a line. I’d be happy to assist you! Good luck!
Leave a Reply
You must be logged in to post a comment.