开发者

setting up symfony in a 'shared hosting' environment

I am trying to setup symfony1.4 on a server that is using Plesk.

So far I have uploaded everything to the httpdocs (httpdocs/apps, httpdocs/lib etc)folder, which is the web root.

what's the easiest way, without doing anything with vhosts.conf开发者_高级运维 files or any other symlinks on the server to get my application working?

Thanks


You should move everything except the contents of the web folder outside httpdocs. It is however possible to use httpdocs as the web root, just change the path in ProjectConfiguration.class.php like so:

$this->setWebDir(dirname(__FILE__) . '/../httpdocs');

If your shared hosting does not allow putting files outside the web root it I'd go as far as saying that you should not be deploying a symfony project there.

Shared hostings come with a bunch of other security risks, particularly with symfony1.4. Depending on the server setup, other users on the same server might be able to read and modify for example your cache files, injecting malicious code and other things.

Virtual servers really are not that expensive anymore, I'd suggest you look into one, or at least take these warnings in consideration when deploying to a shared host.


Ok, so i placed all the folders inside the httpdocs folder.

I then moved everything that was in the web folder into the httpdocs folder too, so I have:

httpdocs/css httpdocs/images httpdics/js

etc etc

I have then configured the controllers, to rather than point up a directory, ie:

require_once(dirname(__FILE__).'/../config/ProjectConfiguration.class.php');

To the following:

require_once(dirname(__FILE__).'/config/ProjectConfiguration.class.php');

Everything seems to work now.

Thanks!!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜