This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » support » Installation and setup » Alias set-up from symfony cookbook.... htaccess issue?
Alias set-up from symfony cookbook.... htaccess issue? [message #100884] Mon, 14 June 2010 10:34 Go to next message
cr0wn3r  is currently offline cr0wn3r
Messages: 17
Registered: July 2008
Junior Member
I've inherited a symfony project that uses a hard coded directory for its admin application. At first I thought this was some kind of horrible hack but after a bit of searching I found this page in the symfony cookbook:
http://www.symfony-project.org/cookbook/1_0/en/web_server

The last scenario, Aliases, is the one that applies.

Unfortunately it's not quite working. Despite being set up as per the description in the linked article, the /admin/index.php page always runs to the last line of the .htaccess file and so outputs the text at the end of the file:

Application error
symfony application failed to start properly


The .htaccess file in the /admin/ directory is:

Options +FollowSymLinks +ExecCGI

<IfModule mod_rewrite.c>
  RewriteEngine On

  # uncomment the following line, if you are having trouble
  # getting no_script_name to work
  # RewriteBase /
  
  # we skip all files with .something
  RewriteCond %{REQUEST_URI} \..+$
  RewriteCond %{REQUEST_URI} !\.html$
  RewriteRule .* - [L]

  # we check if the .html version is here (caching)
  RewriteRule ^$ index.html [QSA]
  RewriteRule ^([^.]+)$ $1.html [QSA]
  RewriteCond %{REQUEST_FILENAME} !-f

  # no, so we redirect to our front web controller
  RewriteRule ^(.*)$ /admin/index.php [QSA,L]
</IfModule>

# big crash from our front web controller
ErrorDocument 500 "<h2>Application error</h2>symfony application failed to start properly"


I've tried it with and without the rewrite base but no joy. Can anyone help?

The project is old - symfony 1.0.20 - so hopefully upgrading it to 1.4 will be the next piece of work, but for now I need to get it working as is.

Thanks.

[Updated on: Mon, 14 June 2010 10:35]

Re: Alias set-up from symfony cookbook.... htaccess issue? [message #100885 is a reply to message #100884 ] Mon, 14 June 2010 10:42 Go to previous messageGo to next message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
Maybe mod_rewrite is not loaded, or not turned on with AllowOverride?


Remember Palestine
Re: Alias set-up from symfony cookbook.... htaccess issue? [message #100887 is a reply to message #100885 ] Mon, 14 June 2010 10:47 Go to previous messageGo to next message
cr0wn3r  is currently offline cr0wn3r
Messages: 17
Registered: July 2008
Junior Member
Hey, thanks for the reply.

I did test this by moving the ErrorDocument 500 line inside the bottom of the <IfModule mod_rewrite.c> </IfModule>, and it still triggered it. I changed the text slightly as well to make sure it was coming from the /admin/.htaccess and not the one in the web root.

There are also a couple of other .htaccess files with mod_rewrite in other directories within the webroot that are definately working.
Re: Alias set-up from symfony cookbook.... htaccess issue? [message #100889 is a reply to message #100884 ] Mon, 14 June 2010 10:59 Go to previous messageGo to next message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
Checked your Apache logs?


Remember Palestine
Re: Alias set-up from symfony cookbook.... htaccess issue? [message #100892 is a reply to message #100884 ] Mon, 14 June 2010 11:21 Go to previous messageGo to next message
cr0wn3r  is currently offline cr0wn3r
Messages: 17
Registered: July 2008
Junior Member
They're not being very helpful. Just lots and lots of this:

[14/Jun/2010:08:09:30 +0100] "GET /admin/index.php HTTP/1.1" 500 71 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3"

Re: Alias set-up from symfony cookbook.... htaccess issue? [message #100894 is a reply to message #100884 ] Mon, 14 June 2010 11:29 Go to previous messageGo to next message
cr0wn3r  is currently offline cr0wn3r
Messages: 17
Registered: July 2008
Junior Member
More helpful logs... I was looking in the wrong file...

[Mon Jun 14 10:24:12 2010] [error] [client xx.xx.xx.xx] SoftException in Application.cpp:601: Directory "/home/myuser/public_html/admin" is writeable by group
[Mon Jun 14 10:24:12 2010] [error] [client xx.xx.xx.xx] Premature end of script headers: index.php


Thats what I get every time /admin/index.php is accessed
Re: Alias set-up from symfony cookbook.... htaccess issue? [message #100898 is a reply to message #100884 ] Mon, 14 June 2010 12:35 Go to previous messageGo to next message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
That's an Apache problem, nothing to do with symfony afaict. I've just googled it, and got hundreds of answers. Try there?

Edit: google "SoftException in Application.cpp", which is the main error.

[Updated on: Mon, 14 June 2010 12:36]


Remember Palestine
Re: Alias set-up from symfony cookbook.... htaccess issue? [message #100900 is a reply to message #100884 ] Mon, 14 June 2010 12:42 Go to previous message
cr0wn3r  is currently offline cr0wn3r
Messages: 17
Registered: July 2008
Junior Member
Well the error log message seems to just mean "its broken" so theres not really anything to follow up there.

With the issue itself, it only occurs with the admin directory, so it does seem to be some kind of conflict with the symfony admin app.

e.g. if I create a file

/test/index.php

then I can access that index.php fine, even without a .htaccess file in the directory.

But anything in the admin directory, I presume as it has the same name as a symfony app, comes up with the error from the .htaccess file.

If I remove the .htaccess file from the admin directory then it produces the error at the end of the webroot .htaccess file instead.



Previous Topic:data/web/sf?
Next Topic:User sessions do not persist on Ubuntu Server
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software