CakePHP with Bluehost or any other Cpanel hosting.

Reading time ~1 minute


NOTE: This is for ADVANCED users. CakePHP requires an extensive knowledgebase of PHP and Object Oriented Programming. If you are not familiar with PHP or OOP this is not for you. Try installing WordPress instead.

This is for the majority of cpanel hosting companies, especially Bluehost (The greatest cpanel hosting company out there, and that's not just an opinion).

CakePHP by default comes with the core in a folder, the same folder that the app directory is also located. This is typically considered not secure. So lets fix that. Let's put our CakePHP Core in the root of your hosting account.

Step 1. Download CakePHP from their website.

Step 2. FTP your cakephp.zip file to the public_html directory (OR the folder your application will be), extract the cakephp.zip file. You should have a folder that looks like the following.

cakephp-cakephp-77aa960/
    -app/
    -build.properties
    -build.xml
    -.gitignore
    -.htaccess
    -index.php
    -lib/
    -plugins/
    -README
    -.travis.yml
    -vendors/
Step 3. Move all the files out of the app/ folder. (The contents of the App/ folder, not the folder itself)

Step 4. Move the cakephp-cakephp-77aa960/ folder to the ~/ directory. At this point I recommend renaming it to something that takes less time to type. I will call it CakeCore.

Step 5. Inside your app/ directory that you copied the contents out of [step 3] there is a subdirectory called webroot. Edit the index.php [/webroot/index.php] file and make the following change.

Original:

<?
    //define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'lib');
Change it to:

<?
    define('CAKE_CORE_INCLUDE_PATH', '/home/username/CakeCore/lib');
Bluehost has the home directory as many different things. /home, /home1, /home2 , etc followed by the official cpanel/bluehost username, which you can find on the left side of your cpanel. Be sure you replace the above with YOUR information.

THATS IT!
There should be nothing more that you have to configure. From this point on you can reuse your CakePHP Core AND get the benefit of security now that your core code cannot be touched.

Quick Laravel/Lumen install with Docker!

The default installer that comes with Laravel is great, but unfortunately that means you have to install dependencies of PHP and Laravel/...… Continue reading

PHP To Python

Published on February 24, 2016

Aftertouch in Logic Pro X and 2015 Macbook Pro

Published on February 24, 2016