This document will get you up and running with Apify.
- Check that you have installed and configured Apache with PHP 5.2 or higher.
- Enable mod_rewrite on your local server.
Create a virtual host:
<VirtualHost *:80> ServerName mysite.com DocumentRoot /path/to/mysite.com/public <Directory /path/to/mysite.com/public> DirectoryIndex index.php AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost>
Test your installation by requesting:
GET /example/request GET /example/response.json GET /example/response.xml
- Create a MySQL database and user/password.
- Import the schema.sql file into your database.
- Open the config.php file and set your database settings.
- Make sure the pdo_mysql PHP extension for MySQL is enabled.
The directory structure of an Apify web application is standardized to keep things as simple as possible.
project/ app/ controllers/ IndexController.php models/ views/ error/ index/ index.phtml layout/ main.phtml config/ config.php routes.php library/ Request.php Response.php public/ css/ img/ js/ index.php tests/
Here's an example of a Custom Directory Structure (GitHub)
Apify implements two distinct environments: DEV mode during the development phase and PROD mode when the application is deployed.
You can run an application either in a DEV or PROD mode. You toggle this mode using the DEBUG configuration setting. When DEBUG is set to true, Apify will display exceptions and errors (E_ALL and E_STRICT) in the browser. The PROD mode is fully optimized for production.