Re: Help getting started with CakePHP 2.1.3
Hi Installation procedure could be diff for diff platforms, however , first u can try the default setting as mostly it works by itself. Just access the path of your cake folder from browser through local host If these is a page with some red of green stripes , which instruction to set some salt and security , or database setting , your in the right direction. http://www.phpeveryday.com/articles/CakePHP-Installation-Quick-Start-P624.html , or follow this link. Its for old version of cake , so dont be concerned bout the dir structure and name conventions. rather follow conventions for 2.X only from the book. On Friday, June 15, 2012 5:12:22 AM UTC+5:30, BasementJack wrote: I'm trying to follow the tutorial at http://book.cakephp.org/2.0/en/installation.html I've downloaded CakePHP-2.1.3.tgz from http://pear.cakephp.org/ My folder structure doesn't match at all. I've got a /bin and /cake folder - the cake folder appears to have all the good stuff (folders for cache, config, console, controller, core, error, etc) The install guide says my folder should look like this: /cake_2_0 /app /lib /vendors /plugins .htaccess index.php /readme What needs to happen next? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Help getting started with CakePHP 2.1.3
I'm trying to follow the tutorial at http://book.cakephp.org/2.0/en/installation.html I've downloaded CakePHP-2.1.3.tgz from http://pear.cakephp.org/ My folder structure doesn't match at all. I've got a /bin and /cake folder - the cake folder appears to have all the good stuff (folders for cache, config, console, controller, core, error, etc) The install guide says my folder should look like this: /cake_2_0 /app /lib /vendors /plugins .htaccess index.php /readme What needs to happen next? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Help getting started with CakePHP 2.1.3
I vaguely remember something about a Pear channel but haven't used it. I don't know why the structure would be different. Go here for the goods: https://github.com/cakephp/cakephp/archives/2.1 You'll get an archive -- and subsequent folder -- with Git's supremely annoying naming convention but the current stable is indeed 2.1.3. On Thu, Jun 14, 2012 at 7:42 PM, BasementJack basementja...@gmail.com wrote: I'm trying to follow the tutorial at http://book.cakephp.org/2.0/en/installation.html I've downloaded CakePHP-2.1.3.tgz from http://pear.cakephp.org/ My folder structure doesn't match at all. I've got a /bin and /cake folder - the cake folder appears to have all the good stuff (folders for cache, config, console, controller, core, error, etc) The install guide says my folder should look like this: /cake_2_0 /app /lib /vendors /plugins .htaccess index.php /readme What needs to happen next? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Help getting started - getting 500 server error or 404 on tutorial
So I'm about at wits end and am about to give up in frustration after spending the last couple days messing with this. I just wanted to learn a bit about this framework and try some stuff out, but I'm not even able to get the friggin' tutorial working! I keep coming up with the same suggestions on Google searches and nothing. Hopefully it's something obvious and someone can help? I'm on Ubuntu 9.10, with apache2. I'm trying to work with the CakePHP 1.3 beta. My localhost root is at /var/www (http://localhost). I put all of the cakephp files into /var/www/cakedev (http://localhost/ cakedev). After I first copied the files over and brought up http://localhost/cakedev, it looked like everything worked. The cakephp start page came up, although there weren't any graphics or fancy styles, so maybe something wasn't right from the start. I worked through the tutorial, and went to the point where I should be able to see the basic index of my app (the files are located in /var/www/cakedev/views/recipes, so I tried http://localhost/cakedev/recipes/index) and got the normal 404 page not found error. It wasn't a Cake error, nothing in those logs, it was a regular apache 404 error. Some searches made it sound like my mod_rewrite wasn't working or set up correctly or something, so I set about doing that. I made changes to my apache2 config (/etc/apache2/sites-enabled/000-default), but when I set AllowOverride All, my localhost/cakedev gets a 500 server error. If I set it back to AllowOverride none, the default page comes up, but with neither of them does any of my app work. I'll post my files, what am I doing wrong? /etc/apache2/sites-enabled/000-default: VirtualHost *:80 ServerAdmin webmas...@localhost DocumentRoot /var/www Directory / Options FollowSymLinks AllowOverride none /Directory Directory /var/www/ Options Indexes FollowSymLinks MultiViews AllowOverride none Order allow,deny allow from all /Directory ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ Directory /usr/lib/cgi-bin AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all /Directory ErrorLog /var/log/apache2/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/access.log combined Alias /doc/ /usr/share/doc/ Directory /usr/share/doc/ Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 /Directory /VirtualHost /var/www/.htaccess: IfModule mod_rewrite.c RewriteEngine on RewriteBase / RewriteRule^$ app/webroot/[L] RewriteRule(.*) app/webroot/$1 [L] /IfModule /var/www/cakedev/app/.htaccess: IfModule mod_rewrite.c RewriteEngine on RewriteBase / RewriteRule^$webroot/[L] RewriteRule(.*) webroot/$1[L] /IfModule /var/www/cakedev/app/webroot/.htaccess: IfModule mod_rewrite.c RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] /IfModule What am I missing? Thanks for any help! Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Help getting started - getting 500 server error or 404 on tutorial
Now that you think you have mod_rewrite working properly, you might want to try setting up a separate virtual host just to see if the styles and images show up. If they do not, then mod_rewrite is still not working properly. As for the 500 internal error, that could either be a misconfiguration in your httpd.conf (or virtual hosts conf file), or possibly a programming error. However, if you're still getting 404 errors now, it sounds like your mod_rewrite still isn't working as it should. On Feb 23, 9:45 pm, edmicman ptirr...@gmail.com wrote: So I'm about at wits end and am about to give up in frustration after spending the last couple days messing with this. I just wanted to learn a bit about this framework and try some stuff out, but I'm not even able to get the friggin' tutorial working! I keep coming up with the same suggestions on Google searches and nothing. Hopefully it's something obvious and someone can help? I'm on Ubuntu 9.10, with apache2. I'm trying to work with the CakePHP 1.3 beta. My localhost root is at /var/www (http://localhost). I put all of the cakephp files into /var/www/cakedev (http://localhost/ cakedev). After I first copied the files over and brought uphttp://localhost/cakedev, it looked like everything worked. The cakephp start page came up, although there weren't any graphics or fancy styles, so maybe something wasn't right from the start. I worked through the tutorial, and went to the point where I should be able to see the basic index of my app (the files are located in /var/www/cakedev/views/recipes, so I triedhttp://localhost/cakedev/recipes/index) and got the normal 404 page not found error. It wasn't a Cake error, nothing in those logs, it was a regular apache 404 error. Some searches made it sound like my mod_rewrite wasn't working or set up correctly or something, so I set about doing that. I made changes to my apache2 config (/etc/apache2/sites-enabled/000-default), but when I set AllowOverride All, my localhost/cakedev gets a 500 server error. If I set it back to AllowOverride none, the default page comes up, but with neither of them does any of my app work. I'll post my files, what am I doing wrong? /etc/apache2/sites-enabled/000-default: VirtualHost *:80 ServerAdmin webmas...@localhost DocumentRoot /var/www Directory / Options FollowSymLinks AllowOverride none /Directory Directory /var/www/ Options Indexes FollowSymLinks MultiViews AllowOverride none Order allow,deny allow from all /Directory ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ Directory /usr/lib/cgi-bin AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all /Directory ErrorLog /var/log/apache2/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/access.log combined Alias /doc/ /usr/share/doc/ Directory /usr/share/doc/ Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 /Directory /VirtualHost /var/www/.htaccess: IfModule mod_rewrite.c RewriteEngine on RewriteBase / RewriteRule ^$ app/webroot/ [L] RewriteRule (.*) app/webroot/$1 [L] /IfModule /var/www/cakedev/app/.htaccess: IfModule mod_rewrite.c RewriteEngine on RewriteBase / RewriteRule ^$ webroot/ [L] RewriteRule (.*) webroot/$1 [L] /IfModule /var/www/cakedev/app/webroot/.htaccess: IfModule mod_rewrite.c RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] /IfModule What am I missing? Thanks for any help! Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Help getting started...
Hi everyone, I have Apache installed on my machine ( WinXP Pro SP2 ) have a number of other php based projects running fine. The test page works, but clearly the .css file is not being found. I have tested a phpinfo.php file in the root directory and the /app/ views/users/ directory for a tutorial I am working on, and it works fine in both locations. I made a cosmetic change to cake.generic.css, but the change is not being picked up ! css is attempting to find it here: link rel=stylesheet type=text/css href=/css/cake.generic.css / My default htdocs folder is: C:\Program Files\Apache Software Foundation\Apache2.2\htdocs and my folder within this is 'cake11'. Hope someone can help. regards, Dave Porter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Help getting started...
http://groups.google.com/group/cake-php/browse_thread/thread/d7c7d2bd6635a76f/e976e8d9cb6153d3?lnk=gstq=manish#e976e8d9cb6153d3 On Jan 21, 6:23 am, Dave Porter [EMAIL PROTECTED] wrote: Hi everyone, I have Apache installed on my machine ( WinXP Pro SP2 ) have a number of other php based projects running fine. The test page works, but clearly the .css file is not being found. I have tested a phpinfo.php file in the root directory and the /app/ views/users/ directory for a tutorial I am working on, and it works fine in both locations. I made a cosmetic change to cake.generic.css, but the change is not being picked up ! css is attempting to find it here: link rel=stylesheet type=text/css href=/css/cake.generic.css / My default htdocs folder is: C:\Program Files\Apache Software Foundation\Apache2.2\htdocs and my folder within this is 'cake11'. Hope someone can help. regards, Dave Porter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Help getting started...
Take a look at Section 5 here: http://manual.cakephp.org/appendix/blog_tutorial I had the same issue and the above fixed it. And when I revisited the issue, it turned out for some reason I was missing an .htaccess in the root directory. Peter Lombardo On Jan 20, 2008 8:23 PM, Dave Porter [EMAIL PROTECTED] wrote: Hi everyone, I have Apache installed on my machine ( WinXP Pro SP2 ) have a number of other php based projects running fine. The test page works, but clearly the .css file is not being found. I have tested a phpinfo.php file in the root directory and the /app/ views/users/ directory for a tutorial I am working on, and it works fine in both locations. I made a cosmetic change to cake.generic.css, but the change is not being picked up ! css is attempting to find it here: link rel=stylesheet type=text/css href=/css/cake.generic.css / My default htdocs folder is: C:\Program Files\Apache Software Foundation\Apache2.2\htdocs and my folder within this is 'cake11'. Hope someone can help. regards, Dave Porter -- Peter Lombardo [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Help getting started: creating related records
Doing all but HABTM with a multiple selectTag you have to manually manage the foreignKey's. What this means is you have to set it. Usually this means that you create one records, get the last inserted id, and use that as the foreignKey for the related records if you are saving them all in the same action. $this-ModelName1-save($this-data); $related['ModelName2']['foreignKey'] = $this-ModelName1-getLastInsertID(); $this-ModelName2-create(); $this-ModelName2-save($related); Of course there is more code in there, more fields, maybe manipulation of the $this-data array (if it has both model's information in it). But that is almost always what you have to use if you don't have the user setting the foreignKey (like picking the category for the new option). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Help getting started: creating related records
Doing all but HABTM with a multiple selectTag you have to manually manage the foreignKey's. What this means is you have to set it. Usually this means that you create one records, get the last inserted id, and use that as the foreignKey for the related records if you are saving them all in the same action. $this-ModelName1-save($this-data); $related['ModelName2']['foreignKey'] = $this-ModelName1-getLastInsertID(); $this-ModelName2-create(); $this-ModelName2-save($related); Of course there is more code in there, more fields, maybe manipulation of the $this-data array (if it has both model's information in it). But that is almost always what you have to use if you don't have the user setting the foreignKey (like picking the category for the new option). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Help getting started: creating related records
Doing all but HABTM with a multiple selectTag you have to manually manage the foreignKey's. What this means is you have to set it. Usually this means that you create one records, get the last inserted id, and use that as the foreignKey for the related records if you are saving them all in the same action. $this-ModelName1-save($this-data); $related['ModelName2']['foreignKey'] = $this-ModelName1-getLastInsertID(); $this-ModelName2-create(); $this-ModelName2-save($related); Of course there is more code in there, more fields, maybe manipulation of the $this-data array (if it has both model's information in it). But that is almost always what you have to use if you don't have the user setting the foreignKey (like picking the category for the new option). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Help getting started: creating related records
I've tried baking it, but I have problems with that as well... apparently mysql isn't compiled on the command line on my system, so it fails when I try and bake. I'd rather just fix the problem here. Anyone have any ideas? Can I provide more information to make this question easier to answer? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Help getting started: creating related records
that's how i do it. whenever i'm saving a model I know that whatever is in the data array at the time will be what is saved. so, how you get the foreign key in there doesn't really matter (at the view or in the controller) as long as it is in there it will be saved to the DB. does that answer your question? i don't know if there is a better practice or preferred method of doing this but generally i run with the foreign id in the view just how you've done it. On 25/09/06, Andrew [EMAIL PROTECTED] wrote: OK I got bake working using the hack described here: http://www.soledadpenades.com/category/cakephp/ And even with a baked version, I still have the problem. I can't imagine this is such a hard thing to overcome, can someone please help me? I'm pulling my hair out, I've been stuck at this point for two weeks! I noticed that I can insert the foreign id with this line in the view form: echo $html-hidden('Option/decision_id', 'value='.$decision['Decision']['id'].''); But that really seems like a hack. Please? Someone? I've included the original post below. Hi folks, I'm at my wit's end trying to figure out how to create a new related record... should be easy for you seasoned pros. I'll be as detailed as possible. I have two tables: decisions, and options. One decision has many options. Here's the decision model code: ?php class Decision extends AppModel { var $name = 'Decision'; var $hasMany = 'Option'; } ? and the Option model is similar. Here is the decisions_controller: ?php class DecisionsController extends AppController { var $name = 'Decisions'; var $helpers = array('Time'); function index() { $this-set('decisions', $this-Decision-findAll()); } function view($id = null) { $this-Decision-id = $id; $this-set('decision', $this-Decision-read()); } function addOption() { if(!empty($this-data)) { debug($this-data); $this-Decision-Option-save($this-data); $this-flash('Option Added', '/decisions'); } } } ? When the user is at decisions/view, they see the text of the decision and have the ability to add an option on a form. Here's the view for decisions/view: ?php echo 'h1'.$decision['Decision']['title'].'/h1' ? h3Options/h3 ?php debug($decision); ? h2Add a new option/h2 form method=post action=?php echo $html-url('/decisions/addOption/')? ?php echo $html-input('Option/option'); echo $html-submit('Save'); ? When the user submits this form, it does add a record to the options table. Here's the SQL statement it outputs: INSERT INTO `options` (`option`,`created`,`modified`) VALUES ('test','2006-09-21 07:22:29','2006-09-21 07:22:29') For some reason, however, it isn't inserting a foreign key into the option. There is a decision_id field in the options table that I would think it should populate. Note that if I turn on scaffolding, everything works fine, so I think my table structures, etc. conform to the cake conventions. Anyone see what I'm missing? Something in the view, perhaps? Thanks in advance, Andrew --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Help getting started: creating related records
I've tried baking it, but I have problems with that as well... apparently mysql isn't compiled on the command line on my system, so it fails when I try and bake. I'd rather just fix the problem here. Anyone have any ideas? Can I provide more information to make this question easier to answer? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Help getting started: creating related records
I've tried baking it, but I have problems with that as well... apparently mysql isn't compiled on the command line on my system, so it fails when I try and bake. I'd rather just fix the problem here. Anyone have any ideas? Can I provide more information to make this question easier to answer? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Help getting started: creating related records
you could try to maybe bake your view and then modify that form to work how you want it. http://wiki.cakephp.org/docs:bake Andrew wrote: Note: please ignore the line echo $html-hidden('Option/decision_id', 55); That was in there for debugging and never actually did anything. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---