开发者

Configuring a PHP framework at server side

Does using a PHP framework (CodeIgniter, Zend) require special server side setup? And if yes, is there a PHP framework which doesn't require that?

The intention would be to use a hosting server which supports plain PHP only (no framework installed - if that makes sense), and use the mentioned framework on the development machine only, which would then be preprocessed ("compiled") into plain PHP.

[Edit]

To all you guys: sorry for the newbie question, I guess I got it wrong. I have only worked in .NET so far, and I haven't done anything from scratch in PHP yet. For this small project I am supposed to do, I wanted to learn and use CodeIgniter, as it seems like a light MVC framework where I can get results quickly.

Before starting, I wanted to check with the hosting provider (from which my customer has already bought a year of hosting) said they only support Zend. So, I guess that's nonsense then?

[Edit 2]

To make my question complete, here is what their hosting package provides:

  • PHP 5 or PHP 4
  • Perl
  • CGI
  • Python
  • Tomcat / JSP Tomcat 5.5.9 / Servlet 2.4 / JSP 2.0
  • FrontPage extensions
  • Ruby On Rails
  • PHP / Zend optimizer
  • PHP / IonCube
  • Fantastico
  • DB: MySQL Server 5, PostgreSQL Server 8开发者_运维百科

To be precise, my question was (since I am a newbie after all):

Q: Which PHP frameworks do you support (Zend, CodeIgniter...)?

A: We support Zend, but not CodeIgniter

Now I am aware that the question itself is a bit dumb, so I might contact them again.


No php framework I know of needs any special server side setup. PHP frameworks are just that: plain PHP only, as you call it. PHP frameworks are nothing more than already written PHP code for you to build your further code on. Nothing special about it.

People sometimes ask question on 'how to install' this or that framework which derives from the same missconception that frameworks are some kind of bundled software that need complicated distributed installation routines. None of that. Just code you didnt' write yourself. And as that you just need to upload (or download) to server. Done.

[EDIT] after your edit: I slightly doubt the competence of your hosting company. You might have a missunderstanding with them as 'Zend' often means Zend Optimizer or Zend Guard or such. As to PHP frameworks your host doesn't need to support or not support them. It is entirely up to you what PHP code you upload to that host and who has written that code.

Some hosting companies offer framework support in a way that the frameworks are already available on their servers and are updated by your host. And surely there are a few things that can be optimized like php.ini settings. But in general it will work also without these optimized settings.

I almost never accept hostings that a client has already purchased. When I write an offer I attach the strings that the hosting is chosen by me. If I'm satisfied with what the client already has, the better for him.


The only setting you need to configure for CodeIgniter is $config['base_url'] which is used for building links and form actions. Then you should be good to go, as CodeIgniter (and all other frameworks) are just PHP and nothing more.

That said, there are of course environment issues to watch out for. If you are moving from your localhost to a server with a totally different install then there will of course be things that need to be changed, such as $config['uri_protocol'] as sometimes you will get 404's, blank pages or default controller loading when you look at other pages. This can normally be fixed by flicking through each of the uri_protocol options listed just above the option. This is not very common, just something to keep in mind.

And finally of course, don't forget to chmod your writeable upload folders and keep your DB settings correct.

Take a look at my article on "how to get CodeIgniter working on different production environments" without too much faffing with db config.


See EZMVC, it does not require server-side settings/handling.


AFAIK the only thing that is not server-independent is the rewriting of links, as Apache, nginx, IIS and others, all have different rewriting engines/syntax.


I have worked on many php frameworks such as Zend framework, Cakephp, codeigniter and YII. Of these I liked YII ( http://www.yiiframework.com ) the most because it is easy to learn, purely Object oriented and works almost like the Ruby on rails framework. It also has great documentation and is very fast. Yii unlike codeigniter works on PHP 5 only which gives it capabilities like auto loading of classes.

But the only problem with frameworks are that they require configuration settings. You cant make it work without one config file atleast.


Did you try cakephp? I am using yiiframework and I needed to do a project with php 4, so I used cakephp that I liked it too.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜