CentOS 7.3 with ISPConfig 3.1. Has anyone gotten CakePHP 3.1 working?

Discussion in 'General' started by kyferez, Aug 9, 2017.

  1. kyferez

    kyferez New Member

    So ISPconfig is working great on CentOS 7.3. Now I've created a new user, FTP user, and site. All working.

    Then I used this guide to install CakePHP: https://book.cakephp.org/3.0/en/installation.html, used composer to create “myapp_test” project folder which I moved to my site's folder and set the group/user permissions correctly on the folder and contents (recursively) using chown.

    I go to the URL myserver.local/myapp_test/webroot and it partly loads but I then get this error:

    Missing Controller Cake\Routing\Exception\MissingControllerException
    Error: Myapp_testController could not be found.

    Thoughts, Ideas? Anyone have CakePHP 3.x working on an ISPConfig managed server and what did you do?
     
  2. kyferez

    kyferez New Member

    Found the guide to install CakePHP does not cover the fact that there are no controllers installed by default... Once I created one per the below, it worked.

    1. Create controller
    Create a controller file in \src\Controller

    Myapp_testsController.php

    2. Do the following coding in it
    Code:
    <?php
    namespace App\Controller;
    
    use App\Controller\AppController;
    
    class Myapp_testsController extends AppController
    {
    public function index(){
    echo "Hello World!";
    }
    }
    3. Create View Folder
    Create your view folder here \src\Template"Your Controller name"
    in our case: \src\Template\Myapp_tests

    4. Create View File
    Navigate to your recently created folder i.e: \src\Template\Myapp_tests
    and create an empty file name index.ctp

    Everything will work now.
     
    till likes this.

Share This Page