I always do that on payable hostings but on free hostings where I am
inside catalog /public_html this is too little. You can check Your
BACKEND (not frontend) links - they have '/web'. I tested and checked
it many times - only solution is add to lib/request/
sfWebRequest.class.php:
                if (isset($this->pathInfoArray['SCRIPT_NAME']) &&
preg_match('#^/web/#', $this->pathInfoArray['SCRIPT_NAME']))
                {
                  $this->pathInfoArray['SCRIPT_NAME'] =
                  preg_replace('#^/web/#', '/', $this->pathInfoArray
['SCRIPT_NAME']);
                }
As you see this code works only when links have got '/web' - I checked
it on payable hostings where I could used the same solution as You
Alexandru and on free hostings where I had to upload all Symfony files
to '/public_html'. Thx this code each person could place all Symfony
files in /public_html catalog + create there file .htaccess with code:
Options +FollowSymLinks +ExecCGI

<IfModule mod_rewrite.c>
RewriteEngine On

RewriteRule ^(.*)$ /web/$1 [QSA,L]
</IfModule>

And everything will work. This solution is from polish site about
publication Symfony website:
http://blog.szalega.pl/3/instalacja-symfony-w-homepl



On 27 Lis, 11:56, Alexandru-Emil Lupu <[email protected]> wrote:
> Hi!
> Then move it in public_html, and modify the files that i mentioned in the
> previous mail to match those directories.
> Also, after that restrict web access with a htaccess rule.
> If you cannot do that either, just change your hosting provider. :)
>
> Alecs
>
>
>
> On Fri, Nov 27, 2009 at 12:42 PM, dziobacz <[email protected]> wrote:
> > Alexandru I thought about something else :) Where do you place on the
> > server Symfony catalogs: apps, cache, config, lib etc. ?? I think
> > above catalog /public_html on the server. so you have:
> > - access-logs
> > - etc
> > - mail
> > - public_ftp
> > - public_html
> >     - cgi-bin
> >    - css
> >    - images
> >    - js
> >    - ...
> > - sf_project
> >    - apps
> >    - cache
> >    - config
> >    - lib
> >    - ...
> > - tmp
> > - www
>
> > On MANY FREE hostings after went on ftp we don't have that what you
> > have:
> > - access-logs
> > - etc
> > - mail
> > - public_ftp
> > - public_html   <---- we are often here
> > - sf_project
> > - tmp
> > - www
>
> > We are often inside catalog /public_html after went on ftp, and we
> > can't go above and then only solution is my solution here:
> >http://trac.symfony-project.org/ticket/7543
> > Do you understand what I mean ?
>
> > On 27 Lis, 09:51, Alexandru-Emil Lupu <[email protected]> wrote:
> > > HI!
>
> > > I would say not to modify the file. I had this problem and i have fix it
> > in
> > > this method:
>
> > > Assuming that you have access to the parent directory (let's say is a whm
> > /
> > > cpanel powered host)
>
> > > So, my parent directory looks like :
>
> > > - access-logs
> > > - etc
> > > - mail
> > > - public_ftp
> > > - public_html
> > > - sf_project
> > > - tmp
> > > - www
> > > - [some .hidden files ]
>
> > > I guess it is obvious what i do have in the sf_project directory, but i
> > will
> > > digg into it and i will show you something else:
>
> > > in the file: /sf_project/config/ProjectConfiguration.class.php
>
> > > i have this piece of code:
>
> > > <?php
>
> > > # FROZEN_SF_LIB_DIR: /srv/symfony/1.2/lib
>
> > > require_once
> > > dirname(__FILE__).'/../lib/symfony/autoload/sfCoreAutoload.class.php';
> > > sfCoreAutoload::register();
>
> > > class ProjectConfiguration extends sfProjectConfiguration
> > > {
> > >   public function setup()
> > >   {
> > >     // for compatibility / remove and enable only the plugins you want
> > >     $this->enableAllPluginsExcept(array('sfDoctrinePlugin',
> > > 'sfCompat10Plugin'));
> > > *    $this->setWebDir('/home/alecslup/public_html/');*
> > >   }
>
> > > }
>
> > > So, we go now upper, in the public_html folder where we have:
>
> > > - cgi-bin
> > > - css
> > > - images
> > > - js
> > > - sf
> > > - sfAdminDashPlugin
> > > - sfFormExtraPlugin
> > > - sfJqueryLibsPlugin
> > > - sfPropelPlugin
> > > - sfProtoculousPlugin
> > > - sfSimpleBlogPlugin
> > > - symfony
> > > - uploads
> > > - index.php
> > > - backend.php
> > > - some other files
>
> > > So, we now open the index.php file, and we can see the code:
>
> > > <?php
>
> > > require_once(dirname(__FILE__).'/..*/sf_project/*
> > > config/ProjectConfiguration.class.php');
>
> > > $configuration =
> > > ProjectConfiguration::getApplicationConfiguration('frontend', 'prod',
> > > false);
> > > sfContext::createInstance($configuration)->dispatch();
>
> > > As index.php is in public_html and symfony project is located into
> > > ../sf_project/ I have changed the require_once file path and now all the
> > > stuff is working smoothly.
>
> > > You can test the application at the url:
>
> > >http://www.alecslupu.ro/
>
> > > Alternativelly, you can test the frontend here, but it is closed as this
> > is
> > > the default in a sf Project.
>
> > >http://alecslupu.ro/frontend_dev.php/
>
> > > I hope my email has helped you. If you still have problems, let me know.
>
> > > Alecs
>
> > > On Fri, Nov 27, 2009 at 9:38 AM, dziobacz <[email protected]>
> > wrote:
> > > > Here is my message about problems when all symfony files are in
> > > > public_html (root directory) and ALSO my solution (or rather solution
> > > > which I have found on polish site) - it is important - so could
> > > > somebody do that in new version of symfony ??
> > > >http://trac.symfony-project.org/ticket/7543
>
> > > > Thx this solution ALL symfony files can be placed in catalog
> > > > public_html OR normal: Symfony files from /web Symfony catalog in
> > > > catalog /public_html on the server and all other symfony files above
> > > > catalog /public_html on the server - it doesn't matter - it will be
> > > > always ok :) This is very important.
>
> > > > --
>
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "symfony developers" group.
> > > > To post to this group, send email to [email protected].
> > > > To unsubscribe from this group, send email to
> > > > [email protected]<symfony-devs%[email protected]>
> > <symfony-devs%[email protected]<symfony-devs%[email protected]>
>
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/symfony-devs?hl=en.
>
> > > --
> > > Have a nice day!
> > > Alecs
>
> > > As programmers create bigger & better idiot proof programs, so the
> > universe
> > > creates bigger & better idiots!
> > > I am on web:  http://www.alecslupu.ro/
> > > I am on twitter:http://twitter.com/alecslupu
> > > I am on linkedIn:http://www.linkedin.com/in/alecslupu
> > > Tel: (+4)0748.543.798
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "symfony developers" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<symfony-devs%[email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/symfony-devs?hl=en.
>
> --
> Have a nice day!
> Alecs
>
> As programmers create bigger & better idiot proof programs, so the universe
> creates bigger & better idiots!
> I am on web:  http://www.alecslupu.ro/
> I am on twitter:http://twitter.com/alecslupu
> I am on linkedIn:http://www.linkedin.com/in/alecslupu
> Tel: (+4)0748.543.798

--

You received this message because you are subscribed to the Google Groups 
"symfony developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-devs?hl=en.


Reply via email to