dta38159 2012-04-26 21:29
浏览 30
已采纳

Flex 4.5移动部署php / sql

So im building an application for android and iphone and im almost done so i decided to start testing on a remote server. However when i change the parameters for the remote server I get a 404 error for the gateway.php file. The path is correct and the file present in the server. I followed this method:

  1. Changed the parameters on the service files to match the server
  2. Changed the webroot on the amf_config.ini file to /home/myuser/public_html/
  3. Edited tha MarkersService.as (the file that extends the super class of the services) and added this _serviceControl.endpoint = "http://www.chania***.com/Chania/gateway.php";
  4. Uploaded the .swf file

When testing i get the error. If i change the endpoint to my localhost everything works fine. Any help?

  • 写回答

1条回答 默认 最新

  • douchen7324 2012-04-27 13:00
    关注

    So after a lot of researching and testing i found what you have to do to deploy a mobile app which uses php services on a server. As there is no guide on the internet on how exactly to do this im presenting the steps bellow.

    1. Upload ZendFramework folder from your local server to the root of your server (mine was public_html)
    2. Upload your project folder (most likely the debug folder) on root (ex. /myproject). On this folder you need to have your services folder (/myproject/services) , the amf_config.ini file and the gateway.php file.
    3. Here is the most likely to cause problem part. You will have to edit amf_config.ini and add the webroot=absolute path and the zend_path=absolute path of zend library on my project these were "webroot=/home/username/public_html/ and zend_path=/home/username/public_html/ZendFramework/library/". you should also make sure that at the end of the file the following exists

      [zendamf] amf.production=true amf.directories[] myproject/services

    4. Finaly you will have to find the myservice.as file in your project and after the initialization add the following line and compile

      super._serviceControl.endpoint="http://www.mydomain.com/myproject/gateway.php"

    If you follow the above steps your mobile app should be able to get it's data from a remote server on both testing and deployment.

    I hope that i helped some people out especially new developers on flex mobile

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用