- Learning PHP 7
- Antonio Lopez
- 484字
- 2021-07-09 20:17:38
Setting up the environment on Windows
Even though it is not very professional to pick sides based on personal opinions, it is well known among developers how hard it can be to use Windows as a developer machine. They prove to be extremely tricky when it comes to installing all the software since the installation mode is always very different from OS X and Linux systems, and quite often, there are dependency or configuration problems. In addition, the command line has different interpreters than Unix systems, which makes things a bit more confusing. This is why most developers would recommend you use a virtual machine with Linux if you only have a Windows machine at your disposal.
However, to be fair, PHP 7 is the exception to the rule. It is surprisingly simple to install it, so if you are really comfortable with your Windows and would prefer not to use Vagrant, here you have a short explanation on how to set up your environment.
Installing PHP
In order to install PHP 7, you will first download the installer from the official website. For this, go to http://windows.php.net/download. The options should be similar to the following screenshot:

Choose x86 Thread Safe for Windows 32-bit or x64 Thread Safe for the 64-bit one. Once downloaded, uncompress it in C:\php7
. Yes, that is it!
Installing MySQL
Installing MySQL is a little more complex. Download the installer from http://dev.mysql.com/downloads/installer/ and execute it. After accepting the license agreement, you will get a window similar to the following one:

For the purposes of the book—and actually for any development environment—you should go for the first option: Developer Default. Keep going forward, leaving all the default options, until you get a window similar to this:

Depending on your preferences, you can either just set a password for the root user, which is enough as it is only a development machine, or you can add an extra user by clicking on Add User. Make sure to set the correct name, password, and permissions. A user named test
with administration permissions should look similar to the following screenshot:

For the rest of the installation process, you can select all the default options.
Installing Nginx
The installation for Nginx is almost identical to the PHP 7 one. First, download the ZIP file from http://nginx.org/en/download.html. At the time of writing, the versions available are as follows:

You can safely download the mainline version 1.9.10 or a later one if it is stable. Once the file is downloaded, uncompress it in C:\nginx
and run the following commands to start the web server:
$ cd nginx $ start nginx
Installing Composer
To finish with the setup, we need to install Composer. To go for the automatic installation, just download the installer from https://getcomposer.org/Composer-Setup.exe. Once downloaded, execute it in order to install Composer on your system and to update your PATH
environment variable.
- 深入核心的敏捷開發:ThoughtWorks五大關鍵實踐
- 軟件項目估算
- 移動UI設計(微課版)
- C語言程序設計案例教程(第2版)
- 零基礎學MQL:基于EA的自動化交易編程
- Java系統化項目開發教程
- GameMaker Essentials
- Struts 2.x權威指南
- 玩轉.NET Micro Framework移植:基于STM32F10x處理器
- 快樂編程:青少年思維訓練
- C#網絡編程高級篇之網頁游戲輔助程序設計
- 美麗洞察力:從化妝品行業看顧客需求洞察
- Analytics for the Internet of Things(IoT)
- jQuery EasyUI從零開始學
- Image Processing with ImageJ(Second Edition)