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 » HUGE installation problems
icon8.gif  HUGE installation problems [message #9784] Thu, 03 August 2006 19:23 Go to next message
chtito  is currently offline chtito
Messages: 512
Registered: March 2006
Location: Sweden
Faithful Member
I'm desperate. I have loads of problems when moving my code to my web hosting place.

The server serves stuff that are at a specific place, say /home/foo/www so i put my project under 'foo' and made a symbolic alias from foo/myproject/web to www. Everything works so far.

My problems are:

1) I get a nagging
Undefined index: QUERY_STRING in /home/path/to/symfony/lib/request/sfWebRequest.class.php on line 343
error. What the hell is that "QUERY_STRING"? Why is it missing? Should i talk to my provider or is it a bug in symfony???

2) The (default) .htaccess file seems to be wrong. It drives me crazy. When i try to access an address like http://mysite.com/mainmodule/something/foo then ALL the relative addresses start with "mainmodule/something/foo". The style files addresses are "mainmodule/something/foo/css/whatever.css". Same with the javascript. What on earth is going on?

3) The auto generated modules don't work. There is a missing semicolon in the modules_moduleName_config_generator.yml.php cache file. I'm using php 5.0.5. Is that the reason why this cache file has a syntax error?

I have previously installed a symfony project on a server for which i am the admin and it was painful but installing it on a remote server, with ssh but without access to the logs is as close as one can get to hell on earth.

Other problem: my provider asks me to use php5 extensions to use php 5. Everything went berserk again. I changed some line in sfWebRequest.php wihtout understanding much of it (http://www.symfony-project.com/forum/index.php/t/2077/) and this problem seems away now. I also had to modify the .htacces file. Phew.
Re: HUGE installation problems [message #9791 is a reply to message #9784 ] Fri, 04 August 2006 00:20 Go to previous messageGo to next message
vonLeeb  is currently offline vonLeeb
Messages: 74
Registered: March 2006
Member
Welcome in a club of NO-PEAR shared hosting dummies Very Happy .
I hope you know http://www.symfony-project.com/trac/wiki/InstallingSymfonyOn SharedHostNoSsh.
This indeed was very helpful for me. But installation procedure is definitly something to improve in symfony. Many people complain and for many it was a block-stopper.

vl
Re: HUGE installation problems [message #9801 is a reply to message #9791 ] Fri, 04 August 2006 08:20 Go to previous messageGo to next message
chtito  is currently offline chtito
Messages: 512
Registered: March 2006
Location: Sweden
Faithful Member
Thank you. I had already figured out that bit. The symfony libraries are up and running. It's just those three problem i can't manage to figure out.

If anyone could explain (or point me to a good website):

- how exactly the url is parsed in symfony?
- how is it rewritten?
- what is that bloody QUERY_STRING?
- how much is .htaccess involved in all this?

it would be greatly appreciated.

Thanks!
Re: HUGE installation problems [message #9803 is a reply to message #9801 ] Fri, 04 August 2006 09:06 Go to previous messageGo to next message
chtito  is currently offline chtito
Messages: 512
Registered: March 2006
Location: Sweden
Faithful Member
My goodness! I think i figured out some of my problems here:
the Apache server on my hosting site behaves totally differently from the one i got at home (MAMP).

On this distant server:
- PATH_INFO array is always empty
- QUERY_STRING is not set unless there is a '?' in the url
- REQUEST_URI is set properly
- SCRIPT_NAME is wrong and equal to the REQUEST_URI variable
- ORIG_SCRIPT_NAME is right and should be used in sfWebRequest instead of SCRIPT_NAME

What a mess! With that Apache behaviour sfWebRequest is totally 'in the cabbages' one says in French or 'out on a bicycle' in Swedish, in other words totally useless. I hope i will find some time to rewrite the getPathInfo function to get it working on my installation.

cheers!

P.S. Any translation in English of that expression 'in the cabbages' would be greatly appreciated! Very Happy
Re: HUGE installation problems [message #9815 is a reply to message #9784 ] Fri, 04 August 2006 16:28 Go to previous messageGo to next message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
In the UK, we like similies. We might sometimes say: "as useful as a chocolate teapot", or "as useful as a windscreen-wipers on a submarine" Smile


Remember Palestine
Re: HUGE installation problems [message #9826 is a reply to message #9815 ] Sat, 05 August 2006 00:11 Go to previous messageGo to next message
chtito  is currently offline chtito
Messages: 512
Registered: March 2006
Location: Sweden
Faithful Member
I'm slowly solving all the problems... Here are some news, for the interested ones. Rolling Eyes

1) I modified getPathInfo and getRelativeUrlRoot and it now seems to work. I will properly subclass sfWebRequest using factory.yml when everything goes smoothly.

2) Better but not quite functioning yet. It is a routing problem. I believe it is somehow related to the point 1)

3) This a bug. It is due to the changeset where the ?> was removed from the generated config files. If you remove the trailing ?> then you must be careful that the last line ends with a semicolon (i think).

Installing symfony on a shared host is really not for the faint hearted. Nobody should have to go through this ordeal. It is probably against the Geneva convention.

Seriously, symfony is impossible to install. This is chiefly due to sfWebRequest which is clearly not up to the task. I don't know enough about Apache, IIS and all the various QUERY_STRING, PATH_INFO, REQUEST_URI, ORIG_SCRIPT_FILENAME and all that paraphernalia but if you are expert in those you should think of rewriting the path functions of sfWebRequest to get it work on most platforms/installs. It would be greatly appreciated by the whole symfony community.
Re: HUGE installation problems [message #9829 is a reply to message #9826 ] Sat, 05 August 2006 09:19 Go to previous messageGo to next message
chtito  is currently offline chtito
Messages: 512
Registered: March 2006
Location: Sweden
Faithful Member
Still some more news. Point 2) was left unanswered. The problem came from a bug in sfWebController where the function genUrl directly calls $_SERVER['SCRIPT_NAME'] whereas it should call sfWebRequest::getScriptName(). I solved the problem by setting no_script_name to 'yes' in the settings, but the bug still remains in the symfony code.

Now there are still some quirks with javascript but i think i'm seeing the end of the tunnel.

All in all the causes of my problems were two genuine bugs plus the sfWebRequest class.

I really hope that some good samaritan will rewrite the tricky request related parts of the sfWebRequest class to ease installation on shared hosts...
Re: HUGE installation problems [message #10013 is a reply to message #9829 ] Fri, 11 August 2006 12:44 Go to previous messageGo to next message
z01d  is currently offline z01d
Messages: 160
Registered: December 2005
Senior Member
I feel your pain. Spent about a week trying to move my app on the remote host. Finally through by the divine intervention I found a post with a similar issue, which seems to be fixed in 6.3. If I were you, I'd look for another host. It seems like your host is changing the default values for Apache server variables (i.e. QUERY_STRING) which is not a good thing.
Re: HUGE installation problems [message #10998 is a reply to message #10013 ] Sat, 26 August 2006 21:03 Go to previous messageGo to next message
toorn001  is currently offline toorn001
Messages: 4
Registered: August 2006
Junior Member
Hello,

after a day under very much time pressure I resolved my (very similar) hosting problems as follows:

I simply put the line

$_SERVER['SCRIPT_NAME'] = 'index.php';

in the beginning of index.php

In the end, with a front controller and a single app, that's always the case. With more apps you might consider $_SERVER['PHP_SELF'] instead.

Furthermore, to prevent the warning (sometimes breaking the layout and producing errors about sending HTTP headers after some content has already been sent...!), I just alter the webrequest class at line 348 or around, to check whether QUERY_STRING is already set.

so something like: if (isset($PathArray['QUERY_STRING'])) preg_replace ...

it's just that some servers do not supply any query string if no GET string has been put after your url. (like ?name=me)

Hope that helps, greetings, Henk
Re: HUGE installation problems [message #11027 is a reply to message #10998 ] Mon, 28 August 2006 07:59 Go to previous messageGo to next message
chtito  is currently offline chtito
Messages: 512
Registered: March 2006
Location: Sweden
Faithful Member
Henk: do you have any idea of why some servers do not fill the QUERY_STRING if there is no '?' in the url? Is that the case on old Apache servers? IIS?

Is there a place where this is documented?
Re: HUGE installation problems [message #11222 is a reply to message #11027 ] Thu, 31 August 2006 00:22 Go to previous messageGo to next message
toorn001  is currently offline toorn001
Messages: 4
Registered: August 2006
Junior Member
I'm sorry, I just found this out by trial and error. It must be something in the server's httpd.conf, because the installed version s are the latest and newest for all.. I'm sorry I can't help you

gr. Henk
Re: HUGE installation problems [message #11817 is a reply to message #9784 ] Sun, 10 September 2006 18:55 Go to previous messageGo to next message
minesh  is currently offline minesh
Messages: 6
Registered: September 2006
Junior Member
I'm having similar problem where all the links on the homepage has index.php in the front. How did you resolve the problem.
Re: HUGE installation problems [message #11821 is a reply to message #11817 ] Sun, 10 September 2006 23:46 Go to previous messageGo to next message
toorn001  is currently offline toorn001
Messages: 4
Registered: August 2006
Junior Member
Hi,
First of all I have to say that your question is not very clear. My problem was that of an error that made it impossible to run symfony in the first place, so that sounds a little different than your problem... sorry if I misunderstood
How to remove the 'index.php' from your URL has been explained quite well in "the book", if that is your only problem: look at the 'routing' chapter. Possibly your hosting has the allow_override disabled for your page, then you'll have to negotiate with them!

Good luck, Henk
Re: HUGE installation problems [message #13928 is a reply to message #9784 ] Sun, 15 October 2006 22:07 Go to previous messageGo to next message
COil  is currently offline COil
Messages: 466
Registered: September 2006
Faithful Member

I had the same problem ths script name was included in the path :

After 3 hours of error/test in dev/prod Rolling Eyes

Here is the patch i made on sfWebrequest.class.php

Now it seems to work... i hope ...

<?php
public function getPathInfo ()
  {
    
$pathInfo '';

    
$pathArray $this->getPathInfoArray();

    
// simulate PATH_INFO if needed
    
$sf_path_info_key sfConfig::get('sf_path_info_key');     

    
// PATCH FOR My Wnderfull shared host //
    
if (!isset($pathArray[$sf_path_info_key])) {
        
$sf_path_info_key 'ORIG_PATH_INFO';
    }
    
// END OF PATCH

    
if (!isset($pathArray[$sf_path_info_key]) || !$pathArray[$sf_path_info_key])
    {
?>


my Symfony Blog - http://www.strangebuzz.com
The symfony web debug bar as a standalone library : PEAR::PHP_Debug
Re: HUGE installation problems [message #13935 is a reply to message #9784 ] Mon, 16 October 2006 01:12 Go to previous messageGo to next message
COil  is currently offline COil
Messages: 466
Registered: September 2006
Faithful Member

I've just seen this in the settings.yml : Rolling Eyes

  .settings:
    path_info_array:        SERVER
    path_info_key:          PATH_INFO



I think it would have corrected my problem as now am i using ORIG_PATH_INFO instead of PATH_INFO

[Updated on: Mon, 16 October 2006 17:05]


my Symfony Blog - http://www.strangebuzz.com
The symfony web debug bar as a standalone library : PEAR::PHP_Debug
Re: HUGE installation problems [message #17866 is a reply to message #9784 ] Thu, 14 December 2006 01:30 Go to previous message
COil  is currently offline COil
Messages: 466
Registered: September 2006
Faithful Member

here is a new patch i had to do for PHP5.2 with beta1.0 for the same hoster :


Here is the patch, in the case it could help someone :

settings.yml

    
    path_info_array:        SERVER
    path_info_key:          xx


because using path_info or orig_path_info, depending the pages, these vars are not always set or with bad values.

In lib/symfony/request/sfWebRequest.class.php replace the function by this one :


  public function getScriptName()
  {
    $pathArray = $this->getPathInfoArray();

    // patch for bad SCRIPT_NAME infos
    return isset($pathArray['ORIG_SCRIPT_NAME']) ? $pathArray['ORIG_SCRIPT_NAME'] : '';
  }


Very Happy


my Symfony Blog - http://www.strangebuzz.com
The symfony web debug bar as a standalone library : PEAR::PHP_Debug
Previous Topic:moving the sf directory
Next Topic:Ubuntu - askeet - sqlite
Goto Forum:
  

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