From 3b54b84ddffe354ba775238f426eb0fc9cc8c43a Mon Sep 17 00:00:00 2001 From: Andrew Davis Date: Sun, 9 Sep 2018 15:58:07 -0500 Subject: [PATCH] Added page for installing php --- assets/css/site.css | 11 +++++++- assets/templates/_table_of_contents.phtml | 5 +++- assets/templates/installing-php.phtml | 31 +++++++++++++++++++++++ config.php | 3 ++- 4 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 assets/templates/installing-php.phtml diff --git a/assets/css/site.css b/assets/css/site.css index 125e769..8e63b19 100644 --- a/assets/css/site.css +++ b/assets/css/site.css @@ -37,6 +37,9 @@ p { max-width: 40em; line-height: 1.5; } +ol { + padding-left: 1em; +} h1, h2, h3, h4 { margin: 1.414em 0 0.5em; font-weight: inherit; @@ -116,6 +119,13 @@ button:hover .icon svg { .description { max-width: 25em; } +.list-plain { + list-style: none; + padding-left: 0; +} +.body-ol li { + padding: 0.5em 0; +} .grid-code { display: grid; grid-template-columns: 400px 1fr; @@ -153,7 +163,6 @@ button:hover .icon svg { } .table-of-contents ol { margin: 1em 0; - padding-left: 1em; } .table-of-contents .section-title { font-weight: bold; diff --git a/assets/templates/_table_of_contents.phtml b/assets/templates/_table_of_contents.phtml index 88c4ad3..7a240ca 100644 --- a/assets/templates/_table_of_contents.phtml +++ b/assets/templates/_table_of_contents.phtml @@ -1,6 +1,9 @@

Table of Contents

- Preface +
  1. Basics
  2. Variables
  3. diff --git a/assets/templates/installing-php.phtml b/assets/templates/installing-php.phtml new file mode 100644 index 0000000..9d39e9e --- /dev/null +++ b/assets/templates/installing-php.phtml @@ -0,0 +1,31 @@ + 'PHP Apprentice - Installing PHP']) ?> + +
    +
    +
    +

    Installing PHP

    +

    Windows 10

    +
      +
    1. Download PHP from the PHP For Windows site. I recommend downloading the non-thread safe PHP 7.1 or 7.2 (unless you want to use Apache and you know if you do). You will also need to choose 32 bit (x86) or 64 bit (x64) depending on your version of Windows.
    2. +
    3. Download the corresponding Visual C++ Redistributable from the same site. For PHP 7.1, it is VC14 and for PHP 7.2, it is VC15.
    4. +
    5. Install the VC redistrubutable using the downloaded executable.
    6. +
    7. The PHP download comes in a zip folder. Extract the zip folder into your user directory in a folder named "php". The path should look like "C:\Users\username\php".
    8. +
    9. Next, we need to add PHP to your environment variables path. Open System under Control Panel. Go to the "Advanced tab" and select "Environment Variables". In the "User variables" section. Select "Path" and click the "Edit" button. You will see a list of different folder paths. Add the PHP path to the list using the "Add" button. The PHP path is the same folder where you extracted PHP.
    10. +
    11. Now, you can open PowerShell or Command Prompt, type "php -v" and it will return the installed version of PHP on your system.
    12. +
    + +

    MacOS

    +

    Good news! Each version of MacOS comes with PHP by default. However, if you are running an older version of MacOS or OS X, then you will need to manually install a new version of PHP. To check your current version, open Terminal and type "php -v". You will need at least PHP 7.1 on your computer to use all the features in these tutorials.

    +
      +
    1. Install Homebrew.
    2. +
    3. Run "brew install php" in Terminal.
    4. +
    5. Check your version is correct by running "php -v" in Terminal.
    6. +
    +
    +
    + +
    +
    +
    + + diff --git a/config.php b/config.php index 7a8e2ed..8ae6801 100644 --- a/config.php +++ b/config.php @@ -10,6 +10,7 @@ return [ 'files_dir' => __DIR__ . '/assets/files', 'pages' => [ Page::create('index', 'index.phtml'), + Page::create('installing-php', 'installing-php.phtml'), Page::create('credits', 'credits.phtml'), Page::create('404', '404.phtml'), Page::create('basics', null, 'basics.php', [ @@ -97,7 +98,7 @@ return [ ]), Page::create('static', null, 'static.php', [ 'title' => 'Static', - 'subtitle' => 'Adding properties and functions to the blueprint', + 'subtitle' => 'Class properties and methods', 'previous' => 'classes-constructor', 'next' => '', ]),