How to start using Zend Framework 2.x?
The Zend Framework is installed in the "frameworks" folder in the installation directory. To run any command, it is necessary to start the BitNami Console. If you are using a Virtual Appliance or AMI, you can run the commands below directly.
These are the folders that you can find in the zendframework folder:
conf config data module public vendor
In the "conf" folder, you can find the Apache configuration file. You can modify that you change the URL. In the "application" and "zendframework" folders are the Zend Framework files. The "public" folder will be the only available on the web site.
To enable the sample application, you should uncomment the following line at the end of the installdir/apache2/conf/httpd.conf file:
Then restart the Apache server and point your browser at http://mydomain/zendframework/.
./ctlscript.sh restart apache
To start a project, you have to create a module. You can find more information about Zend Framework modules at: http://framework.zend.com/manual/2.0/en/user-guide/modules.html. You also can find the complete official Zend Framework documentation at http://framework.zend.com/manual/2.0/en/index.html.
How to create a project with Zend Framework 1.x?
The Zend Framework is installed in the "frameworks" folder in your installation directory. If you are using the Native installer, to start a project with Zend Framework, it is necessary to start the BitNami Console. If you are using a Virtual Appliance or AMI, you can run the commands below directly.
To be able to create a new Zend project, you should use the "zf" tool.
$ zf create project demo
On Windows, the zf tool is called "zf.bat".
You can see something similar to this:
Creating project at /path/to/demo Note: This command created a web project, for more information setting up your VHOST, please see docs/README Testing Note: PHPUnit was not found in your include_path, therefore no testing actions will be created.
If you want to use PHPUnit for creating tests, you can install it using the following command:
$ pear install phpunit
This command will create a new directory called "demo" with the following schema:
$ application docs library public tests
Into the application folder there are the main directories for your applicaion:
Bootstrap.php configs controllers models views
Now it is necessary configure create the configuration file for the Apache server (or another web server). In this guide we are going to use two approaches. The first one is using the Alias approach and let you have your application in "http://mydomain/demo".
Alias /demo "/path/to/demo/public" SetEnv APPLICATION_ENV "development" <Directory "/path/to/demo/public"> Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all </Directory>
If you want to have your application in the root "http://mydomain/" you can configure a Virtual Host.
<VirtualHost *:80> ServerName quickstart.local DocumentRoot /path/to/demo/public SetEnv APPLICATION_ENV "development" <Directory /path/to/demo/public> DirectoryIndex index.php AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost>
Then it is necessary to include this file in the Apache configuration. You can add the following line at the end of the "installdir/apache2/conf/httpd.conf" file:
$ ./ctlscrip.sh restart apache
You can find more info about Zend Framework at http://framework.zend.com/manual/en/learning.quickstart.create-project.html