Tutorials

How to install Laminas MVC

In this tutorial, we will show you how to install Laminas MVC skeleton application for your PHP development projects.

The following steps are for Windows OS only.

First, you must in XAMPP, please refer to another tutorial: Create local website on your PC.

Once XAMPP is installed, download and install Composer for Windows.

https://getcomposer.org/doc/00-intro.md#installation-windows

Composer should detect your PHP directory inside XAMPP during installation.

After installation, check that Composer is properly installed, by running the following command in Command Prompt.

composer --version

Next, install Git for Windows.

Refer to our installation tutorial: Control your projects with Git.

Finally, you must open Command Prompt and execute the following command.

Note: Replace the directory below with your own!

composer create-project -s dev laminas/laminas-mvc-skeleton D:\xampp\htdocs\laminas-mvc

Composer will download and install all the Laminas MVS Skeleton files from GitHub into specified directory on your computer and launch the installation process.

You will be prompted to install additional packages. You may accept all of them, by entering [Y].

Configure your URLs

Great, you have installed all needed components. Now it is time to configure the access to your local Laminas website via browser.

1) Add the following lines to the

D:\xampp\apache\conf\extra\httpd-vhosts.conf

Note: Replace the file path with your own!

<VirtualHost *:80>

DocumentRoot "D:/xampp/htdocs"

ServerName localhost

</VirtualHost>

<VirtualHost *:80>

ServerName localhost.laminas.com

DocumentRoot D:\xampp\htdocs\laminas-mvc\public

SetEnv APPLICATION_ENV "development"

<Directory D:\xampp\htdocs\laminas-mvc\public>

DirectoryIndex index.php

AllowOverride All

Require all granted

</Directory>

</VirtualHost>

2) Add the following line to the

C:\Windows\System32\drivers\etc\hosts

127.0.0.1 localhost.laminas.com

Now restart you Apache server from XAMPP.

Navigate to your site in browser:

http://localhost.laminas.com/

You must see the following page:

laminas_mvc_page

Congratulations!