• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Help with first PHP Mobile Application

New Here ,
Jul 11, 2011 Jul 11, 2011

Copy link to clipboard

Copied

I´tm trying to build my first app to run on mobile devices,the problem is i cant configure the "WebRoot" and the "RootURL", in my first test,using wamp and running it local,it goes well,but when i´m try to put the web adress doenst work, i put on www folder the ZendFrameWork folder, as the same as Wamp does, but flashBuilder still don't recognize the web.Is there some PHP code i´m missing?or something else?

FB.jpg

TOPICS
PHP

Views

3.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 11, 2011 Jul 11, 2011

Copy link to clipboard

Copied

I recommend you using the new project wizard named: Flex Mobile and PHP Project.

According to the ss you use the old-style wizard.

Roy

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 12, 2011 Jul 12, 2011

Copy link to clipboard

Copied

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

    {

        super.preInitializeService();

        // Initialization customization goes here

        _serviceControl.endpoint = "http://localhost/MobilePHP/public/gateway.php";

   }

In .flexProperties:

serverRootURL="http://localhost"

services PHP file:

define("DATABASE_SERVER", "127.0.0.1");

I couldn't find any documents that explains how to set it up.
Thanks
David

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 12, 2011 Jul 12, 2011

Copy link to clipboard

Copied

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.

http://files.zend.com/help/Flash-Builder-for-PHP/Help/build_a_mobile_(php)_application.htm

Roy

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 18, 2011 Jul 18, 2011

Copy link to clipboard

Copied

Roy,

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?

Thanks

David

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 18, 2011 Jul 18, 2011

Copy link to clipboard

Copied

http://kb2.adobe.com/cps/911/cpsid_91121.html

This should help

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 18, 2011 Jul 18, 2011

Copy link to clipboard

Copied

Enable PHP Support is checked.

Server Options

Web Root: http://mydomain.com

Root URL: http://mydomain.com

Validate Configuration

I ran 'Validate Configuration'. I got

The web root is not a valid file system directory.

What should I put for Web Root and Root URL?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 18, 2011 Jul 18, 2011

Copy link to clipboard

Copied

I have the same problem.

Are you able to run your application?

Regards,

David

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 18, 2011 Jul 18, 2011

Copy link to clipboard

Copied

I have the same problem.

Have you figured out how to set up the remote server?

Thanks

David

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 15, 2011 Aug 15, 2011

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 06, 2011 Oct 06, 2011

Copy link to clipboard

Copied

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.

MAC:

Server Options

Web Root: /Applications/MAMP/htdocs

Root URL: http://localhost/

But when you try to export a release build and insert your server settings.

Server Options

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 06, 2011 Oct 06, 2011

Copy link to clipboard

Copied

Hi,

I posted my solution at http://forums.adobe.com/message/3850560#3850560

There are some other suggestions.

p.s

Finally, I made it working. Thank you kokorito, Chriszzzzzzzzzzzz for your help.

As Kokorito suggested, I don't have to/ shouldn't modify the gateway.php.

In amf_config.ini,

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:

zend_path ="/usr/local/php/ZendFramework-1.11.4-minimal/library"

Gateway.php reads amf_config.ini and use zend_path, library and services defined here to make new paths:

library ="/var/www/vhosts/mydomain.com/httpdocs/library"

services ="/var/www/vhosts/mydomain.com/httpdocs/services"

For amf directories, I used a full path such as:

amf.directories[]=/var/www/vhosts/mydomain.com/httpdocs/services

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

serverRoot="/var/www/vhosts/mydomain.com/httpdocs/public" serverRootURL="http://mydomain.com"

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 07, 2011 Oct 07, 2011

Copy link to clipboard

Copied

LATEST

Thanks Davidflex. I will try this today and see if I can get it to work.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines