tags:

views:

310

answers:

6

Hi all

This may seem like a daft question, but i was wondering about how to use MVC frameworks on hosted servers.

I am playing about (albeit slowly) at home with the RoR on Ubuntu and understand that if i want to do a live site then i need hosting with Rails and Ruby.

However, what happens about the PHP frameworks. For example i have seen in the past all about the CakePHP but lately i have just come across the Symfony project and was thinking that if i had a server stack set up i could develop at home, how would i go about deploying anything live.

How do i use php command line on live servers, and how would i go about installing the framework on another server.

This is all hyperthetical at the moment as i am just thinking about it, but it is a question that i have thought of in the past.

Regards

+2  A: 

Not every framework needs things installed or configured via the command line or even the php.ini file. I believe CodeIgnitor is like this - you can just put the path to the base CI directory in the path and off you go. I'm sure there's documentation about how to use symfony on a hosting solution. In fact, this document explains how to use symfony on shared hosting.

Thomas Owens
Thanks (all) for this.I shall have to give this a go and see what happens.
+2  A: 

Most MVC frameworks* (Kohana, Zend Framework, for example) can be installed anywhere on the server. The front controller in the document root then specifies where it is, and loads it from there. So basically, you put the framework directory somewhere, and then have your front controller load it. ZF and Kohana in particular both have quickstart tutorials for getting this set up.

As for using the PHP command line... it's just the "php" command. Run "php -v" to see what version you have.

(*MVC frameworks using the front controller pattern means that your web server's document tree really only contains one thing: the front controller file. For example, if you installed your framework at /home/username/frameworks/Kohana_2.2, and your Apache docroot is /home/username/document_root, then you'd have index.php in there, and all it would contain is something like this:

<?php
require_once("/home/username/frameworks/Kohana_2.2/system/core/Bootstrap.php");

(There'd be other configuration stuff, but there you go.))

dirtside
Running the php command line depends on whether it is installed - some distros package it separately as php-cli or something.
DGM
A: 

Yes, I have used CakePHP without using the cake command line stuff. As long as the hosting supports php4 or 5 you should be good to go.

mrinject
A: 

I don't know much about RoR deployment other than I've heard it can be a pain to deploy, but I believe there has been some good work in this area. Obviously yes, you would need a host with RoR (personally I use Dreamhost).

The PHP frameworks generally don't require actual installation, they are just a collection of PHP files that you dump in your website folder on the server. You usually have to configure an .htaccess file to route everything through a single index.php file, but you'll have to do that locally anyway. Again I have to admit I've never tried to use CakePHP on a server, but I have setup CodeIgniter before and it really is that simple.

If you're looking at MonoRail .NET MVC framework in a shared hosting environment, good luck! I've done it before and it took me ages, not to mention my own custom build of MonoRail. If you are interested I can try and dig up my notes, but you seem to be more keen on RoR/PHP.

roryf
A: 

MVC framworks should be hosting independant. But of course they are coded in a programming language so the hosting is important. Apart from that is a matter of permissions. Do you need to modify config files? do you need to access to certain directories? connect to a database? Sure, like any program. But the framework do no need to be preinstalled.

I did play with CakePHP a few months ago and it didn't seem to need any kind of special powers. MVC frameworks are not an extension of the programming language so I seemed quited logical.

I would like to give you more details but I would need to know the specific framework as it dependes on a one by one basis. Anyway, if you need to read or modify any file you can always try asking your hosting.

borjab
Thanks for your comments. At the moment it was simply just a general check i was after. Although i have read more into Symfony and i am interested in trying it further.The host company i use is streamline.net.Thanks anyway to all.
A: 

Hi,

Some hosts include frameworks installed on their servers so you only have to upload your project. You can look in google with something like "symfony hosting".

Pablo

Ah right, never thought of it like this but it makes blatant sense. Cheers
or you can surf directly to www.servergrove.com
tharkun