1
0
mirror of https://github.com/restoreddev/phpapprentice.git synced 2025-07-10 01:56:20 +02:00

Added page for installing php

This commit is contained in:
Andrew Davis
2018-09-09 15:58:07 -05:00
parent 9c86b5d608
commit 3b54b84ddf
4 changed files with 47 additions and 3 deletions

View File

@ -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;

View File

@ -1,6 +1,9 @@
<div class="table-of-contents">
<h4>Table of Contents</h4>
<a href="/">Preface</a>
<ul class="list-plain">
<li><a href="/">Preface</a></li>
<li><a href="<?= page_path('installing-php') ?>">Installing PHP</a></li>
</ul>
<ol>
<li><a href="<?= page_path('basics') ?>">Basics</a></li>
<li><a href="<?= page_path('variables') ?>">Variables</a></li>

View File

@ -0,0 +1,31 @@
<?php partial('header', ['title' => 'PHP Apprentice - Installing PHP']) ?>
<div class="container center">
<div class="grid-toc">
<div>
<h1>Installing PHP</h1>
<h2>Windows 10</h2>
<ol class="body-ol">
<li>Download PHP from the <a href="https://windows.php.net/download">PHP For Windows</a> 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.</li>
<li>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.</li>
<li>Install the VC redistrubutable using the downloaded executable.</li>
<li>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".</li>
<li>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.</li>
<li>Now, you can open PowerShell or Command Prompt, type "php -v" and it will return the installed version of PHP on your system.</li>
</ol>
<h2>MacOS</h2>
<p>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.</p>
<ol class="body-ol">
<li>Install <a href="https://brew.sh/">Homebrew</a>.</li>
<li>Run "brew install php" in Terminal.</li>
<li>Check your version is correct by running "php -v" in Terminal.</li>
</ol>
</div>
<div>
<?php partial('table_of_contents') ?>
</div>
</div>
</div>
<?php partial('footer') ?>

View File

@ -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' => '',
]),