5 Replies Latest reply on Oct 6, 2011 8:00 PM by fogpuppy

    Possible to use FB4.5 for PHP without Zend Studio?

    sneakyimp Level 2

      I've watched a really helpful tutorial on FB4.5 for PHP by Mihai Corlan and am hoping to use some of his techniques but would like to use a different PHP server because Zend Server costs money and I'd rather avoid polluting my workstation with still more daemon-type services.  I've set up numerous Debian and CentOS servers from scratch and would like to configure FB4.5 for PHP so that I can debug both my Actionscript and PHP.  Has anyone done this?  I could certainly used advice from someone who's gone through all the trouble already. I'd very much like to capitalize on all of the ways that FB4.5 automatically generates code and creates links for you rather than writing all that stuff by hand.

        • 1. Re: Possible to use FB4.5 for PHP without Zend Studio?
          Brent Wientjes

          There may be other ways to do this but I built a flex 3/php web site winter 2008 on a Rackspace based server.  PHP is the standard configuration of the cloud server offerings and I have NO maintenance with the server.  It just runs.  I only program the PHP and client side (Flex for pc and AJAX for Mobile).   At the time I looked at Zend (cost money as noted), BlaseDS, AMFPHP and straight dumb text transfers.  Zend, BlaseDS, AMFPHP are all AMF and at least for me were a little tricky to get configured correctly and maintain during development (I would usually break something and have to debug which is harder for me in AMF).  I quickly decided to just use straight text transfers and create my own protocal with concat and decode on both sides.  You use RPC with POST settings.  It was easy to put in print statements for debugging whatever I was breaking at the time (client commands, comm channel, server command processing, MySQL interaction) and I could always see exactly what was breaking when related to the comm channel. 


          So for me, Zend and BlaseDS are hard to set up and maintain during development.  AMFPHP was easy to set up and sometimes tricky to debug when things went south.  RPC POST text transfers are easy to set up and debug data streams.  If you look at the cookbook section of adobe flex and search for any of the above, you will get an ap note or 2 discussing how to set up and a simple usage example.


          One last point was after I got done with the pc version of my web site, I started to do a browser based mobile solution for a trimmed down version of the web site.  It turns out, since I was implementing in AJAX, I could not figure out how to do AMF type transfers and the text based comm channel easy enabled the client side to change from Flex to AJAX but the server side stayed untouched.  It greatly reduced my development.  The pc version took about 2.5 man years (70+ main views) and the mobile version took on 3 weeks (15 main views)!


          All of the above comments assume you are developing a web site that just uses the server as a data wearhouse.  The solution may be different if you are mostly a streaming based web site (streaming off your own server).


          Good luck on your choices!

          1 person found this helpful
          • 2. Re: Possible to use FB4.5 for PHP without Zend Studio?
            sneakyimp Level 2

            Thanks for your response.


            What I'm really hoping to accomplish here is to set up Flash Builder 4.5 properly so I can take advantage of all the automatic code generation in Flash Builder 4.5.  Your response was informative but doesn't really address the fact that I want to set up my IDE to work with both my Flex code and my PHP code as an IDE should -- so I can actually debug the code without having to write echo statements or log files to see what's going on. Having written an AMF3 serializer in PHP myself, I'm sure I could attack a Flex/PHP app brute force style, but I'm really hoping I can use FB4.5's awesome new productivity features.


            At the moment, the problem I'm faced with is that when I create a new "Flex Mobile and PHP Project" that the wizard prompts me for the location of my PHP web root which means it wants to save files locally on my local file system.  I'm hoping to use a separate server for the PHP server (an ubuntu machine on my LAN) and I'm wondering if anyone has set up things this way. Additionally, I'm wondering if one must configure PHP with any special debugging modules like xdebug or zend_debugger.


            Any help would be much appreciated.

            • 3. Re: Possible to use FB4.5 for PHP without Zend Studio?
              fogpuppy Level 1

              FLash Builder for PHP supports any PHP web server ... you do not have to use Zend Server.  So you could easily use your ubuntu server on the lan.  What you need to do is look at the remote systems support in Studio.  This is a capability that can copy the local project files to the docroot of a remtoe server via FTP or SSH.

              1 person found this helpful
              • 4. Re: Possible to use FB4.5 for PHP without Zend Studio?
                sneakyimp Level 2

                Thanks for the info, fogpuppy.


                I do see that there is a project-specific setting for Remote Server Support.  You can select a project in your Package Explorer window and either right-click it or use the File menu and select Properties which will bring up the Properties dialog.  On the left, you can click Remote Server Support and this allows you to specify that all local changes (create, edit, rename, delete) will be applied via SSH or FTP to some server.


                However, this doesn't answer my question completely.  My Apache server doesn't have Zend Debugger installed.  It would appear from page 1 of this document that it's possible to install this without using Zend Server.  If not, then perhaps we could use XDdebug because my server does in fact have that installed, but I see under Window->Preferences->PHP->Debug->Installed Debuggers that Flash Builder 4.5 does not come with XDebug installed. Is there some way to install it?


                Also, I'm wondering what other steps might be required to have a newly created "Flex Mobile and PHP project" use the other machine on my LAN.  For instance, what is the significance of the input field "web root" in the "Create PHP Project" dialog?  The dialog expects this location to be a folder in the local file system but I expect to have my PHP files copied to the remote server using Remote Server Support option described above. Is this "Web Root" meaningful in this case?  How is it different than the project folder location?  Are files just copied to the web root folder or does the web root folder serve as the original location for these files?


                Also, it seems as though this IDE expects Zend Framework to be used somehow but I don't see any process by which this framework is automatically installed.  The documentation here leaves a lot to be desired.

                • 5. Re: Possible to use FB4.5 for PHP without Zend Studio?
                  fogpuppy Level 1

                  It is totally possible to install the Zend debugger separately, in fact the information on where to get and how to install it are in the same manual you link to a couple of lines down.


                  The PHP has to be uploaded to the server and the web root is important because that maps to the final web rootand is used in flash/php linkage.  So that should map to the web root on your server.  The project location is where the local files are saved before hte are uploaded to the server.


                  Lasly the reason that the code expects Zend Framework to be installed is because the official API for PHP to Flex is in Zend Framework.  So it must be on your server.  You can download and copy it there yourself form Framework.Zend.com and then make sure it is on your php include path.


                  So .. as an advertisment this is why we recommend people use ZendServer .. because it takes care of all of this as it's bundled in.  There is a free version (Zend Serve CE) if you don't want to pay for our commercial product.