3 Replies Latest reply on Feb 21, 2011 8:25 PM by saisri2k2

    Server returned HTTP response code: 500 for URL: http://localhost/Test-debug/gateway.php

    SujathaReddyUSA

      Hello All,

                  I am not sure if this is right place to post.I getting the following error

       

      java.io.IOException: Server returned HTTP response code: 500 for URL: http://localhost/Test-debug/gateway.php.

       

      I am using the following

       

      a) Apache 2.217

      b) Flash Builder 4

      c) PHP Version 5.3.5

      d) Zend Framework 1.10.1

      e) MS Access 2003

       

      This is what I am trying to do.

       

      From Flash Builder I am trying to create a Data Service (Service Type is PHP).

      I am getting the following error

      java.io.IOException: Server returned HTTP response code: 500 for URL: http://localhost/Test-debug/gateway.php.

       

      Here is the php code I have coded to pull data from MS Access

       

      <?php     
      class  MSDataAccessFunction {
          public function GetDatafromAccess () {
          $cnx = odbc_connect( 'WebTute' , 'root', '' );
          $cur = odbc_exec( $cnx, "select First_Name,Last_Name,Phone_Number from People" ) or die ('Connection failed');
          $rows = array();
          while( $row = odbc_fetch_row( $cur ) ) {
          $rows[]   = $row;
          }
         odbc_close( $cnx);
         return $rows;
         }
      }
      ?>

       

      Please help me how to resolve the error.

        • 1. Re: Server returned HTTP response code: 500 for URL: http://localhost/Test-debug/gateway.php
          saisri2k2 Level 4

          If you copy the Url and use it in the browser address bar, does it work? I guess no, but try.and try to write logs on the Php please, you will know where that is breaking. If you have server logs, please verify that nothing unexpected is happening.

          • 2. Re: Server returned HTTP response code: 500 for URL: http://localhost/Test-debug/gateway.php
            SujathaReddyUSA Level 1

            Saisri,

                    Copy pasting the URL into the did not work.I even restarted the Apache server and tried.Did did not work either.

            I have written a simple php file which basically retrieves data from the same MS Access Table and displays in browser.It works like charm without any problems.

             

            Here is the code:

             

            <?php
            function HTML_Head() {
              echo "
              <HTML><HEAD>
              <TITLE>Processing Form</TITLE>
              </HEAD>
              <BODY BGCOLOR=\"#D5D5AB\">";
            }

            function HTML_Foot() {
              echo "</body></html>";
            }

            function Database_Entries($msg) {
              echo $msg;
            }

            function Output_Entries() {
              $cnx = odbc_connect( 'WebTute' , 'root', '' );
              if (!$cnx) {
               Error_handler( "Error in select connection" , $cnx );
              }   
              $cur= odbc_exec( $cnx, "select First_Name,Last_Name,Phone_Number from People" );
              if (!$cur) {
               Error_handler( "Error in select cursor( no cursor returned ) " , $cnx );
              }
              echo "<table border=1><tr><th>First Name</th>".
               "<th>Last Name</th><th>Phone Number</th></tr>\n";
              $nbrow=0;  
               while( odbc_fetch_row( $cur ) ) {
               $nbrow++;
               $FirstName= odbc_result( $cur, 1 );
               $LastName= odbc_result( $cur, 2 );
               $PhoneNumber= odbc_result( $cur, 3 );
               echo "<tr><td>$FirstName</td>".
                "<td>$LastName</td><td>$PhoneNumber</td></tr>\n";
              }
              echo "<tr><td colspan=2>$nbrow entries </td></tr></table>";
              odbc_close( $cnx);
            }
            function Error_Handler( $msg, $cnx ) {
              echo "$msg \n" . $cnx;
              odbc_close( $cnx);
              exit();
            }
            $strOldEntries = "Previous Entries in database";
            HTML_Head();
            Database_Entries($strOldEntries);
            Output_Entries();
            HTML_Foot();
            ?>

            • 3. Re: Server returned HTTP response code: 500 for URL: http://localhost/Test-debug/gateway.php
              saisri2k2 Level 4

              from what I see here http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#5xx_Server_Error I see it as server error, probably you have to post it in the apache forum. It is not a Flex error though.