This is a simple, application using the ZF2 MVC layer and module systems. This application was created using the ZF2 skeleton application and provides the step to install in on a Windows server.
To get a working copy of this project, clone the repository and manually invoke composer
using the shipped
composer.phar
:
cd my/webroot
git clone git://github.com/enterlight/student-sample.git
cd student-sample
php composer.phar self-update
php composer.phar install
(The self-update
directive is to ensure you have an up-to-date composer.phar
available.)
The simplest way to get started if you are using PHP 5.4 or above is to start the internal PHP cli-server in the root directory:
php -S 0.0.0.0:8080 -t public/ public/index.php
This will start the cli-server on port 8080, and bind it to all network interfaces.
**Note: ** The built-in CLI server is for development only.
To setup apache, setup a virtual host to point to the public/ directory of the project and you should be ready to go! It should look something like below:
<VirtualHost *:80>
ServerName zf2-tutorial.localhost
DocumentRoot /path/to/zf2-tutorial/public
SetEnv APPLICATION_ENV "development"
<Directory /path/to/zf2-tutorial/public>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
To access the Address Book sample, type http://zf2-tutorial.localhost/ab in your browser
A web.config
file is included for IIS 7. This will make sure all requests are redirected to the index.php file.
To access the Addressbook sample, type http://localhost/student-sample/public/ab in your browser or
create a Virtual Server to point to /student-sample/public and use the following url to access the application: http://private_server/ab.
Instructions from Microsoft to create a virtual server are found here: https://support.microsoft.com/en-us/kb/816576