Archive for the 'CakePHP' Category
(Chronologically Listed)
“CLI has stopped working” on Windows Vista
- Posted by Tengku Zahasman on July 22nd, 2007 filed in PHP, CakePHP
- 30 Comments »
- (6,707 Views)
I am posting this information because I want other people who’s facing the same problem as I had to be able to find the solution when searching through Google. I know I didn’t. So for PHP users who are using XAMPP on Windows Vista, pay attention (other WAMPs could be affected too)…
The Problem
Being a CakePHP baker, I had the tendency to try out the Bake script (a convenient command-line interface (CLI) tool in CakePHP which helps programmers to create all the necessary Model classes, Controller classes, and View template files based on the database schema - alongside with some optional basic CRUD methods). So after I set-up the console so that it can run PHP and the bake script, I typed in “cake” into the cmd box and pressed Enter. The Cake console appeared to be running successfully, but there is this annoying error box which kept on popping up everytime I run a command/script. This error box carried the message “CLI has stopped working”. Oddly, the CLI could still be used afterwards 

At first I thought it was a CakePHP problem, but when I tried running the command “php -v” to check the PHP information, the same problem happened. So I knew this must be a PHP problem instead of CakePHP’s.

A short Googling around suggested me that most of the people having this problem are those who uses XAMPP on Vista. Initially I decided to just forget about the problem and move on since the scripts did run without problems. But to make matters worse, everytime I start up my Komodo Edit IDE, that error box pops up like 5 times in a row. Now that annoyed me to the bone so I decided to have this problem fixed.
The Solution
I paid a visit to PHP.net in hope to find something helpful and found a line somewhere in the PHP 5.2.3 changelog that caught my attention:
“Fixed commandline handling for CLI and CGI. (Marcus, Johannes)”
Realising that the PHP version used in XAMPP is version 5.2.2, I immediately downloaded the PHP 5.2.3 binaries in hope that replacing the PHP in the XAMPP folder with the new version of PHP would fix this problem. To my amazement, it did. No more annoying pop-ups.. yay!
Update: The “Actual” Solution
Turns out that the actual culprit to this problem is the mysqli extension (mysqli_php.dll) distributed with XAMPP. So instead of replacing all of the latest PHP distribution, you only need to replace that particular extension with the one that came pre-installed with XAMPP. That is sufficient enough to get rid of the annoying alert box.
So there.. if you ever face the “CLI has stopped working” error on your Vista machine, don’t just give up and disable CLI straight away. Simply download the latest PHP binaries and replace it into where you installed PHP (eg: C:\xampp\php) overwriting everything. Practically, you may only need to replace the mysqli_php.dll extension. That should do the trick. 
Studying CakePHP 1.2 so far…
- Posted by Tengku Zahasman on July 5th, 2007 filed in CakePHP
- 1 Comment »
- (675 Views)
I have made some intensive self-study on the CakePHP 1.2 framework for the past few weeks. The learning curve that I had to go through has been quite tiring and troublesome, in an interesting way that is, since CakePHP 1.2 is still undergoing development and there are too little documentation on this version if compared to the stable version 1.1.
Cake 1.2 doesn’t have any practical manual (yet) like version 1.1. So learning this version means having to dig deep through their source files and reading the description headers for functions, going back and forth with their API documentation, browsing through the Bakery, hanging around in their official IRC channel to ask for guidance and posting quick questions, and then lots and lots of Googling around too. Yes. I find out that learning a new framework is not all easy. It takes time. Because I found out that learning a framework is almost like learning a new programming language altogether even though you already use PHP as your mother tongue. Frameworks have their own built-in functions to memorize, their own naming conventions to follow, their own unique approaches to methods and classes to get used to which are mostly way different than the usual way we write applications. But even though learning a framework is not a snap, the benefits you get after mastering it is just priceless.
There are many differences I could see in Cake 1.2 if compared to 1.1. More components added in (Auth component for doing authentications is now included! And helpers for Pagination, RSS & XML too! Oh life is getting so much easier~
)… file structures have slightly changed… tremendous change in their Model validation technique (will discuss this in later posts)… and some other changes which you can view them all here.
Comparing Web Application development frameworks
- Posted by Tengku Zahasman on June 12th, 2007 filed in CakePHP, Web App Development
- 1 Comment »
- (716 Views)
This is an interesting video I found on Google video which shows a practical comparison between developing web apps using J2EE, Zope/Plone, Ruby on Rails, TurboGears and DJango, all of which are different application frameworks utilizing various programming/scripting languages like Java, Ruby and Python. Although I mainly build applications using PHP (recently adopting CakePHP as the framework), it’s also interesting to see how other developers develop web applications using different languages and frameworks. Afterall, since CakePHP’s structure is also based on Ruby on Rails, I watched the video by assuming RoR’s advantages/disadvantages to be that of CakePHP’s. If in case you don’t know why it’s better to adopt a Web Application framework instead of writing codes from scratch, here’s why.
Current web developers will certainly appreciate this. For those of you who’s not really into programming, at least this video will give you an idea how people write Web applications. It’s quite a lenghty video (around 40 minutes in total) so sit back, relax, and enjoy the show:
If you’re wondering which Web Application framework you should use, just ask yourself which programming language that you’re highly familiar with, find a framework that uses that language, read about it a bit, and then stick to it. Jumping from frameworks to frameworks will only bring you nowhere. For PHP developers, CakePHP or CodeIgniter are a few good options to look at 

If I've provided some info that you find to be useful, don't hesitate to