1 Reply Latest reply on Oct 29, 2011 10:02 PM by cymbals1

    Flash Builder 4.5 - PHP/MySQL Data Service Error

    MFIMichael Level 1

      I recently started doing the Flex in a Week series, but I seem to be having a problem connecting to a data service. I've chosen to use a PHP service and when going through the 'Generate Sample PHP Service' wizard, I enter the MySQL Database information on my server (I've tried one hosted on GoDaddy and another hosted on Media Temple), but I keep getting the following error:


      java.io.IOException: Server returned HTTP response code: 405 for URL: http://localhost/TestProject/gateway.php


      I have IIS 7 installed locally. PHP 5 is installed. AMF is installed.


      Is this because I am try to access a remote SQL server rather than a local one? Is there a way to use a live server?

        • 1. Re: Flash Builder 4.5 - PHP/MySQL Data Service Error

          First, make sure the php page can run properly. If the php page can access the database, you should be fine.

          405 errors tend to deal with POST errors.


          The file type is not registered in the IIS script map settings (e.g. .html or .htm). IIS only allows HTTP requests of type to GET to unmapped files. HTTP requests of type POST, HEAD, and all others are responded to with a 405 resource not allowed error.

          Add a script map for the extension. A script map associates a particular file type with a given script module. The web server runs the module on the given file and sends the output to the browser, instead of sending the file directly to the browser. 

          1. Go to "Control Panel"-"Administrative Tools"-"Internet Information Services". 
          2. Expand the tree to "COMPUTERNAME"-"Web Sites"-"Default Web Site". 
          3. Right-click on "Default Web Site" and select "Properties". (Alternately, select "Default Web Site" and press Alt+Enter.) 
          4. Select the "Home Directory" tab. 
          5. Click the "Configuration" button. 
          6. From the "Mappings" tab, select the "Add" button. 
          7. Click the "Browse..." button, and find your php drivers
          8. Type ".html" (without quotes) in the "Extension" box. 
          9. Select the "Limit to:" radio button, and type in "GET, POST" (without quotes) in the box next to it. 
          10. Click the "OK" button and close all the dialogs. (If the "OK" button is greyed out, then make sure all the entries are correct and try clicking in the file name box.)