How to install Web Applications such as symfony

  • Hello!

    I need a litte help with the new version 1.1.9.
    In php-frameworks like symfony you have a directory structure with many folders like apps, src, vendor that should be outside of the documentroot. Only the web folder shall be inside of the documentroot.
    In earlier versions of i-MSCP I solved that by creating a new directory "symfony" inside the mountpoint (at the same level as htdocs), removed htdocs and replaced it by a symlink pointing to "symfony/web".
    In that way everything worked as it should.

    With the new versions and the new directory protection this no longer works without issues.
    So I would like to ask what´s your recommendation to install such web application?

    Shall I put everything under 00_private? But how to link htdocs to the web subfolder?
    Of course I could COPY the contents of the web subfolder to htdocs and adjust paths, but that would break the structure and makes updates more complicated.

    So I´m very interested in your ideas.

    Kind regards

  • Hello ;

    Those folders must be put in the 00_private directory and you must just setup the correct include path. It's the same thing for Zend framework. If you need any support, feel free.


  • Wow, that was quite a fast response :)

    Okay, then I will put the complete project into 00_private. That was my guess also.
    What exactly do you mean by setup the correct include path? I would prefer to not copy any files, just link, so I can easily update the files under 00_private and do not have to copy over some files to htdocs.

    It´s not that I would just like to get it working, this is more like: Whats the best way?
    If you like, I can also write a short HowTo in the wiki for other people having the same problem/questions.

  • Re;

    I mean, your public files, including the bootstrap file (index.php) (no sure that it's called like that in symfony) should go in the htdocs directory while other files/directories should go in the 00_private directory. You must set the autoloader in correct way to be able to load files from bundle (classes from the framework). I discourage usage of symlinks. ;)


  • Well, symlinks are not really nice, but it makes some things simple.

    How would you handle a project that you checkout from git for example?
    It is not really comfortable to copy/move the web folder (which contains index.php) to htdocs each time you pull/checkout.
    This would be solved perfectly by a symlink... okay you just don´t like them ;)

    So, do you (or anyone else) have another idea that is more comfortable?
    Maybe an option to modify the document root? So you put the whole project unter htdocs and just tell i-MSCP that the document root shall be set to ".../htdocs/web".
    In my opinion not really nice, but comes without symlinks.

  • You can simply disable the Web folder protection (as reseller, just edit the domain) ;)


  • Of course I can, but it is a really nice feature!

    Maybe I will sleep over it and see what will be the best compromise... because, to be honest, none of the solutions mentioned so far can really delight me ;)
    Anyway, thank you very much for your work and your support!

  • Like Nuxwin said, copy all your project files into the private folder and include your project index file. (The project should use relative paths :D)

    Another way is to copy all the project files to the htdocs folder and secure the access with a htaccess. Then create again a /htcocs/index.php and include the projects index.php. (Again the project should use relative paths :D)

    Otherwise you should be able to create a plugin with a custom document root...