Google

Tuesday, April 28, 2009

CakePHP or CodeIgniter

I’m deciding which framework to use, there are lots of pros and cons for both framework.  Personally I have experience in CodeIgniter, which I find it is fairly easy to use/ master. 

On the other hand, as the new company using CakePHP, I wanted to jump into the bakery world, but something stops me.

No doubt about it, lots of people are supporting CakePHP, if you type CakePHP vs CodeIgniter on Google, it will returns you tons of result.  I have a tight deadline to meet.  To pick up a new framework might not be a wise choice at this time.

At the documentation helps me to decide, CakePHP produce a bad use guide if compare to CodeIgniter.  As for me, I came from CI, I think I will stick to CI for the time being. 

I have decided, CodeIgniter is the way to go!  But I will revisit CakePHP, and definitely will get to know more about it.  Hopefully the future version will provide a better user guide and documentation.

Wednesday, April 22, 2009

Apache - Making Localhost and Virtual Hosts (vhosts) Work Together

I’ve been searching for this for quite sometimes almost forget about it.  Anyway, I’ve found the solution here to share…

If you have a situation that you want to round your live site from your machine, you can always change the hosts file and your conf file.  Example, you want to make local version www.mysite.com accessible

Add setting in your Apache Configuration file (httpd.conf), for me I prefer to add in a new file so that it will not mixed up

# Virtual hosts
#Include conf/extra/httpd-vhosts.conf

Include conf/extra/mysite-vhosts.conf

 

In mysite-vhost.conf, you have to set

<VirtualHost *:80>
ServerAdmin anyemailaddress@anymail.com
DocumentRoot "C:/Apache/htdocs/mysite.com"
    ServerName www.mysite.com
    ErrorLog "logs/mysite.com.log"
    CustomLog "logs/mysite.com-access.log" common
</VirtualHost>

 

Pre-create the log file if Apache prompt you error when restarting.

Next, change your hosts file to (your hosts file located in [Windows] C:/windows/system32/drivers/etc/hosts)

Do this: (you can access via mysite.com or www.mysite.com)

127.0.0.1       localhost
127.0.0.1       mysite.com
127.0.0.1       www.mysite.com

 

If you restarted your apache right now and have other file that located in your htdocs folder, these site will not be accessible, for example your http://localhost/test will not work.  The solution:

<VirtualHost _default_:80>
    DocumentRoot C:/Apache/htdocs
</VirtualHost>

Restart your apache and DONE!

Enjoy coding!!!

Ups and Downs

Everything seems so right, you have planned for each and everything. But you forget you depend on something to achieve your plan, what if the something failed?

Life is full of obstacles, there are ups and downs.  You will never stay down forever, and you will never stay up forever; you will go up one day, you will drop down one day.

I believe in law of attractions, if you have negative thinking, everything around you will turn bad, from bad to worse.  Bad energy attracted by your negative thinking.  I told myself, when things fall apart, be calm. 

So now I dropped from the top, the worst thing had happened, the good thing is I will no go down anymore, there is one and only way to carry on, climb up.

Time to take a break, you can never start a new and more exciting chapter if you did not end the previous one.  So do not stop if you face problem, the only you will fail if your stop trying.

nonono There are more than one beach around, look around you might find a better one.  Bring along your dogs, bicycle and your swimming suit definitely there will be useful in elsewhere!