


PHP development environment construction - laravel framework, apache server, git version control, laravelgit_PHP tutorial
php 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命令,即进行构建(注意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

TomodifydatainaPHPsession,startthesessionwithsession_start(),thenuse$_SESSIONtoset,modify,orremovevariables.1)Startthesession.2)Setormodifysessionvariablesusing$_SESSION.3)Removevariableswithunset().4)Clearallvariableswithsession_unset().5)Destroythe

Arrays can be stored in PHP sessions. 1. Start the session and use session_start(). 2. Create an array and store it in $_SESSION. 3. Retrieve the array through $_SESSION. 4. Optimize session data to improve performance.

PHP session garbage collection is triggered through a probability mechanism to clean up expired session data. 1) Set the trigger probability and session life cycle in the configuration file; 2) You can use cron tasks to optimize high-load applications; 3) You need to balance the garbage collection frequency and performance to avoid data loss.

Tracking user session activities in PHP is implemented through session management. 1) Use session_start() to start the session. 2) Store and access data through the $_SESSION array. 3) Call session_destroy() to end the session. Session tracking is used for user behavior analysis, security monitoring, and performance optimization.

Using databases to store PHP session data can improve performance and scalability. 1) Configure MySQL to store session data: Set up the session processor in php.ini or PHP code. 2) Implement custom session processor: define open, close, read, write and other functions to interact with the database. 3) Optimization and best practices: Use indexing, caching, data compression and distributed storage to improve performance.

PHPsessionstrackuserdataacrossmultiplepagerequestsusingauniqueIDstoredinacookie.Here'showtomanagethemeffectively:1)Startasessionwithsession_start()andstoredatain$_SESSION.2)RegeneratethesessionIDafterloginwithsession_regenerate_id(true)topreventsessi

In PHP, iterating through session data can be achieved through the following steps: 1. Start the session using session_start(). 2. Iterate through foreach loop through all key-value pairs in the $_SESSION array. 3. When processing complex data structures, use is_array() or is_object() functions and use print_r() to output detailed information. 4. When optimizing traversal, paging can be used to avoid processing large amounts of data at one time. This will help you manage and use PHP session data more efficiently in your actual project.

The session realizes user authentication through the server-side state management mechanism. 1) Session creation and generation of unique IDs, 2) IDs are passed through cookies, 3) Server stores and accesses session data through IDs, 4) User authentication and status management are realized, improving application security and user experience.


Hot AI Tools

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

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

Undress AI Tool
Undress images for free

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

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Dreamweaver Mac version
Visual web development tools

WebStorm Mac version
Useful JavaScript development tools

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),
