Book Image

Beginning PHP

By : David Carr, Markus Gray
Book Image

Beginning PHP

By: David Carr, Markus Gray

Overview of this book

<p>PHP is the preferred server-side scripting language for tech giants such as Facebook, Wikipedia, and Tumblr despite full-stack JavaScript gaining popularity with upcoming developers. This is because PHP performs better when dealing with heavy computations on the back end. In this book, you’ll learn everything you need to get up and running with the latest version of PHP, including package management with tools such as composer, secure database operations, and a whole host of other best practices that will help you stay a step ahead of traditional programmers. </p><p> </p><p></p>
Table of Contents (12 chapters)
Beginning PHP
Contributors
Preface
Free Chapter
1
Getting Started with PHP
2
Arrays and Loops
Index

Activity: Using Composer to Install Dependencies


Suppose you are working on a PHP project and you need a lot of dependencies for your project. You are on a strict deadline, yet, you cannot proceed ahead before adding those dependencies. You discovered that you can use Composer to install dependencies automatically. You now need to install Composer.

The aim of this activity is to get you acquainted with Composer installation.

To perform this activity, follow these steps:

  1. Run the framework by opening Terminal or command prompt.

  2. If on Windows, navigate to the framework folder and launch the php server:

    php –S localhost:8000 –t Webroot

    Note

    The –S means that run the server and use localhost:8000 as it's address, and –t Webroot sets the document root to the Webroot folder.

    The Terminal output will look like this (some of the details will be different on your system):

    PHP 7.1.4 Development Server started at Wed Nov 29 20:37:27 2017
    Listening on http://localhost:8000
    Document root is /Users/davidcarr/Dropbox...