The environmental requirements of THINKPHP5 are as follows:
- PHP >= 5.4.0
- PDO PHP Extension
- Mbstring PHP Extension
- CURL PHP Extension
Strictly speaking, thinkphp does not need the installation process, the installation is actually put thinkphp framework into the Web Runtime environment ( if your web environment is OK), you can obtain and install the thinkphp in two ways.
First, download thinkphp installation
There are many ways to get thinkphp, the official website (http://thinkphp.cn) is the best source of downloads and documentation.
The website provides a stable version of the download: http://thinkphp.cn/down/framework.html
Second, the use of composer installation
thinkphp supports the use of Composer installation, and if Composer is not yet installed, you can install it by using the composer installation method. In Linux and Mac OS X, you can run the following command:
curl-ss https://getcomposer.org/installer | phpmv Composer.phar /usr/local/bin/composer
In Windows, you need to download and run Composer-setup.exe.
If you encounter any problems or want to learn more about Composer, please refer to the Composer documentation (English), Composer Chinese.
If you have installed Composer please make sure to use the latest version, you can use composer self-update command update composer to the latest version.
composer create-project Topthink/think tp5 dev-master --prefer-dist
Because it has not yet been formally released, so first use dev-master Branch.
If you have an error, follow the instructions or refer to the composer Chinese document.
If the domestic visit composer speed is relatively slow, you can refer to the instructions here to use the domestic mirror
Third, git installation
If you don't know much aboutComposerOr thinkComposerToo slow, you can also usegitVersion library installation and update,ThinkPHP5.0Split into multiple warehouses, mainly including:
- Application Projects:
https://github.com/top-think/think
- Core framework:
https://github.com/top-think/framework
is designed for application and core warehouse separation, is to support composer Updates the core framework separately.
First clone download Application project Warehouse
git clone https://github.com/top-think/think tp5
then switch to TP5 the directory, and then clone the core Framework warehouse:
git clone https://github.com/top-think/framework thinkphp
Two warehouses after cloning completed, completed the thinkphp5.0 git mode Download, if you need to update the core framework, only need to switch to the thinkphp core directory, and then execute:
git pull https://github.com/top-think/framework
If unfamiliar with git command line can be used by any GIT client and is no longer described in detail here.
No matter what approach you take to get the thinkphp framework, now it's only a final step to verify that it's working.
Enter the address in the browser:
http://localhost/tp5/public/
If the browser outputs:
Congratulations, now you have finished thinkphp installation!
If you are unable to run properly and display thinkphp the Welcome page of the , then check your server environment:
- PHP
5.4 Version ( Note: Php5.4dev version and PHP6 are not supported )
- Whether the Web server starts normally
thinkphp5.0 Installation