


PHP development environment construction - laravel framework, apache server, git version control, laravelgit_PHP tutorial
Jul 12, 2016 am 08:55 AMphp development environment setup - laravel framework, apache server, git version control, laravelgit
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
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命令,即進行構(gòu)建(注意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驅(qū)動)?
十、安裝Laravel
? ? ?首先安裝composer(Composer-Setup.exe),然后按照官網(wǎng)http://laravel-china.org/docs/5.0/installation?里面步驟進行。
? ? ?注意:以上的path是指計算機屬性/高級系統(tǒng)設(shè)置/環(huán)境變量/系統(tǒng)變量/PATH

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

TopreventCSRFattacksinPHP,implementanti-CSRFtokens.1)Generateandstoresecuretokensusingrandom_bytes()orbin2hex(random_bytes(32)),savethemin$_SESSION,andincludetheminformsashiddeninputs.2)ValidatetokensonsubmissionbystrictlycomparingthePOSTtokenwiththe

Grayscale Digital Market refers to the overall performance of Grayscale Investment’s digital asset trust funds, and its core includes single asset trusts and compound funds. 1. "Grayscale" refers to Grayscale Investments, which has trust products such as GBTC and ETHE; 2. "Digital Market" refers to GDLC funds that track mainstream crypto assets in a narrow sense, and covers the overall performance of all trust products in Grayscale. Reasons to pay attention to the Grayscale Digital Market include: 1. Changes in its holdings reflect institutional investors' tendency to allocate cryptocurrencies; 2. Premium or discount fluctuations in trust products affect market sentiment; 3. As a compliance channel regulated by SEC, its trends have policy reference value.

exit() is a function in PHP that is used to terminate script execution immediately. Common uses include: 1. Terminate the script in advance when an exception is detected, such as the file does not exist or verification fails; 2. Output intermediate results during debugging and stop execution; 3. Call exit() after redirecting in conjunction with header() to prevent subsequent code execution; In addition, exit() can accept string parameters as output content or integers as status code, and its alias is die().

To merge two PHP arrays and keep unique values, there are two main methods. 1. For index arrays or only deduplication, use array_merge and array_unique combinations: first merge array_merge($array1,$array2) and then use array_unique() to deduplicate them to finally get a new array containing all unique values; 2. For associative arrays and want to retain key-value pairs in the first array, use the operator: $result=$array1 $array2, which will ensure that the keys in the first array will not be overwritten by the second array. These two methods are applicable to different scenarios, depending on whether the key name is retained or only the focus is on

The rational use of semantic tags in HTML can improve page structure clarity, accessibility and SEO effects. 1. Used for independent content blocks, such as blog posts or comments, it must be self-contained; 2. Used for classification related content, usually including titles, and is suitable for different modules of the page; 3. Used for auxiliary information related to the main content but not core, such as sidebar recommendations or author profiles. In actual development, labels should be combined and other, avoid excessive nesting, keep the structure simple, and verify the rationality of the structure through developer tools.

The steps for Apache to modify the default port to 8080 are as follows: 1. Edit the Apache configuration file (such as /etc/apache2/ports.conf or /etc/httpd/conf/httpd.conf), and change Listen80 to Listen8080; 2. Modify the tag port in all virtual host configurations to 8080 to ensure that it is consistent with the listening port; 3. Check and open the support of the 8080 port by firewall (such as ufw and firewalld); 4. If SELinux or AppArmor is enabled, you need to set to allow Apache to use non-standard ports; 5. Restart the Apache service to make the configuration take effect; 6. Browser access

LightchainAI is currently in the reward round stage, providing investors with the opportunity to finally obtain LCAI tokens before the main network is launched in July 2025. The platform has raised US$21.1 million so far, and its independently developed AI virtual machines are attracting great attention in the industry. The development momentum of decentralized artificial intelligence is becoming increasingly strong, and LightchainAI is becoming the focus with its unique innovation model. With the launch date of the main network locked in July 2025, the reward rounds currently open to the platform have become an important window for investors to enter the market. Let's take a look at the core highlights of LightchainAI and why it is attracting much attention. LightchainAI: Promoting the Development of Decentralized AI Lightc

Recursive functions refer to self-call functions in PHP. The core elements are 1. Defining the termination conditions (base examples), 2. Decomposing the problem and calling itself recursively (recursive examples). It is suitable for dealing with hierarchical structures, disassembling duplicate subproblems, or improving code readability, such as calculating factorials, traversing directories, etc. However, it is necessary to pay attention to the risks of memory consumption and stack overflow. When writing, the exit conditions should be clarified, the basic examples should be gradually approached, the redundant parameters should be avoided, and small inputs should be tested. For example, when scanning a directory, the function encounters a subdirectory and calls itself recursively until all levels are traversed.
