Announcement

Collapse
No announcement yet.

Internal Server Errors

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Internal Server Errors

    I've getting internal server errors whilst adding products to the cart . However this is happening on certain products only. e.g one that fails is

    http://www.alnavi.co.uk/acatalog/Cro..._10001001.html

    whilst the one that works is

    http://www.alnavi.co.uk/acatalog/Bir...BS_040891.html

    I'm on Actinic Business 11.0.2 and my host is 1and1. When checked this morning, the version of PHP was v4. I've changed this to V5 via the control panel. see http://www.alnavi.co.uk/phpInfo.php

    Don't believe its anything to do with 1and1 as the issue is intermmitent. Can anyone advise what is going please.

    Many Thanks, Nilesh

    #2
    Sorry. It's hard to tell what's happening with the way you're creating the submit references and add to cart on the fly (at least it's hard for me).

    I will say though that it took me a while to work out what I was supposed to do to try and buy something. It's less than obvious and there's nothing that says what to do.

    Mike
    -----------------------------------------

    First Tackle - Fly Fishing and Game Angling

    -----------------------------------------

    Comment


      #3
      Thanks for the feedback, Mike.
      Need to make the pages a bit more user friendly, perhaps changing the green buttons to display <AddToCart> or better still get back to basis and have a drop down menu.

      Comment


        #4
        I think the 'Buy' text makes it much clearer what to do.

        I still can't think what the error 500 problem is.

        Mike

        PS. Clicking on the red 'out of stock' icon adds one of the shoes to the cart but without any sizing info. That doesn't seem right. Oddly, even clicking the icon key images does the same. It all seems a bit flaky to me.
        -----------------------------------------

        First Tackle - Fly Fishing and Game Angling

        -----------------------------------------

        Comment


          #5
          Thanks again, Mike.

          Looks like Birkenstock seems to be immune to the 500 errors , so it leads me to believe that only the newly imported products such as Crocs are affected. I'm doing an export & to see if I can find any diference between them. In addition, over the past few weeks, I've been hit with the numerous crashes. So perhaps, something, somewhere along the lines may have changed/corrupted. Further investigation needed now.

          As for the OutOfStock implementation, this is based on

          http://community.actinic.com/showthread.php?t=37812

          which I thought was all working & dusted.

          Well, back to the drawing board again, I guess.

          Comment


            #6
            I need to debug the "Internal Server Error".
            According to 1and1's FAQ , they do not provide copies of error logs but surgest creating a php script as detailed below. This then needs to be included but I have no idea how to. Any suggestion would very much be appreciated.

            Many Thanks , Nilesh

            error_reporting(0);
            $old_error_handler = set_error_handler("userErrorHandler");

            function userErrorHandler ($errno, $errmsg, $filename, $linenum, $vars)
            {
            $time=date("d M Y H:i:s");
            // Get the error type from the error number
            $errortype = array (1 => "Error",
            2 => "Warning",
            4 => "Parsing Error",
            8 => "Notice",
            16 => "Core Error",
            32 => "Core Warning",
            64 => "Compile Error",
            128 => "Compile Warning",
            256 => "User Error",
            512 => "User Warning",
            1024 => "User Notice");
            $errlevel=$errortype[$errno];

            //Write error to log file (CSV format)
            $errfile=fopen("errors.csv","a");
            fputs($errfile,"\"$time\",\"$filename:
            $linenum\",\"($errlevel) $errmsg\"\r\n");
            fclose($errfile);

            if($errno!=2 && $errno!=8) {
            //Terminate script if fatal error
            die("A fatal error has occurred. Script execution has been aborted");
            }
            }

            Comment


              #7
              Another way of testing would be to install a standalone server on your own PC.

              Detailed instructions in the Advanced Guide under "Installing a Standalone Demo on a PC".
              Norman - www.drillpine.biz
              Edinburgh, U K / Bitez, Turkey

              Comment


                #8
                Thanks for the suggestion , Norman
                Will give it a try on a second PC tonight at home, so as not to affect the network settings on the current PC. For future, I think I should implement 1and1's solution so I can keep an eye out for any errors. Any 1and1 users done anything similar?
                Nilesh

                Comment


                  #9
                  I've followed the instructions as per the AUG & finally managed to create a standalone Demo PC on a separate Machine. Ran some test but just cannot replicate the Internel Server Errors. So looks like Actinic must be configured OK.

                  I need some tests done on the 1and1 server to see whats causing the issue. Any ideas/suggestions would be very much appreciated.
                  Many Thanks, Nilesh

                  Comment


                    #10
                    I'd recommend replacing all that duplicated JavaScript with much simpler code. I.e. Put this in the <head> of your overall layout:
                    Code:
                    <script type="text/javascript">
                    	function setp1p2(btn, p1, p2){
                    		document.getElementsByName('v' + btn.name + '_1')[0].value = p1;
                    		document.getElementsByName('v' + btn.name + '_2')[0].value = p2;
                    		return true;	
                    	}
                    </script>
                    Then amend each BUY button to call said code passing in the values you want to set for the first hidden variable and the second.
                    Code:
                    <input class="form_button_pushbuttongridbutton" type="submit" name="_CR-10001001" value="buy" onclick="return setp1p2(this,1,1);">
                    The above line only needs the 1,1 bit changed for each additional button.

                    No more code is needed so delete all that JavaScript that creates and assigns onclick functions.
                    Norman - www.drillpine.biz
                    Edinburgh, U K / Bitez, Turkey

                    Comment


                      #11
                      Norman , many thanks for your suggestion.

                      I'll be honest, I spent all day today understanding how this whole thing works. I know its suppose to replace the code from actinic_main.php file as detailed below, but have no idea what values I need to put for the 1,1 part. I'm seriously lost here !!


                      FREE_MARKUP_CODE_BLOCK;
                      echo "</td>";
                      //+
                      // Put together a unique ID for this cell that we can refer to
                      // It has a form _choiceidx1_choiceidx2_...
                      //
                      $nUniqueCellId = '';
                      for ($ChoiceIdx = 1; $ChoiceIdx <= count($listCellChoiceIndices); $ChoiceIdx++)
                      {
                      $nUniqueCellId .= '_' . $listCellChoiceIndices[$ChoiceIdx];
                      }
                      //
                      // Insert a local JavaScript into the cell that will adjust hidden fields to reflect the selected cell
                      //
                      echo "<script type='text/javascript'>";
                      echo "function onclick${nUniqueCellId}()";
                      echo "{";
                      for ($i = 1; $i <= $nXAttributeCount + $nYAttributeCount; $i++)
                      {
                      echo "var x=document.getElementsByName('{$listAttributeWidgets[$nBaseAttributeIdx + $i - 1]}');x[x.length - 1].value='{$listChoiceIds[$nBaseAttributeIdx + $i -1][$listCellChoiceIndices[$i]][0]}';";
                      }
                      echo "}";
                      //
                      // Redirect onclick of Add To Cart button to our script
                      //
                      echo "var x=document.getElementsByName('_$sProdRef');"; // Lookup ATC button by name
                      echo "x[x.length - 1].onclick = onclick${nUniqueCellId};"; // Pick the latest ATC button
                      echo "</script>";
                      }
                      }
                      }

                      Comment


                        #12
                        If you're not writing your own code and are just using what's already posted without truly understanding it, then best stick with what you already have. The code you had before is clumsy but it works.
                        Norman - www.drillpine.biz
                        Edinburgh, U K / Bitez, Turkey

                        Comment

                        Working...
                        X