Before building your application, you'll need to install the Drupal content management system. As of Drupal Version 5.0, the installation process has been vastly simplified. An automated process has been added that installs the Drupal package, including the database. Follow the steps below to perform a base installation:
Create a MySQL or PostgreSQL database for use with your Drupal install:
mysql create database your_db_name
Unpack the Drupal tarball in the HTML document root of your web server or another HTTP-accessible directory:
On Unix: Unpack the archive using the command: tar -zxvf drupal-5.x.tar.gz
On Windows: Unpack the archive using WinZip or WinRAR
Modify permissions on the default settings.php file in your_drupal_install/sites/default/settings.php to allow the install script to modify it:
On Unix: Use the command: chmod 777 your_drupal_install/sites/default/settings.php
On Windows: Use the Windows command CACLS or XACLS, or use the Windows context-sensitive menu Properties (Security tab) to modify the permissions.
Once the installation is complete, the install will direct you to a "Welcome" page. Should you have trouble with your install, see the Drupal Troubleshooting FAQ. For Windows-specific installation guidelines, see Drupal's Windows-specific guidelines page. For further information regarding the installation of Drupal, see the Drupal Installation and configuration page.
Next, install the required Drupal modules, including AMFPHP, which is an RPC stack for PHP that enables Drupal to communicate with Flex.
Enable both the Services and AMFPHP modules within the Drupal administrator's interface at:
http://your_drupal_install/admin/build/modules
For this example, I have disabled the "Use keys" and "Use sessid" options for the Services module. This is done in an effort to present the simplest possible example. To disable these options, do the following:
Once step 2 is complete, test AFMPHP by navigating your browser to http://your_drupal_install/admin/build/services and clicking on the AMFPHP - /services/amfphp link under the "Services" heading.
If AMFPHP is working properly, the output of that URL should look something like the following:
amfphp and this gateway are installed correctly. You may now connect to this gateway from Flash.
Note: If you're reading an old tutorial, it will tell you that you should see a download window instead of this message. This confused people so this is the new behaviour starting from amfphp 1.2.
View the amfphp documentation
AMFPHP is now installed.
Note: For Flex to retrieve a node from your Drupal database, you must first create one. Make sure you create at least one story, page, or other node type to retrieve by clicking the "Create content" link in your Drupal administrator's interface, selecting a node type, and submitting it. Since it is the first node in the system, it will have a node ID of 1. If the node you decide to use has a different ID, adjust the MXML Application code accordingly. You will use this node later in this tutorial.