I connected Images to Recipes in my CakePHP models now, so if you open the recipe details page you can see all attached images. I want to use phpthumb to generated thumbnail for all images so I added the package to the vendor directory. The workflow for this should enable the user to upload an image while editing recipe details and phpthumbnail should then generate the thumbnail on the fly. This is only possible if the GD library is installed, so the user should disable this feature from the configuration page if neccessary. If it is turned off, the recipe details page could show the full image or just links to the image files.
June 2007
Thu 7 Jun 2007
Wed 6 Jun 2007
Today I had an issue with my installation of CakePHP on my local XAMPP development installation. The prototype of the new Crisoft won’t show up! I had no idea of what was going wrong, so I took a deep look in my httpd.conf, the error.log and the .htaccess of CakePHP. And now Crisoft is up and running.
Here is what I my configuration files look like:
httpd.conf
You have to load the Module mod_rewrite (and perhaps the mod_cache) to enable CakePHPs scaffolding magic. After that I created an Alias to make my project directory available to XAMPP. This enables me to load the URL http://localhost/crisoft in my webbrowser and have access to the XAMPP tools in the default DocumentRoot, too. You should do that too if you want to develop with XAMPP.
...
LoadModule cache_module modules/mod_cache.so
LoadModule rewrite_module modules/mod_rewrite.so
...
<IfModule alias_module>
ScriptAlias /cgi-bin/ "C:/Programme/xampp/cgi-bin/"
Alias /crisoft "C:/enter/your/path/to/crisoftricette/"
</IfModule>
...
<Directory "C:/enter/your/path/to/crisoftricette/">
Options FollowSymLinks Includes
AllowOverride All
Order allow,deny
Allow from all
</Directory>
core.php
Next was the $CAKEPHP/app/config/core.php from CakePHP. The default setting should work, but be sure to check if this line in your file:
...
// define ('BASE_URL', env('SCRIPT_NAME'));
...
.htaccess
What I didn’t understand was the need of a new line in all .htaccess files. I had to tell Apache to apply the RewriteRules to my Alias directory. This was a bit hard, but the CakePHP Google Group is a good place to search for help.
<IfModule mod_rewrite.c> RewriteEngine on RewriteBase /crisoft RewriteRule ^$ webroot/ [L] RewriteRule (.*) webroot/$1 [L] </IfModule>
So this was my little fight with XAMPP and CakePHP. I will include this in a small document and upload it to the CVS branch. If you’re interested in the current state, please feel free to checkout the current dev snapshot. But don’t expect it to run. And if you don’t know if it is worth the pain, here are 2 screenshots of the current state:
This is the “recipe details” page, automagicall created by CakePHP. I will design a better one later, but having CakePHP generating the page is so comfortable for development, because you don’t have to change the page for every little change in the source code.
This is the best at all: Relations! You can tell CakePHP that your model Recipe hasMany Comments and belongsTo Category. And so you click around the pages that are already LINKED TO EACH OTHER!

