Information technology and marketing: in this blog you will find useful information on study paths in the fields of information technology, marketing, the web and programming. It is also possible to find didactic material and guides to be operational in the various professional sectors!

How to make a Zend project?

How to make a Zend project?

By daniele

Installation using Composer. The easiest way to create a new Zend Framework project is to use Composer. If you haven’t already done so, follow the instructions to install it. To create a new Zend project: $ composer create-project zendframework / skeleton application path / to / install.

Before you start setting up your first ZF2 project, make sure that the following software is installed and configured in your development environment:

  • PHP command-line interface 
  • Git: Git needs to check out source code from various repositories 
  • Composer: Composer is a dependency management tool used to manage PHP dependencies.

Zend project

To set up a new Zend project, you need to download the latest version of the Zend Skeleton Application and set up a virtual host that points to the newly created Zend Framework project. The procedure is as follows:

  • Navigate to that folder where you want to set up your new Zend Framework project. 
  • Clone the Zend Skeleton Application app from GitHub. In some Linux configurations, the current user may not have the required permissions to write to / var/www. In such cases, you can use the writable folder to make any necessary changes to the virtual host’s configuration. 
  • Use Composer to install the dependencies. Before adding a virtual host entry, you must set a hostname entry in the host file so that the system points to the local machine when using the new hostname. On Linux, this can be done by adding an entry to the / etc / hosts file.
  • Add the following line to the host’s file:

127.0.0.1 comm-app.local

  • Our next step would be to add a virtual host entry to our web server; this can create a new virtual host’s configuration file:

$ sudo vim /usr/local/zend/etc/sites.d/vhost_comm-app-80.conf

  • Add following configuration bellow to the virtual host file:

<VirtualHost *:80>

ServerName comm-app.local

DocumentRoot /var/www/CommunicationApp/public

SetEnv APPLICATION_ENV “development”

<Directory /var/www/CommunicationApp/public>

DirectoryIndex index.php

AllowOverride All

Order allow,deny

Allow from all

</Directory>

</VirtualHost>

  • After configuring the virtual host file, the web server needs to be restarted
  • Once the installation process is completed, you should be able to open https://comm-app.local on your web browser.

Make sure the URL you select points to the location of the index.php file on your server (by default, this is https://localhost/ZendProject/www/index.php). Click OK. You may see a path mapping dialog asking you to select a local location for your front controller.

Syrus