How to setup Cakephp3 in a rental server ?

Hi, Michael here! Today I want to help you set up a cakephp3 project in your rental server(In my case I’m using this Japanese rental server called “Lolipop server”). Why not Laravel or some other cutting edge framework? Well, first of all, I love CakePHP and that is the only reason for it! Actually, not. The server that I’m using currently supports mainly PHP and is cheap. I want to try other cool frameworks like ROR or Django. But for now, I’ll stick to Cakephp…or Laravel. Anyway, let’s get started!

(1. Accessing the SSH of your rental server (In my case Lolipop)

https://lolipop.jp/manual/user/ssh/

First, open up your terminal and type the following and enter. You’ll probably be asked to enter your password so enter to resume.

・ssh “Your ssh account name”@”your local hostname” -p 2222

(2. After you access through ssh, go into the web folder and make a new directory for your project.

mkdir “folder name”

 

(3. Now after you cd into the new folder type in the following command to install composer. 

$ wget –no-check-certificate -O – https://getcomposer.org/installer | php

 

(4. After you finished installing composer, we can download a cakephp project from the github

$wget –no-check-certificate https://github.com/cakephp/cakephp/releases/download/3.4.2/cakephp-3-4-2.zip

 

(5. Finally, unzip the folder with a simple command

$unzip cakephp-3-4-2.zip

 

(6. Now everything looks great! But never forget to connect the project to the database!

This file should be edited, config/app.php

I don’t clearly remember but I thought you have to change the SALT settings as well, but as for me, it worked even without changing it. If some error shows up you can simply change that part.

232 ‘username’ => ‘username’,
233 ‘password’ => ‘password’,
234 ‘database’ => ‘database name’,
235 ‘encoding’ => ‘utf8’,
236 ‘timezone’ => ‘Asia/Tokyo’,

 

Now everything looks great! All you have to do this open up the URL, I mean access the webpage!

Leave a Reply

Your email address will not be published. Required fields are marked *