Sunday, March 25, 2007

CakePHP: Setting up the ACL tables

I am currently exploring my way into CakePHP. Have to say I am really enjoying working with it. Everything is starting to get clearer to me step by step.. Just now I've been struggling with getting the ACL tables properly set up. The manual suggests that I simply ran the /cake/scripts/acl.php scripts from the command line. I appeared that this was easier said than done, so here's what I eventually came up with:

  1. Open your command prompt (Windows Key + R);
  2. Move to your PHP directory (which contains php.exe)
  3. Run the following command:
    php.exe -f "x:\webroot\cake project\cake\scripts\acl.php" initdb
The script now properly executes and creates the aros, acos and acos_aros tables. Please make sure your database is properly configured and for the rest just follow on what the manual has to say!


sakhunzai said...

I have cakePHP 1.1.11 and acl.php is not working properly. DB is configured properly but script gives error on line 39 with no further explaination.

I have php4.4.4 + mysql 5.0 installed on my system

please help me solve this problem with php4 as i need to work with php4 ,its required.
Thanks in advance

Jason said...

Try doing what I did - get a copy of php5 and run acl.php using that.

Just because you create the tables using php5 to run the acl script doesn't mean you can't still just use php4 for the actual application (which is what I'm doing).