views:

2493

answers:

8

I tried symfony only. It was a little tricky (also because there is no command line or ssh connection in my hosting plan) to rearrange directory and linking in order to work on my hosting service, I did the same tricks on the local version to make the deployment easy but sometimes (don't know if is a cache problem or what) there were different result from the same version running on the server and on my machine.

I'm not saying I gave up with symfony but I'd like to know if there is something better before continue learning symfony.

I'm using shared hosting, so I can't use python/asp/everything else :D

The question is just the one of the title: What is the best free PHP framework working on shared hosting and why?

A: 

I have not used it, but I've heard good things about CakePHP.

theraccoonbear
A: 

You can use CodeIgniter and Zend Framework on shared hosting. I like both, but I don't have enough experience with either to break it down in detail.

Thomas Owens
+4  A: 

Like you, I was in the market for a framework with light system requirements to make sure it'd run in my shared hosting. I just started using Codeigniter -- loving it. The setup is effortless and it requires very little (if anything) from your hosting service. Run PHP 4 or 5? Done. It's very lightweight and easy to learn.

System Reqs:

  • PHP version 4.3.2 or newer.
  • A Database is required for most web application programming. Current supported databases are MySQL (4.1+), MySQLi, MS SQL, Postgre, Oracle, SQLite, and ODBC.
jmccartie
+5  A: 

We do a lot of CakePHP development, and it's definitely one of the best Rails-like MVC frameworks for PHP.

Although we don't tend to deploy to shared hosting accounts, it's perfectly possible to set it up to work with fairly standard shared hosting, although you'll not find too much documentation about it.

Assuming you've got a pretty standard shared hosting setup, with your main webroot folder in /home/username/public_html, you should setup the CakePHP environment as follows:

/home
  |
  /cakephp - complete copy of default cake folder
  |          with /cake, /app, /vendors etc left untouched
  |
  /public_html - default shared webroot folder
  |              place your customised cake /webroot folder in here with
  |              index.php, /css /js folders etc
  |
  /app - place your customised cake /app folder here, without the /webroot
         contains your /controllers, /models etc folders

Then edit your public_html/index.php so that it has the correct folder names:

if (!defined('ROOT')) {
 define('ROOT', '/home/app');
}

if (!defined('APP_DIR')) {
 define('APP_DIR', basename(dirname(dirname(__FILE__))));
}

if (!defined('CAKE_CORE_INCLUDE_PATH')) {
    define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'cakephp');
}

It's a bit fiddly, but it does work, and doing it this way has the advantage that you can upgrade your cakephp library folder without affecting your customised /app and /public_html folders.

David Heggie
A: 

Frankly, if your host doesn't let you have SSH, it's time to get a new one.

ceejayoz
Yes, sure. What price? :)
Andrea Ambu
I have been shopping. Far more don't all ssh than do.
Mike Wills
@Andrea Ambu $6/month gets you hosting with SSH at Dreamhost. $20/month gets you a virtual machine - with full root access - at Slicehost. There's little reason to settle for under-featured web hosts these days.
ceejayoz
+3  A: 

I am a fan of the Zend Framework but have recently had performance problems with a ZF application deployed in a shared hosting environment.

Since the shared hosting PHP environment uses safe_mode and open_basedir (as many others will), this imposes a considerable performance penalty on all require and include statements (of which there are an awful lot in a moderate Zend Framework app). I find that page rendering takes around 5 seconds with no calls to the database. KCacheGrind indicates that this bottleneck is due to the large number of calls to Zend_Loader which is a symptom of the large number of file includes.

Basically, using your own server where these security measures aren't in place, and using an op-code cache such as xcache would get rid of these problems.

It's worth mentioning that deploying ZF applications to a shared host isn't too problematic, other than having to manipulate your folder structure slightly if you aren't able to create folders above the world-readable folder. Often you end up putting all application folders in this folder.

DavidWinterbottom
+2  A: 

Both CodeIgniter and LightVC need no command-line configuration. Just upload the framework code with your application and you're good to go.

Bob Somers
A: 

Rasmus ledorf(creator of php) tested performance of al the framework and most of those frameworks performance is not that good. He recommended using codeigniter(http://codeigniter.com/) which i also liked because performance was good.

See http://hublog.hubmed.org/archives/001748.html for video/slides to his presentation which I think was really interesting.

Recently I also discovered recess framework(http://www.recessframework.org/) which I also like but I have not yet tried to benchmark performance for that framework like Rasmus did in his presentation.

Alfred