mirror of
https://github.com/codeguy/php-the-right-way.git
synced 2025-08-12 08:43:58 +02:00
Added 'Getting Started' Section
Contains basic information guiding new users toward the latest version of PHP. Moved the CLI web server section into Getting Started because it makes more sense here. Added stubs for windows and mac setups that could certainly be further fleshed out with step-by-step tutorials.
This commit is contained in:
37
_includes/getting-started.md
Normal file
37
_includes/getting-started.md
Normal file
@@ -0,0 +1,37 @@
|
||||
# Getting Started
|
||||
|
||||
## Use the Current Stable Version (5.4)
|
||||
|
||||
If you are just getting started with PHP make sure to start with the current stable release of [PHP 5.4][php-release]. PHP has made great strides adding powerful [new features](#language_highlights) over the last few years. Don't let the minor version number difference between 5.2 and 5.4 fool you, it represents _major_ improvements.
|
||||
|
||||
## Built-in web server
|
||||
|
||||
You can start learning PHP without the hassle of installing and configuring a full-fledged web server (PHP 5.4 required). To start the server, run the following from your terminal in your project's web root:
|
||||
|
||||
> php -S localhost:8000
|
||||
|
||||
* [Learn about the built-in, command line web server][cli-server]
|
||||
|
||||
[php-release]: http://www.php.net/downloads.php
|
||||
[cli-server]: http://www.php.net/manual/en/features.commandline.webserver.php
|
||||
|
||||
## Windows Setup
|
||||
|
||||
You can install PHP on windows from an install executable found on the official [PHP Downloads][php-downloads] page. For a complete Apache, MySQL, and PHP installation check out [WAMP][wamp-installer].
|
||||
|
||||
* [Read more about the official PHP Windows Installer][windows-installer]
|
||||
|
||||
[php-downloads]: http://www.php.net/downloads.php
|
||||
[windows-installer]: http://www.php.net/manual/en/install.windows.installer.msi.php
|
||||
[wamp-installer]: http://www.wampserver.com/
|
||||
|
||||
## Mac Setup
|
||||
|
||||
OSX comes prepackaged with PHP. As of Mountain Lion, it is _not_ the current stable version of PHP, though. You can get the PHP executable through a number of Mac [package managers][mac-package-managers] or [compile it yourself][mac-compile] (if compiling, be sure to have Xcode, or [this substitution][xcode-gcc-substitution], installed). For a complete Apache, MySQL, and PHP installation check out [MAMP2][mamp-downloads].
|
||||
|
||||
[mac-package-managers]: http://www.php.net/manual/en/install.macosx.packages.php
|
||||
[mac-compile]: http://www.php.net/manual/en/install.macosx.compile.php
|
||||
[xcode-gcc-substitution]: https://github.com/kennethreitz/osx-gcc-installer
|
||||
[mamp-downloads]: http://www.mamp.info/en/downloads/index.html
|
||||
|
||||
[Back to Top](#top){.top}
|
@@ -66,14 +66,9 @@ To run our script, above, from the command line:
|
||||
> php hello.php world
|
||||
Hello, world
|
||||
|
||||
### Built-in, command line web server
|
||||
|
||||
Starting with PHP 5.4, you can develop locally on a PHP-enabled web server without the hassle of installing and configuring a full-fledged web server. To start the server, from your web root:
|
||||
|
||||
> php -S localhost:8000
|
||||
|
||||
* [Learn about running PHP from the command line][php-cli]
|
||||
* [Learn about the built-in, command line web server][cli-server]
|
||||
* [Learn about setting up Windows to run PHP from the command line][php-cli-windows]
|
||||
|
||||
[Back to Top](#top){.top}
|
||||
|
||||
@@ -90,5 +85,5 @@ Starting with PHP 5.4, you can develop locally on a PHP-enabled web server witho
|
||||
[cli-options]: http://www.php.net/manual/en/features.commandline.options.php
|
||||
[argc]: http://php.net/manual/en/reserved.variables.argc.php
|
||||
[argv]: http://php.net/manual/en/reserved.variables.argv.php
|
||||
[cli-server]: http://www.php.net/manual/en/features.commandline.webserver.php
|
||||
[php-cli]: http://php.net/manual/en/features.commandline.php
|
||||
[php-cli-windows]: http://www.php.net/manual/en/install.windows.commandline.php
|
||||
|
@@ -29,6 +29,14 @@
|
||||
<nav class="site-navigation">
|
||||
<ul>
|
||||
<li><a href="#site-header">Welcome</a></li>
|
||||
<li><a href="#getting_started">Getting Started</a>
|
||||
<ul>
|
||||
<li><a href="#use_the_current_stable_version_54">Use the Current Stable Version (5.4)</a></li>
|
||||
<li><a href="#builtin_web_server">Built-in Web Server</a></li>
|
||||
<li><a href="#windows_setup">Windows Setup</a></li>
|
||||
<li><a href="#mac_setup">Mac Setup</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#code_style_guide">Code Style Guide</a></li>
|
||||
<li><a href="#language_highlights">Language Highlights</a>
|
||||
<ul>
|
||||
|
@@ -5,6 +5,9 @@ layout: default
|
||||
{% capture welcome_content %}{% include welcome.md %}{% endcapture %}
|
||||
{{ welcome_content|markdownify }}
|
||||
|
||||
{% capture getting_started_content %}{% include getting-started.md %}{% endcapture %}
|
||||
{{ getting_started_content|markdownify }}
|
||||
|
||||
{% capture codestyleguide_content %}{% include code-style-guide.md %}{% endcapture %}
|
||||
{{ codestyleguide_content|markdownify }}
|
||||
|
||||
|
Reference in New Issue
Block a user