php开发环境搭建laravel框架,apache服务器,git版本控制,laravelgit
php开发环境搭建——laravel框架,apache服务器,git版本控制,laravelgit
本文主要阐述做项目前的开发环境安装——后端为php,前端采用grunt进行自动化构建。具体介绍了windows平台下采用apache运行php的环境搭建,以及git工具安装。写得有点粗糙,但过程完整,有不足之处还请见谅。
一、Git工具安装
1)https://github.com 注册github账户
2)安装PHPGit-1.9.5-preview20150319.exe
3)设置Git的user name和email:
$ git config --global user.name "xuhaiyan" $ git config --global user.email "haiyan.xu.vip@gmail.com"
4)生成SSH密钥过程:
1. 查看是否已经有了ssh密钥(用Git Bash,不要用cmd):cd ~/.ssh
如果没有密钥则不会有此文件夹,有则备份删除
2. 生成密钥:
$ <span>ssh-keygen</span> -t rsa -C “haiyan.xu.vip@gmail.com”
按3个回车,密码为空。
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:
………………
最后得到了两个文件:id_rsa(私钥)和id_rsa.pub(公钥)
3. 添加密钥(公钥)到ssh:ssh-add 文件名
登陆github账号,进入公司项目,点击Settings/SSH Keys/Add SSH Key
5)克隆项目代码到本地(假设克隆代码到E:\bd-shop),请填写相应项目代码地址
git clone git@github.com:xxx.git
二、php工具安装
1) 安装php编辑器:Sublime Text Build 3083 x64 Setup.exe
或者安装phpstorm,功能更加强大
三、安装WampServer整合软件包:wampserver2.5-Apache-2.4.9-Mysql-5.6.17-php5.5.12-32b.exe(32位)
(W: windows系统 ; a:Apache服务器; m:mysql数据库; p:php语言)
可能出现的错误:弹出如下对话框:
解决方法:http://www.microsoft.com/zh-CN/download/details.aspx?id=30679 处下载VSU4\vcredist_x86.exe并进行安装(注意wamp server 是32位的,故装x84,而不是x64)
若出现vcredist_x86.exe安装不了的情况,可以采用nginx启动php,在以后的文章中再讲解。
四、更改apache配置,将Apache服务器主页设置为公司项目:
1)C:\wamp\bin\apache\apache2.4.9\conf\httpd.conf,去掉LoadModule rewrite_module modules/mod_rewrite.so前面的注释符’#’
2)将DocumentRoot 路径设置为E:\bd-shop\public(基于上面第一节中第5点)
3)将
注意:安装无误,但apache启动不了(显示为橙色),则默认80端口已被占用,需要另改端口,端口号设置为1024之后的端口,如8888,8080等,方法如下:
C:\wamp\bin\apache\apache2.4.9\conf\httpd.conf里,
将Listen 0.0.0.0:80 改为Listen 0.0.0.0:8888
Listen [::0]:80 改为Listen [::0]:8888
五、将vendor和.env放到项目中(E:\bd-shop);
vendor为项目的依赖包,因为比较大,用命令下载慢,因此打包好直接用。可根据实际情况处理。
六、安装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

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

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











IIS and PHP are compatible and are implemented through FastCGI. 1.IIS forwards the .php file request to the FastCGI module through the configuration file. 2. The FastCGI module starts the PHP process to process requests to improve performance and stability. 3. In actual applications, you need to pay attention to configuration details, error debugging and performance optimization.

Cryptocurrency data platforms suitable for beginners include CoinMarketCap and non-small trumpet. 1. CoinMarketCap provides global real-time price, market value, and trading volume rankings for novice and basic analysis needs. 2. The non-small quotation provides a Chinese-friendly interface, suitable for Chinese users to quickly screen low-risk potential projects.

The steps to draw a Bitcoin structure analysis chart include: 1. Determine the purpose and audience of the drawing, 2. Select the right tool, 3. Design the framework and fill in the core components, 4. Refer to the existing template. Complete steps ensure that the chart is accurate and easy to understand.

The forecasts for the top 10 formal cryptocurrency trading platforms in the 2025 cryptocurrency trading platforms are: 1. Coinbase, 2. Kraken, 3. Gemini, 4. Binance, 5. Ouyi, 6. Bitstamp, 7. LMAX Digital, 8. Itbit, 9. Coincheck, 10. Sesame Open Door, these platforms perform excellently in compliance, security, user experience, etc.

Git and GitHub are key tools for modern software development. Git provides version control capabilities to manage code through repositories, branches, commits and merges. GitHub provides code hosting and collaboration features such as Issues and PullRequests. Using Git and GitHub can significantly improve development efficiency and team collaboration capabilities.

Galaxy Digital Holdings has been approved by the U.S. Securities and Exchange Commission (SEC) to officially launch the restructuring plan! Galaxy Digital has been approved by the SEC, and its Nasdaq listing and corporate structure restructuring plan has officially entered the next stage. The news was announced on Monday. The SEC has approved the registration statement for Galaxy Digital. The move is a key step in the company's plan to move its corporate structure from the Cayman Islands to Delaware, and at the same time, it will set up a new parent company, NewPubCo. "We are excited that the registration statement will take effect, which marks an important milestone in the development of Galaxy Digital and will continue to follow," said the CEO of Galaxy Digital.

Laravel is suitable for projects that teams are familiar with PHP and require rich features, while Python frameworks depend on project requirements. 1.Laravel provides elegant syntax and rich features, suitable for projects that require rapid development and flexibility. 2. Django is suitable for complex applications because of its "battery inclusion" concept. 3.Flask is suitable for fast prototypes and small projects, providing great flexibility.

The latest version of Laravel10 is compatible with MySQL 5.7 and above, PostgreSQL 9.6 and above, SQLite 3.8.8 and above, SQLServer 2017 and above. These versions are chosen because they support Laravel's ORM features, such as the JSON data type of MySQL5.7, which improves query and storage efficiency.
