Jump to navigation Jump to search

Installing CakePHP

865 bytes added, 01:00, 24 November 2010
no edit summary
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
=[ This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page]=
Since the Cake Wiki is down, i am reposting relevant parts of the tutorial i wrote there regarding using cake and the uniform server [ originally]. Learn more about cake at or simply
The uniform server doesn't "&quot;install" &quot; so much as you just unpack it. I recommend unpacking it in the root of a drive and not buried somewhere in a special "&quot;my documents" &quot; or desktop folder, so like, "&quot;c:\"&quot;. Once you have unpacked it, you have to follow the instructions that come with the php4 plugin and the unitray. I prefer to install the php4 plugin because, although cake runs on php5, most hosting services do not run php5, so i want to make sure my development environment is the same just in case there are any issues (especially with vendor classes). anyway it's simple: you just replace some crap into the uniserver/diskw/usr/local/php folder and change one line in your apache's httpd.conf (all described in the plugin's readme). installing the unitray is also easy, but to make the unitray compatible with uniserver 3.3 (not 3.2) you have to change one line in the uniserver\diskw\plugins\UniTray\unitray.ini file from "&quot;Start.bat" &quot; to "&quot;Server_Start.bat" &quot; under the "&quot;StartUniServer" &quot; section. no biggie, and then we get to use the ultra-handy shortcuts on the uniserver system tray icon. you can also launch the unitray now and/or make a shortcut in your startup items folder if you like.
Action: run; FileName: "&quot;%USRoot%\Start.bat"&quot;; ShowCmd: hidden; Flags: waituntilterminated<&lt;/pre><&gt;&lt;/code>&gt;
change to:
Action: run; FileName: "&quot;%USRoot%\Server_Start.bat"&quot;; ShowCmd: hidden; Flags: waituntilterminated<&lt;/pre><&gt;&lt;/code>&gt;
Since the unifrom server doesn't perform a fancy install, we can manually add the directory that the php.exe executable is located in to the windows PATH environment variable so that we can run command-line php scripts easier. this is optional but good. to do it, you go to the system control panel, "&quot;advanced" &quot; tab, "&quot;environment variables" &quot; button, then highlight "&quot;PATH" &quot; in the "&quot;system variables" &quot; then "&quot;edit" &quot; and then to the end of whatever is already there append this: "&quot;;w:\usr\local\php"&quot;. "&quot;W:"&quot;? you ask? well once you actually fire up the uniform server it launches a virtual drive called w: so it doesn't really matter where you run it from. if you decide not to edit the path setting, you will have to call php with a complete path (do you remember how to use the command line?).
We have to edit the php.ini located in w:\usr\local\php (or just go to the unitray and hit "&quot;advanced" &quot; and "&quot;edit php configuration"&quot;) and search for the line that says "&quot;max_execution_time" &quot; and increase it from 30 to maybe 300 or something. otherwise command line scripts keep timing out.
; Resource Limits ;
max_execution_time = 300
; Maximum execution time of each script, in seconds
One final thing we have to do is change the httpd.conf to allow us to use the awesome powers of apache's rewrite module. Again you can use the unitray to open the httpd.conf quickly in "&quot;advanced" &quot; then "&quot;edit apache configuration"&quot;. All you have to do is add the option "&quot;SymLinksIfOwnerMatch"&quot;. Without that apache 2.0 assumes that the rewrite rules essential to cake's operation are forbidden.
# The Options directive is both complicated and important. Please see
Options Indexes Includes SymLinksIfOwnerMatch
Finally we can launch the server. to do so use the uniserver/server_start.bat file or use the unitray's "&quot;start uniserver" &quot; option. this will open up an admin panel that will show you uniserver's various features, the only one you need to care about now is the "&quot;start mysql"&quot;, but we don’t need to use it yet since we will still be restarting the server once first.
in the httpd.conf you should also change the document root to point to the "&quot;webroot" &quot; folder of your cake install. for a development environment, this makes things easier because you can change your document root to the webroot of whatever app you are working on and reset the uniform server. (that way you can also share the cake folder amongst many apps, which is even handier if you add virtual host directives for each project, as well as corresponding entries to your windows/system32/drivers/etc/hosts file.)
from here you unpack cake into your document root, so that inside your www directory you have a "&quot;cake" &quot; folder and your various app folders, which won't be named "&quot;app" &quot; unless you only have one project. done this way, i don't think you even have to edit the app/webroot/index.php file (you can split up the cake files any way you want, in production for example, you may want only the app/webroot folder's contents to be in your hosting space's public_html folder, and the app folder and cake folders to be in your non-public user folder, in which case you will have to edit the app/webroot/index.php in at least one place -- see the cake site for instructions on all kinds of different filesystem configurations, but remember, you should not have to edit the .htaccess files or anything in the cake folder or anything other than the three constants in the index.php file in app/webroot to get cake working). next, edit your app/config/database.config file, and start baking (ie: open a command prompt inside w:/www/cake/scripts/ and type: "&quot;w:\usr\local\php\php.exe bake.php -help" &quot; or just "&quot;php.exe bake.php -help" &quot; if you did the path setting step above).
I know this tutorial had a lot more beginner instructions on baking a basic app, but a lot has changed since then anyway and mostly i just wanted to repost this uniform-server-specific info. hope someone finds it useful.


Navigation menu