Now you are ready to create a project in Zend Studio that can be used for both Flex and PHP code. Flex Builder has a Flex project type named PHP. If you create this type of project, it will have only a Flex nature and not a PHP nature, thus some PHP features provided by the Zend Studio will not be available for your project.
To have both natures, first create your PHP project. Choose File > New > Project (see Figure 2). In the wizard select PHP > PHP project (see Figure 3) and then click Next. When the PHP Project wizard opens, specify a project name (in this example I used flex_project) and select Enable project specific settings. Click Finish (see Figure 4).

Figure 2. Opening the New Project Wizard

Figure 3. Choosing the PHP Project type

Figure 4. The PHP project wizard
Once you have created the project, right-click on it and choose Flex Project Nature > Add Flex Project Nature (see Figure 5). This wizard will add Flex nature to your PHP project, so you will be able to create Flex applications and compile them as you would in any Flex project.

Figure 5. Adding the Flex Project Nature
Clicking Add Flex Project Nature starts a wizard that looks very similar to the new Flex Project Wizard. Select PHP as the Application server type and then click Next (see Figure 6).

Figure 6. The first page of the Add Flex nature wizard
On the second page of the wizard (see Figure 7), enter the path to your web root folder and the URL for this path. For example, on my machine these are c:\htdocs and http://localhost.

Figure 7. The final page of the Add Flex nature wizard
You could also use a network path or a folder that is under your web server root. For example, maybe you have a folder named tests under your root server. In this case the values will be c:\htdocs\tests and http://localhost/tests. After you enter these values, click Validate Configuration. If your server has not started, or if you mispelled the URL or the web root location, you will see a warning. Click Finish when you are done. You should now have a project like the one shown in Figure 8.

Figure 8. The combined Flex and PHP project
A few notes on these last steps: