| | |
|
|
|
Installing and configuring PHP
You can use PHP to develop Project Zero applications and new PHP extensions for Project Zero. The following sections of this article provide information about installing and configuring PHP:
Choosing your development environment
To begin developing a Project Zero application using PHP, choose one of the following supported development environments:
Accessing the Zero application
The PHP scripts should end with a .php extension and can be referenced by a URL relative to the public folder. For example, to access a file, say hello.php file in the public folder, use the URL http://localhost:8080/hello.php (assuming the application port default of 8080).
Using configuration files
While Zero applications are set up to favor convention (based on the application directory structure) over configuration, the basic conventions can be mostly overridden, if necessary, using configuration. Certain aspects, such as setting up database access, do require configuration. A typical PHP Zero application has the following configuration files:
- <appname>/config/php.ini
- This file contains any enablement of extensions for the PHP interpreter and any other configuration specific to the PHP language support in the engine. See the php.ini section.
If this file does not exist, a default configuration for the PHP interpreter will be used. The latest recommended php.ini is available here.
- <appname>/config/zero.config
- This file is common for all Zero applications and contains all the configuration specific to the application being developed. For more information on configuring zero.config, see the Configuring components section.
- <appname>/config/ivy.xml
- Project Zero applications use ivy to manage dependencies, packaging, and updates from the Zero repositories. This file is used to set up dependencies for database drivers and third party libraries for PHP and Ajax. The use of this file is described at length in the DependencyResolution article of the Core Developer's Guide.
Command line users need to remove the default zero.core dependency and add zero.php as a dependency to application in the ivy.xml file.
- After you add the dependency, the
ivy.xml might look as follows.
-
<dependencies>
<dependency org="zero" name="zero.core.webtools" rev="1.0+"/>
<dependency org="zero" name="zero.php" rev="1.0+"/>
</dependencies>
- Then run resolve to include the new dependencies.
-
zero resolve -resolver remote
- <appname>/config/logging.properties
- The logging.properties file is used primarily for advanced troubleshooting of the Project Zero engine. Such logging should be sparingly used as it can affect the performance of the system.
|
|
r18 - 15 Feb 2008 - 16:35:19 - steveims
|
|
|
| | |