Sunday, January 30, 2011

Stupid me!

Waiting for the taxi pickup.

Did the last minute shopping yesterday, and I did a very stupid & expensive mistake :(

At first I thought I get a very very good deal, who knows I bought a strange 2 layer wok, really feeling want to cry 欲哭无泪啊~~~~

Lesson learn are:
- never do thing at the last day.
- don't think it is a good deal when see there is big different in price for the 'same' thing in a shop (well, stupid me thought it was the price tag mistake, i have bad intention lah). Always checks very careful on the thing going to buy, open the box, feel it, then only pay it

哎......心疼啊
The wok cost 90 Euro, means RM 360.
And I may need to buy another one if it's required when back to Malaysia, heard it cost over 1000 for the stainless steal

I try to convince myself it's OK for single person cookin, try to make myself feeling a little bit better lah, but hor, doesn't work so much leh

Will post photo of it when I back to MY.

Thursday, January 27, 2011

Dinner DIY - Fried potatoes with onions

Tried some other cooking these few weeks.

For once, I was crazy about caramelized onions taste, which is sweet.
At first, I was cooking the fried potatoes that favor by the caramelized onions.
Very simple preparation, need only potatoes that cut in equal size slices, onions, butter, and some salt. Cook them separately, the caramelized take very long time to prepare, 20-30 mins because it needs to be slow cooking.
Frying potato slices
Slow cook onions
gao dim!

The first try doesn't looks very attractive, a little bit dry & tasteless too

So, 2nd time, it's much better :)
2nd try

But hor, the quality is remains the same after this leh. It is just OK to eat, far far from taste good :p

Sunday, January 02, 2011

CakePHP - installation

After PHP & Apache HTTP Server installation is done, I continue the setup with CakePHP.

So, my environment is:
1. Windows XP
2. Apache 2.2
3. PHP Version 5.3.4
4. CakePHP 1.3.6: Downloaded from here CakePHP 1.3.6.zip

And here is my directory structures:
1. Apache: D:/Apps/Apache2.2, I will refer this as <apache_web_server>
2. PHP: D:/Apps/PHP, I will refer this as <php.directory>
3. CakePHP: D:/Apps/cakephp_1_3_6, I will refer this as <cakephp.directory>

Configuration changes in Apache httpd.conf
Step 1) Make sure this line is there, and un-commented:
------------------------------------------------------
LoadModule rewrite_module modules/mod_rewrite.so
------------------------------------------------------

Step 2) Update the document root to the <cakephp.directory>. For e.g. in my case, it will be as follow:
------------------------------------------------------
DocumentRoot "D:/Apps/cakephp_1_3_6"
------------------------------------------------------

Step 3) Make sure the option to overwrite is enabled
------------------------------------------------------
<Directory />
Options FollowSymLinks
AllowOverride All
# Order deny,allow
# Deny from all
</Directory>
------------------------------------------------------

(Re)Start the Apache web server, try to access the application by: http://localhost/index.php, you should see a page as follow:
PHP loaded succesfully!


I faced some errors during setup, here are some that I can remember:
Problem 1) The index page doesn't load, there are warning message something as follow
------------------------------------------------------
strtotime() [http://php.net/function.strtotime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone
...
------------------------------------------------------
Solution 1) add this line to the <cakephp.directory>/app/config/core.php: ------------------------------------------------------
date_default_timezone_set('Asia/Kuala_Lumpur');
------------------------------------------------------
-> This problem seems like happen to PHP 5 onwards ??
Of course you can add different timezone, checks this out list of supported timezone

Problem 2) Index page does not contains any css, logo and etc.
Solution 2) Update the DocumentRootin the Apache httpd.conf, point it to the <cakephp.directory>, so, in my case, it will be as follow:
------------------------------------------------------
DocumentRoot "D:/Apps/Apache2.2/htdocs/cakephp_1_3_6"
------------------------------------------------------
Please note this: !! CAKEROOT should NOT be sub-directory of the Apache htdocs !!

Yeah, it is strange for me that I finally found out I have to move the CakePHP application out from the Apache default document root, which is the htdocs. But as I reference from this website, the colorful page only shown up in my local after I move it out.

So, my main reference to setup CakePHP are:
1. The CakePHP cookbook
2. Troubleshooting

I think next will be CakePHP with MySQL, hopefully I managed this by next week :)

Good luck!

Saturday, January 01, 2011

PHP & Apache HTTP Server - Installation

I heard & known that the PHP was very popular technology for rapid web development. Maybe it's good just to get my brain fresh with some technology alternative, so I decided to start the learning.

OK, first mission is to make PHP works with Apache HTTP server. As usual, since these are open source projects, a lot of information out there, but very hard to find all in one place, and usually the version might be outdated when we are looking for it.

My environment is as follow:
1. Windows XP
2. Apache HTTP server v2.2: Downloaded the httpd-2.2.17-win32-x86-openssl-0.9.8o.msi from here Apache: 2.2
3. PHP Version 5.3.4: Downloaded the php-5.3.4-Win32-VC6-x86.msi from here PHP for Windows
- Please note the installer that will work for Apache is VC6

Install the Apache HTTP server before PHP, then we can take advantage of the PHP installer that it will auto-configure the necessary details to make the Apache web server to serve PHP.

There are my local installed directory structures:
1. Apache: D:/Apps/Apache2.2, I will refer this as <apache_web_server>
2. PHP: D:/Apps/PHP, I will refer this as <php.directory>

To verify the PHP can be serve by Apache:
1. Go to <apache_web_server>/htdocs
- create a file name: phpinfo.php
- Put this line of code to the phpinfo.php file: <?php phpinfo(); ?>

2. Start the Apache web server

3. In browser, type this: http://localhost/phpinfo.php
- you should see a page as follow:
PHP loaded succesfully!


And this is the Apache httpd.conf for the section related to PHP. All lines are written by the PHP installer, exceptAddType application/x-httpd-php .php, I added it manually then it works:

------------------------------------------------------
#BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
PHPIniDir "D:/Apps/PHP/"
LoadModule php5_module "D:/Apps/PHP/php5apache2_2.dll"
AddType application/x-httpd-php .php

#END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
------------------------------------------------------

And here are some references I used to troubleshooting problem, good luck!
1. <php.directory>/install.txt
2. Setting up CakePHP with Apache

In fact, I think the 2nd reference is more useful for next blog.