Skip to main content

Standard Procedures for CakePHP Deployment

1. Clone Source File

  1. git clone <git url>

2. Setup Database

  1. mysql -uroot -p
  2. create database <database name>;
  3. grant all on <database name>.* to '<id>'.'localhost' identified by '<password>';
  4. cd <path/to/cakephp>/app
  5. Console/cake schema create
  6. Console/cake schema update -s <update number found in app/Config/Schema/>

3. Setup PHP

Edit /etc/php.ini and add the following line:

  1. date.timezone = "Asia/Kuala_Lumpur"

4. Allow Write Access to tmp

  1. chmod -R 777 app/tmp/

5. Setup Apache

Edit /etc/httpd/conf/conf.d and change AllowOverride None to AllowOverride All in <Directory "/var/www/html"> tag. Then, restart httpd:

  1. sudo systemctl restart httpd

(OPTIONAL) SELinux

  1. sudo setsebool -P allow_httpd_anon_write on
  2. sudo setsebool -P allow_httpd_sys_script_anon_write on
  3. sudo setsebool -P httpd_unified 0
  4. sudo chcon -R -t httpd_sys_rw_content_t <path_to_cakephp_app>/app/tmp/