skein Posted March 14, 2009 Share Posted March 14, 2009 so im doing this test application. I did everything step by step as said in the book: - I created a table items - i created a file item.php in models folder <?php class Item extends AppModel { var $name = 'Item'; } ?> -I created a items_controller.php in the controllers folder <?php class ItemsController extends AppController { var $name = 'Items'; var $scaffold; } ?> But when I go to http://localhost/testapp/items it says Not Found, but the book says I should get a view rendered. What did I do wrong. Can someone help me please? Quote Link to comment https://forums.phpfreaks.com/topic/149423-cakephp-newbie-needs-help/ Share on other sites More sharing options...
pquery Posted March 29, 2009 Share Posted March 29, 2009 I'm trying to install cake on my Debian based server and I'm running into some of the same issues which you're having however I'm pretty sure I know what's going on, just not how to solve it: The first question I would ask is on your http://localhost/cake do you have a full color page with styles or a bear bones page? from http://book.cakephp.org/view/326/the-cake-blog-tutorial Occasionally a new user will run in to mod_rewrite issues, so I'll mention them marginally here. If the Cake welcome page looks a little funny (no images or css styles), it probably means mod_rewrite isn't functioning on your system. Here are some tips to help get you up and running: So it sounds like you're having mod_rewrite issues as I am (see the link for other ways to diagnose this and possibly solve if you're using apache 1.*, I'm got apache2 going on my server and things are just in the httpd.conf file anymore so I'm hoping that someone has some experience changing mod_rewrite settings for cake on apache2 Quote Link to comment https://forums.phpfreaks.com/topic/149423-cakephp-newbie-needs-help/#findComment-796097 Share on other sites More sharing options...
pquery Posted March 29, 2009 Share Posted March 29, 2009 I've actually figured out how to enable the mod_rewrite functionality on apache2 after searching around for a while, and now my first few cake applications seem to be working Here's a few ways to test if your mod_rewrite is working correctly: first take a look at your phpinfo(); and do a search for Loaded modules. you should see mod_rewrite in there - if not this is where your problem is second test - Create a .htaccess file (a text file named .htaccess) with the following code in it in a subdir Options +FollowSymLinks RewriteEngine On Save the file to a subdirectory of your main site something like this /rewrite-testfolder/.htaccess Now attempt to browse to the subdirectory (http://localhost/rewrite-testfolder/). One of two things could happen - No errors Congrats mod_rewrite engine is enabled. - 500, Internal Server Error If you get this message then mod_rewrite was not installed/enabled on your computer. This is how I fixed it on my ubuntu / debian based servers running apache2 sudo a2enmod rewrite in a terminal window this enabled the mod_rewrite module, upon refreshing the pages no more 500 server error and Cakes' tiny urls were working, also on the homepage of my cake installation everything was much more colorful and styled (at least on my umbuntu server) - these steps enabled the mod_rewrite on my debian server but didn't produce the colorful cake homepage so I'm still trying to find a solution Quote Link to comment https://forums.phpfreaks.com/topic/149423-cakephp-newbie-needs-help/#findComment-796189 Share on other sites More sharing options...
fabrydesign Posted April 5, 2009 Share Posted April 5, 2009 Way to jack the thread pquery. Skein, you have to create a view file for items. Go to app/views/ and add an items folder. Make index.ctp, and place your HTML/PHP you want displayed in the there. Then, example.com/items/ should show that index. Likewise, other functions in the controller should have their own view file in the items folder. http://book.cakephp.org/view/10/Understanding-Model-View-Controller Quote Link to comment https://forums.phpfreaks.com/topic/149423-cakephp-newbie-needs-help/#findComment-801511 Share on other sites More sharing options...
jcombs_31 Posted April 16, 2009 Share Posted April 16, 2009 Actually, by using the scaffold variable he should not have to create any views. It is likely a mod-rewrite problem like pquery mentioned. Quote Link to comment https://forums.phpfreaks.com/topic/149423-cakephp-newbie-needs-help/#findComment-811776 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.