Archive for June, 2010

Flash builder: Zend data service files to server

Sunday, June 13th, 2010

Recently, I wanted to learn how to use the Zend framework with Flash builder. I found a (**)tutorial, which explains the use of Zend with MAMP. I created all those files and the database and it worked. Now I wanted to upload these files to the server. However, this does not work without changes.

I uploaded the folder “ZendFramework” to the server. I created a folder flashbuilder to where I uploaded all the flash movie files. I changed the script “ClientsService.php”, which is located in the services folder. These are the database variables, which have to be changed to the new database names except for the port and the table name.

  • var $username = “root”;
  • var $password = “root”;
  • var $server = “localhost”;
  • var $port = “3306”;//no change
  • var $databasename = “fb4”;
  • var $tablename = “clients”;// no change
  • This is all, which needs to be done in this file. We don’t need to make any changes in “gateway.php”. We need to change the amf_config.ini file. Originally on the harddrive the file looked like this:

    ;set the absolute location path of webroot directory, example:
    ;Windows: C:\apache\www
    ;MAC/UNIX: /user/apache/www
    webroot =/Applications/MAMP/htdocs
    ;set the absolute location path of zend installation directory, example:
    ;Windows: C:\apache\PHPFrameworks\ZendFramework\library
    ;MAC/UNIX: /user/apache/PHPFrameworks/ZendFramework/library
    ;zend_path =
    amf.production = false

    We change the webroot variable to

    webroot = /home/content/x/y/z/xyzaaa30/html

    You find this path by creating a php info file:

    <?php phpinfo(); ?>

    and opening the file in your browser. The “DOCUMENT_ROOT” value in the table is what you are looking for. The next path we need to change is the path to the ClientsService.php file for Zend to find. So change to something like this.


    In my case the folder with all the flash files is “FlexZend”, since I exported the release built from Flash builder. Now you can test your application and it should work.

    (**) The former link has been replaced by a new link because of a bad web site.