Problem after changing server

Help
2008-02-15
2013-05-28
  • Knut Krüger
    Knut Krüger
    2008-02-15

    Hi Matthias, Hi Rick,
    I changed the server (php4 to php5) and there is a strange problem now.

    1. Login  -> OK
    2. Search for record -> ok
    3. edit record -> ok
    4. edit record again (the record was stored with changed fields) - > OK
    5. Show edit record: -> you're only permitted to execute SELECT queries!

    ---------------------------
    search for Author -> OK
    display Record (loupe) -> -> you're only permitted to execute SELECT queries!

    I tried to change the user permissions with admin account. Alle permissions except delete are set.
    Saving the user permissions was working fine

    Do you have any hints?
    Regards Knut

     
    • Knut Krüger
      Knut Krüger
      2008-02-15

      Additional information:
      using the loupe for not logged in users is working fine.

      Knut

       
    • Hi Knut,

      I cannot reproduce your problem, but it looks as if this might be related to a referrer problem which we haven't yet sorted out.

      Can you reproduce your problem repeatedly by issuing the steps you've given?

      And how do you go from step 3 to step 4 in your list of steps? I.e. what interface actions are you doing in order to  "edit the record again"? Is that step required to trigger the error message?

      Thanks, Matthias

       
      • Knut Krüger
        Knut Krüger
        2008-02-15

        You need only
        1. Login -> OK
        2. Search for record -> ok
        3. Show edit record: -> you're only permitted to execute SELECT queries!

        Strange:
        Using a normal account:
        you're only permitted to execute SELECT queries!

        using an admin accoutn produces:
        Error 1065 : Query was empty
        Choose how to proceed:   Go Back   -OR-   Display previous search results   -OR-   Goto Equine and Animal Cognition Reference Database Home 

        Do you have still your password?
        Knut

         
    • Knut Krüger
      Knut Krüger
      2008-02-15

      And I forgot:

      It is another hardware now, but http://www.social-insects.de is running at the same machine and has the same problems.
      But it was ok before.

      regards Knut

       
    • Hi Knut,

      I still have the login info for your database and I can reproduce your problem at your installation.

      It looks, as if in both cases (regular user or admin logged in) 'search.php' does not receive the SQL query passed in the 'sqlQuery' URL parameter. Instead the '$sqlQuery' in 'search.php' appears to be empty. Can you verify this? To do so, please insert:

      echo "SQl query: " . $sqlQuery;
      exit;

      after line 207 (of file 'search.php', rev1009 of the SVN trunk), then perform again the steps 1-3 from your previous mail.

      Maybe your new server has a more rigid limit on the length of GET URLs?

      Anyways, these are just some ideas. Let me know if you still can't get it working.

      Matthias

       
      • Knut Krüger
        Knut Krüger
        2008-02-15

        The query is empty after simple search but not after show all,
        I did not reach the point of the error with the exit command. -> the loupe
        Therefore I deleted the exit command and set output buffering to on.
        You can see the sql Query on the top.
        I sent you a mail with a temporarily FTP account for this directory to refbase extracts
        msteffens users sourceforge was bounced back
        Please send me a message if you do not need the account.
        Feel free to try - maybe this helps better

        Regards Knut

         
    • Knut Krüger
      Knut Krüger
      2008-02-15

      I tested a Query string up to 5400 characters after test=
      No problem
      You could try with:
      http://references.equine-behaviour.de//query_string.php?test=

      Regards Knut

       
    • Knut Krüger
      Knut Krüger
      2008-02-15

      I tested a Query string up to 5400 characters after test=
      No problem
      You could try with:
      http://references.equine-behaviour.de/query_string.php?test=

      Regards Knut

       
    • Knut, thanks for the account, I've quickly tried it (and removed again any debugging code). As suggested, the problem is that the '$sqlQuery' variable is empty, although it got passed to 'search.php' in the 'sqlQuery' URL parameter. If it's not due to any length constraints of the GET URL then I have no idea what could cause your problem.

      Have you compared the 'php.ini' settings of your old and your new server? Are there any suspicious differences?

      You haven't modified or updated any of the refbase code since the server migration, right? So the only thing that is different is the server's PHP setup?

      Matthias

       
      • Knut Krüger
        Knut Krüger
        2008-02-15

        >Have you compared the 'php.ini' settings of your old and your new server? Are
        >there any suspicious differences?
        I compared the php ini settings and changed the new one similar to the old ones, but only those to which I have access.
        See the phpinf files in PM for the rest of the settings

        >You haven't modified or updated any of the refbase code since the server migration,
        >right? So the only thing that is different is the server's PHP setup?

        yes and no
        The problem was with the file copy of the old server,
        but after that I did a complete new installation with branch 1011 just now, because I wasn't sure that there is a config mismatch.

        Regards Knut

         
    • Just as a follow-up, for people who face similar problems:

      It appears that the original poster's problem (i.e. an empty 'sqlQuery' parameter and subsequent error messages) was caused by the Suhosin extension[1] that was installed on the poster's server.

      [1]: http://www.hardened-php.net/

      You can check your active 'php.ini' file to see whether the Suhosin extension is installed on your PHP server.

      refbase currently uses pretty long URLs and URL parameter values, which may cause conflicts with strict settings for variable 'suhosin.get.max_value_length' -- and possibly other Suhosin variables. In case of the 'suhosin.get.max_value_length' variable, a value of 512 might cause problems with refbase, while a value of 1024 should work fine.

      Matthias

       
      • adrianbj
        adrianbj
        2008-03-12

        Just thought I'd chime in and let you know that I am also running Suhosin and I also had the same problem, but:

        suhosin.get.max_value_length = 1024

        has been working perfectly for quite some time now, and I haven't had to change any other settings.

        Cheers,
        Adrian

         
        • Hi Adrian,

          thanks for the feedback, that is helpful information, and it confirms that it's most likely just variable 'suhosin.get.max_value_length' (being set to a low value such as 512) that's causing problems.

          I now realize that you did already report this issue elsewhere in the forum:

          http://sourceforge.net/forum/message.php?msg_id=4743339

          but, earlier, I didn't really make the connection with the issue reported here.

          Thanks, Matthias