Zend2 Localised

ZendFramework2ZendFramework2

What is ZendFramework?

As of this writing ZendFramework has moved to Laminas. Watch out for a follow up.

In this article:

  1. Installation of ZendFramework
  2. Localhost host configuration
  3. Apache VirtualHost server configuration
  4. Verifying your application

1. Installation of ZendFramework

Navigate to the web root:

1cd /Applications/MAMP/htdocs/

Clone the repo

⚠ For convenience ZendFramework is included in the repo. If you get stuck drop a comment below. Also checkout the Laminas project as this article was written a whiles back.

2. Localhost host configuration

Open and edit the hosts file to add a local development domain

1sudo vi /private/etc/hosts

Append the comment and host entry to the file

1#zend2localised local server
2127.0.0.1 zend2-localised

Test the new entry. The command below should not timeout.

1ping -c 4 zend2-localised

3. Apache VirtualHost server configuration

Add a VirtualHost configuration entry for the phalconbasic site

⚠ You may need to enable virtual hosts if its a fresh install if so uncomment: Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf in your httpd.conf then change Listen 8888 -> Listen 80. Stop and Start apache.

1# zend2-localised
2<VirtualHost *:80>
3    ServerAdmin admin@zend2-localised
4    DocumentRoot "/Applications/MAMP/htdocs/zend2-localised/public"
5    ServerName zend2-localised
6    ErrorLog "/Applications/MAMP/logs/zend2-localised-error"
7    CustomLog "/Applications/MAMP/logs/zend2-localised-access" common
8    <Directory "/Applications/MAMP/htdocs/zend2-localised/public">
9        DirectoryIndex index.php
10    </Directory>
11</VirtualHost>


Test the paths and verify nothing broken, the command should output. Syntax OK

1/Applications/MAMP/bin/apache2/bin/httpd -t

4. Verifying your application

Navigate to

  • http://zend2-localised/en-gb 🎉
  • http://zend2-localised/fr-fr 🎉

Secured By miniOrange