Apache NetBeans 12.5
- Setting Up a PHP Project
- Getting Ready
- To set up a PHP project:
- Specifying the Project Name and Location of the Source Files
- Project without Previously Developed Source Files
- Importing Existing Local Source Files into a Project
- Importing Existing Remote Source Files into a Project
- Specifying the Default Run Configuration of the New Project
- Local Web Site
- Remote Web Site
- Customizing the Project Setup
- Run Configuration
- PHP Include Path
- To define global IDE formatting:
- To define project-specific formatting:
Specifying the Default Run Configuration of the New Project
A run configuration is a stored setting for running a PHP project. You can define several configurations for one project and switch between them back and forth. For example, if an application has been developed locally and needs to be uploaded to a remote production server, you only need to choose another run configuration. Run configurations apply to both running and debugging. Run configurations accommodate the following common use cases:
- Developing PHP web pages on a local machine with a local web server.
- Executing PHP scripts using a local PHP engine. This approach is applied to PHP files that are not intended for outputting HTML. Therefore such scripts can be run without a browser.
- Remote Development. The PHP source code and other application files are uploaded to a remote web server via FTP. This use case is common when the development is shared across multiple people.
- A combination of the above use cases: an application is developed locally and deployed on a remote production server upon completion. During development, PHP scripts are executed if necessary.
When you create a new PHP project, you create the project’s default run configuration. To set the default run configuration for your project, choose the relevant option from the Run As dropdown list on the Run Configuration panel. The following options are available:
- Local Web Site. To use this run configuration, you need the Apache http server installed and running.
- Remote Web Site (FTP/SFTP) (Separate tutorial). To use this configuration, you need a hosting account on a remote server and an FTP account on this server.
- Script. This run configuration does not require that a web server be installed and running. You only need a PHP engine.
The process for creating additional run configurations, or editing the default run configuration, is described in Customizing the Project Setup: Run Configuration. It is almost identical to the process for creating the default run configuration, except that you use the Properties dialog of the existing project instead of the new project wizard.