Home >Backend Development >PHP Tutorial >PHP development environment construction - laravel framework, apache server, git version control, laravelgit_PHP tutorial
This article mainly explains the development environment installation before starting the project - the back end is php, the front end Use grunt for automated builds. It specifically introduces the environment construction using apache to run php under the windows platform, as well as the installation of git tools. The writing is a bit rough, but the process is complete. Please forgive me for any shortcomings.
1. GitTool Installation
1)https://github.com Registergithubaccount
2) Install PHPGit-1.9.5-preview20150319.exe
3) Set Git user name and email:
$ git config --global user.name "xuhaiyan" $ git config --global user.email "haiyan.xu.vip@gmail.com"
4) Process of generating SSH key:
1. Check if you already have the ssh key (use Git Bash, do not use cmd): cd ~/.ssh
If there is no key, this folder will not exist. If there is, backup and delete it
2. Generate key:
$ <span>ssh-keygen</span> -t rsa -C “haiyan.xu.vip@gmail.com”
Press 3 Enter keys, the password is empty.
Your identification has been saved in /home/tekkub/.ssh/id_rsa.
Your public key has been saved in /home/tekkub/.ssh/id_rsa.pub.
The key fingerprint is:
………………
Finally, we got two files: id_rsa (private key) and id_rsa.pub (public key)
3. Add key (public key) to ssh: ssh-add file name
Log in to your github account, enter the company project, click Settings/SSH Keys/Add SSH Key
5) Clone the project code locally (assuming the cloned code is to E:bd-shop), please fill in the corresponding project code address
git clone git@github.com:xxx.git
2. phpTool installation
1) Install phpEditor: Sublime Text Build 3083 x64 Setup.exe
Or install phpstorm for more powerful functions
3. Install WampServerIntegrated software package: wampserver2.5-Apache-2.4.9-Mysql-5.6.17-php5.5.12-32b.exe(32 bits)
(W: windowssystem; a:Apacheserver; m:mysqldatabase; p:phplanguage)
Possible errors: The following dialog box will pop up:
Solution: Download VSU4vcredist_x86.exe at http://www.microsoft.com/zh-CN/download/details.aspx?id=30679 and install it (note that wamp server is 32-bit Yes, so install x84 instead of x64)
If vcredist_x86.exe cannot be installed, you can use nginx to start php, which will be explained in a future article.
4. Change the apache configuration and set the Apache server homepage to the company project:
1)C:wampbinapacheapache2.4.9confhttpd.conf, remove the LoadModule rewrite_module modules/mod_rewrite.so front The comment character '#'
2) Set the DocumentRoot path to E:bd-shoppublic (based on the first section above 5 points)
3) Change fb943dc690d1595d509a0d75a92ec453 to
Note: The installation is correct, but apache cannot be started( is displayed in orange) , then the default is 80. The port needs to be changed. The port number is set to 1024. Ports, such as 8888, 8080, etc. The method is as follows:
C:wampbinapacheapache2.4.9confhttpd.conf,
Changed Listen 0.0.0.0:80 to Listen 0.0.0.0:8888
Listen [::0]:80 changed to Listen [::0]:8888
5. Place vendor and .env into the project (E:bd-shop );
Vendor is a dependency package of the project. Because it is relatively large, it is slow to download using commands, so it can be packaged and used directly. It can be handled according to the actual situation.
六、安装node-v0.12.7-x64.msi(要装grunt-cli先安装node.js)
七、将node_modules放入bd-shop/resource/assets里面;在E:\bd-shop\resources\assets中启用git bash并写入:
npm <span>install</span> -g grunt-cli
安装好grunt-cli后运行grunt命令,即进行构建(注意grunt和-cli之间没有空格)。
八、安装SQLSRV32.EXE,安装时选择php安装目录中:C:\wamp\bin\php\php5.5.12\ext;然后在C:\wamp\bin\php\php5.5.12\php.ini文件里面,添加下面两行代码:
extension=<span>php_sqlsrv_55_ts.dll extension</span>=php_pdo_sqlsrv_55_ts.dll
九、安装sqlncli.msi;安装msodbcsql.msi(是OBDC驱动)
十、安装Laravel
首先安装composer(Composer-Setup.exe),然后按照官网http://laravel-china.org/docs/5.0/installation 里面步骤进行。
注意:以上的path是指计算机属性/高级系统设置/环境变量/系统变量/PATH