Showing posts with label development. Show all posts
Showing posts with label development. Show all posts

January 2, 2012

XAMPP, CodeIgniter and virtual hosts

This is a short tutorial for using CodeIgniter with XAMPP and setting up virtual hosts.

For developing web applications with php I use XAMPP wich is a free and easy to install Apache distribution containing MySQL, PHP and Perl. I used CakePHP for a few years but CodeIgniter is my favorite MVC php framework. 

It's very easy to install XAMPP, you just download it and than next-next-next. CodeIgniter is just the same, download, unzip and you are ready to go. The tricky part is to use virtual hosts. If you don't like to pile up all your projects in the XAMPP htdocs directory than you need to set up some virtual hosts.

I have dowloaded CodeIgniter and I've unzipped all the files to D:\temp\mydocs. To run the application I need to modify two files (XAMPP is installed on my C drive: C:\xampp\):

1. httpd-vhosts.conf from the apache (C:\xampp\apache\conf\extrahttpd-vhosts.conf)
after
NameVirtualHost *
  <VirtualHost *>
    DocumentRoot "C:\xampp\htdocs"
    ServerName localhost
  </VirtualHost>
add this:
  <VirtualHost *>
    DocumentRoot "d:\temp\mydocs"
    ServerName mydocs.local
    <Directory "D:\temp\mydocs">
      Order allow,deny
      Allow from all
    </Directory>
  </VirtualHost>

2. the host file from Windows (C:\Windows\System32\drivers\etc\hosts)
add this to the end of the file:
127.0.0.1       mydocs.local

After restarting apache I can run my project if I type http:// mydocs .local in my browser.

You can use whatever name you want for your projects (I like to use projectname.local), you only need to add the ServerName to your hosts file. You can store your project wherever you want, specify the location in the Directory.

November 20, 2010

Opencart - my choice for a shop on the web

It's been a while since my last tech post... I enjoy my work but usually it's just work and not always you get to do something that you really like. But sometimes I get to do something very interesting and than I can call my work a hobby.
My new hobby is called OpenCart. Yes, I like open source and I try to use open source as much as I can. I understand that you have to pay sometimes for software but I don't understand why you have to pay hundreds of dollars or euros for some software that you just use sometimes because you have to. And yes it is ok to pay for software if you make money using it. So this is why I will ask for some money for what I'm working on.

So you ask what am I working on... I am developing filtering options for OpenCart. If you take a look at this great shopping cart you can observe that it is a great software but it lacks some filters. So I'm developing some filters for this cart, some filters that can be fully customized. You can choose the filters for your product and you can even choose for which category to display filters.

I like OpenCart because it is open source, it is mvc and it doesn't use any templating language (like smarty).

I hope I can finish this project next week and than I will try to make an install version. I was thinking that I will ask for about 5 euros for this extensions and donate at least half of it to OpenCart :)