12 Replies Latest reply on Nov 13, 2011 10:35 PM by newthoughts

    Creating a Flex App With a PHP Server Connection

    jimmyoneshot

      I'm attempting to create a new Flex application that has all of it's source data stored in a mysql database on my server provider (siteground) but am struggling to establish a connection from Flex.

       

      Basically I click File>New>Flex Project and then name a new project with PHP as the application server type and click next.

       

      Now comes the problem, I have no idea what to type into the "Root URL" option. I have set the "Web Root" simply to a folder that I've placed on my desktop (sitegroundtest) and Flex seems to recognise that fine but it's just the "Root URL" that I'm struggling with. What exactly would go in here if I want to work directly on the server as opposed to just my local machine (localhost)?

       

      I'm struggling because I've basically never done this before as I've only ever developed PHP sites in Dreamweaver in which case the sites were all placed on a university server to which all addresses and urls were provided to us.

       

      The domain name I've purchased is from siteground.com and is www.coolvisiontest.com. Would this have any effect on what needs to be entered into the root url or do I need to look elsewhere for it like within my server provider options or something along those lines?

       

      It's something that I'm sure is very simple but I have no experience with and I really can't start without finding it out.

        • 1. Re: Creating a Flex App With a PHP Server Connection
          Mayank (Adobe) Adobe Employee

          Root url is the url required to access htdocs of the server on which you are developing the flex application.

           

          E.g. for a local WAMP setup, the parameters would be as follows:

          webroot = c:\wamp\www

          rooturl = http://localhost:8080

           

          Hope this helps.

          1 person found this helpful
          • 2. Re: Creating a Flex App With a PHP Server Connection
            jimmyoneshot Level 1

            Yep I have used localhost before as I had wamp installed on my computer but I want to work directly from my server provider (siteground.com) where I have set up my mysql database in phpmyadmin, which contains all the sites product details. I know I can work locally using wamp but I want to try to connect to the server to make sure I actually can basically.

             

            Basically I just can't find the root url I'd need to enter to access siteground via the php server connection and have no idea where to find this. Would you know?

             

            I think I may also need the same address to access data from tables in the database using Flex's "Data>Create Application from database" connection option. Or would that require another?

             

            I feel stupid asking this as I'm sure it's really simple but it's just something I've never done before except on my old University server, in which case all required urls for connection were supplied to us and I only ever done this through dreamweaver. Cheers for your help so far.

            • 3. Re: Creating a Flex App With a PHP Server Connection
              jimmyoneshot Level 1

              I'm completely stuck on this now. I can't get started without it. I've tried all sorts of addresses but just get the message "Cannot access the web server. The server may not be running, or the web root folder or root URL may be invalid." This has appeared when I've tried an address and clicked 'Validate Configuration'. I simply have no idea where to find the address that's required.

               

              Has anyone set up a domain on a server before and created a mysql database on there and tried to connect to it using flex's inbuilt functions? What steps would you usually go through to do this? It seems siteground provides zero help with this.

              • 5. Re: Creating a Flex App With a PHP Server Connection
                jimmyoneshot Level 1

                Yep I meant to post that in the last message as that's the video I've been watching as a guide but that guy uses localhost with WAMP installed. I know how to do this but it's using the server directly that I can't do.

                 

                I've actually even sent the author of that video a message about it.

                • 6. Re: Creating a Flex App With a PHP Server Connection
                  jermon

                  Did you ever figure this out, as I am having the same problem?

                  • 7. Re: Creating a Flex App With a PHP Server Connection
                    jimmyoneshot Level 1

                    I never actually sorry my friend. I actually scrapped the project I was doing it for till a later date and did something else

                     

                    If I ever do figure it out I'll make a note of your name and let you know

                    • 8. Re: Creating a Flex App With a PHP Server Connection
                      jermon Level 1

                      Hello and thanks for taking note of my name.

                       

                      I've been working night and day on this app..I lost two days when I found the Interactive Design Environment (IDE) Flash Builder 4 could not work with live production servers so that set me back because there was no specific documentation detailing that just had to infer that from video tutorials and a few dozen forums on the IDE...which sucked I mean they could have just stated it somewhere sheesh...

                       

                      Unless someone else knows something i don't on connecting Flash Builder to a remote hosted Mysql database and remote hosted server shared, virtual, dedicated, grid or otherwise non-localhost?

                      • 9. Re: Creating a Flex App With a PHP Server Connection
                        NMorgan1965

                        I just create a new project and don't put anything about the server connection in the project settings.

                         

                        And when I want to access the remote PHP script, I just use an HTTPService with its url property set to the URL of the PHP script.

                         

                        The PHP script then returns XML and I use that to populate my app's views.

                         

                        It's that simple, or maybe you're needing something that this wouldn't provide.

                         

                        Cheers,

                         

                        Neil

                        • 10. Re: Creating a Flex App With a PHP Server Connection
                          jermon Level 1

                          Ok not showing an error just couldn't connect to a shared hosting server plan i have with godaddy.com

                          . I'm reasoning this shared plan I have for the facebook application i am creating may be the culprit.

                           

                          I am building a facebook app, something like a custom mafia wars from scratch using flash builder 4 and PHP

                           

                          So I am guessing from your thoughts I shouldn't use the php server to connect to the remote php classes i have created rather use HTTP services? Is that right?

                          • 11. Re: Creating a Flex App With a PHP Server Connection
                            archemedia Level 4

                            Don't give server details in your flex project settings. It's not necessary.

                            If you are a php developer, I'd suggest you use amf technology. You can chosse between Zend AMF or amfphp.

                            I myself use amfphp because it's fast and easy to learn but it doesn't get followed up anymore.

                            HTTPServices are good for basic applications. If you want more control (like class mapping on client and server), use RemoteObjects (which can connect through amf).

                             

                            I can give you some more info if you want. Let me know

                             

                            Dany

                            • 12. Re: Creating a Flex App With a PHP Server Connection
                              newthoughts

                              Hi Dany,

                               

                              I am new to flex. And I am having the same problem. I would like to know some more info on this issue. I am using "Flash Builder 4.5 for php". Can you provide any articles or exmples using Zend AMF or amfphp.

                               

                              Kranthi.