Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Yii

You're reading from   Mastering Yii Advance your modern web application development skills with Yii Framework 2

Arrow left icon
Product type Paperback
Published in Jan 2016
Publisher Packt
ISBN-13 9781785882425
Length 380 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Charles R. Portwood ll Charles R. Portwood ll
Author Profile Icon Charles R. Portwood ll
Charles R. Portwood ll
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Preface 1. Composer, Configuration, Classes, and Path Aliases FREE CHAPTER 2. Console Commands and Applications 3. Migrations, DAO, and Query Building 4. Active Record, Models, and Forms 5. Modules, Widgets, and Helpers 6. Asset Management 7. Authenticating and Authorizing Users 8. Routing, Responses, and Events 9. RESTful APIs 10. Testing with Codeception 11. Internationalization and Localization 12. Performance and Security 13. Debugging and Deploying Index

What you need for this book

To ensure a consistent development environment and prevent unnecessary alterations to your host operation system, it is highly recommended that you run all commands within a Linux virtual machine. This will ensure that your output both in your web browser and from your command line matches the output that is presented in this book. As setting up this environment on your own can be a daunting task, prebuilt virtual machines that use VirtualBox and Vagrant are provided to make this setup process easy.

To get started with this book, you should be running the latest version of either Microsoft Windows 7, 8, 8.1 or 10, Apple OS X 10.9 or higher, or a Linux operating system that can run virtual machines, such as Ubuntu 14.04 LTS. Additionally, you will need to install the latest version of VirtualBox (available at https://www.virtualbox.org/wiki/Downloads) and Vagrant (available at https://www.vagrantup.com/downloads.html).

Note

After installing these software dependencies, you may need to restart your computer for the changes to take effect.

After installing VirtualBox and Vagrant, you can then create a new dedicated development environment by opening a new command line or terminal window, creating a new directory for the chapter, and then running the following command to create your virtual machine development environment. These commands will download a prebuilt virtual machine containing all the software required to get you started and start your new development environment:

vagrant init charlesportwoodii/php56_trusty64
vagrant up --provider virtualbox
vagrant ssh

Note

More information on this specific Vagrant box can be found at https://atlas.hashicorp.com/charlesportwoodii/boxes/php56_trusty64.

Note that if you are on Windows, you may need a tool such as PuTTy to connect to your virtual machine over SSH. More information on how to connect to your new virtual machine over SSH on Windows can be found at http://docs-v1.vagrantup.com/v1/docs/getting-started/ssh.html.

Once your new Vagrant box has started, you can access the files of this virtual machine over SSH and access your webroot directory by opening a new browser window and navigating to http://localhost:8080. By default, when you open this web page, you will see the output of phpino().

Tip

Depending upon your operating system security settings, your computer may prompt or block you from accessing port 8080 on your computer. Ensure that you configure your firewall settings if you are facing issues and ensure that port 8080 is open on your computer and that VirtualBox can forward connections from your host operating system to your guest operating system.

As Yii2 is fully compatible with PHP7, it is strongly suggested that you develop and test your web applications against PHP7 as well. The following commands will allow you to provision a PHP7 Vagrant box:

vagrant init charlesportwoodii/php7_trusty64
vagrant up --provider virtualbox
vagrant ssh

Tip

As these virtual machines automatically configure port forwarding, it is recommended that you only run a single virtual machine at a time. Refer to the Vagrant documentation for a complete list of commands and configuration options at https://docs.vagrantup.com/v2.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image