I recommend you using the new project wizard named: Flex Mobile and PHP Project.
According to the ss you use the old-style wizard.
In case MySQL database is located on www.mydomain.com, how can I set flex app to access the db from a flex app running on a mobile device?
Addition to the previous question about Server Location: Web Root and Root URL.
There are several files that use localhost shown below. I replaced the localhost with IP address, but not working.
services in Flex
protected override function preInitializeService():void
// Initialization customization goes here
_serviceControl.endpoint = "http://localhost/MobilePHP/public/gateway.php";
services PHP file:
define("DATABASE_SERVER", "127.0.0.1");I couldn't find any documents that explains how to set it up.ThanksDavid
I recommend reading this article which shows how to connect to a mysql database in a mobile app. You can see that in the PHP service you have the mysql connection details including the host name.
Thank you for the link for tutorial.
The app in the tutorial works well with localhost.
In order to make the app work with a remote server, the localhost parameters should be replaced at several places in the flex and PHP.
I replaced the localhost with www.mydomian.com, but still not working.
Could you post more details how to do?
I have the same problem.
Are you able to run your application?
I have the same problem.
Have you figured out how to set up the remote server?
I'm having this same problem, has anyone figured out a real solution yet?
I've read article after article on this, and all the tips and tricks are ALL geared toward local servers. I don't have a server running on a local machine, all I have is my remote server with my domain, "http://myDomain.com". I cannot for the life of me find an "htdocs" folder there, but I am running PHP on my machine, and was able to set up the SQL database on myPHPAdmin just fine.
I'm running a Mac, if that makes a difference. Is the "Web root:" folder supposed to be on your local hard drive? Because what makes sense to me with that name is that I direct it to the root folder of where my Flashbuilder project lives on my local hard drive, exactly as it is going to exist on the server, e.g. "MacHardDrive\myWebDomainName\myFlashbuilderProject," but that doesn't seem to be right. It also makes sense to me that the "Root URL:" would be the name of my domain followed by the "Web root:" folder name, e.g. "http://myDomain/myFlashbuilderProject," but again, this doesn't work.
Can anyone explain in greater detail to me what "Web root" and "Root URL" mean, if my definitions are incorrect?
Has anyone figured this out? Seems like everyone is talking about FlashBuilder that comes with PHP. So I'm still having trouble moving my mobile app to a remote server and I have FlashBuilder 4.5 Premium without PHP.
Like Davidflex said it works create with the setting like this.
Web Root: /Applications/MAMP/htdocs
Root URL: http://localhost/
But when you try to export a release build and insert your server settings.
Web Root: /home/username/domain_name/
Root URL: http://mydomain.com
It doesn't Validate which in turn won't let the project work. Also it would be nice to put the remote server in there for testing instead of just for release builds. Any one have an answer. Every tutorial or explaination shows localhost.
I posted my solution at http://forums.adobe.com/message/3850560#3850560
There are some other suggestions.
As Kokorito suggested, I don't have to/ shouldn't modify the gateway.php.
for webroot, I used the document root (or server root) provided by my web hosting company.
;webroot = "C:/Program Files/Zend/Apache2/htdocs"
webroot = "/var/www/vhosts/mydomain.com/httpdocs/public"
For zend path, I specified the path of zend library located in my web hosting server:
Gateway.php reads amf_config.ini and use zend_path, library and services defined here to make new paths:
For amf directories, I used a full path such as:
Finally, for the mysql server, I used localhost which my web hosting server points to, since gateway.php is runing on the server.
public $server = "localhost";
A different web hosting may use a different address.
.flexProperties is a config file in Flash Builder 4.5 for PHP. I set such as
Thanks Davidflex. I will try this today and see if I can get it to work.