View Full Version : CakePHP

Chris M
04-24-2010, 01:00 AM
Has anyone successfully installed a CakePHP application on their 4.0 account?

Are 4.0 accounts compatible with CakePHP--with the app installed at the web root, rather than in a subdirectory? Thanks.

04-24-2010, 07:09 AM
I don't see any reason way CakePHP should not work on a 4.0 account. It is simply a framework (group of php files) that you use for developing a website or app. You would simple download the files from thier site then upload them to /home/username/public_html. I'll give it a try latter today an if I run into any issues I'll let you know. Have you tried yet and if so if you ran into a problem what was it?

04-24-2010, 07:25 AM
I just downloaded the files and "installed" them with no issues. I did not place them in /home/username/public_html but see no reason why you should not be able to.

Chris M
04-24-2010, 12:22 PM
Thanks for replying. I know that I can upload files, but I thought that in order to run a Cake app at the web doc root (e.g. www.mywebsite.com/ ), you need to locate the Cake files above the doc root...and at the same time, Apache must be able to process an .htaccess within that Cake directory. (Maybe I remember wrong?)

I haven't tried it myself, because I don't have a separate 4.0 account for experimenting with. Please let me know if you get it working. To have an app running within a subdirectory, like www.mywebsite.com/cakeapp/, is not useful to me.

Chris M
04-24-2010, 12:30 PM
Hmm...the CakePHP installation guide suggests it might work:

I still have the problem that I don't have an extra 4.0 account to play with, and I am hesitant to buy one just to find out whether this setup is possible. That is why I posed the question to the forum.

I also have a separate concern, that using the framework might instantly increase the account CPU utilization above what Westhost allows for personal/business plans, and they would immediately require me to upgrade from a $10 to a $50/mo plan. But there is probably no way to find out without just trying it. :(

04-25-2010, 07:18 AM
CakePHP itself seems pretty light weight so I doubt it is going to increase your account usage by that much unless the app you develop is really complex and large.

We have .htaccess abilities in WH 4.0 so that is no issue.

You don't have to place the cake files above the public document root and in fact you have not done that with your installation. :) That would mean that they would be located in /home/username. I think you have misunderstood that. Right now you have it below the public root at /home/username/public_html/cakeapp/

The page you listed for Advanced Installation actually gives you quite a few clues into how cakePHP works. Have a look at both .htaccess and index.php in /home/username/public_html/cakeapp/. By default cakePHP is not even useing the index.php because the "code" in .htaccess tells it to send all request to /home/username/public_html/cakeapp/app/webroot/. Index.php is only used if .htaccess is not available. If you have a look at it you'll see...

* Requests collector.
* This file collects requests if:
* - no mod_rewrite is avilable or .htaccess files are not supported
* -/public is not set as a web root.
You'll also notice on line 30 - 34 defines that control directory settings. They could all be changed if you wanted. define('ROOT', dirname(__FILE__)); could be hard coded is you wanted. You could even rename the file index2.php and copy/upload to /home/username/public_html/ to test your app that is now located at /home/username/public_html/cakeapp/ I think, unless I am missing something.

Dig around some more in the documentation and I think you'll understand more. I had not looked at CakePHP for quite a few years and picked all this up just from when I started playing with it yesterday after reading your post. They seem to have really striven to make it very versatile.