xampp+yii2环境搭建
来源:互联网 发布:知乎 梵高 被高估 编辑:程序博客网 时间:2024/05/16 11:18
php配置文件说明http://www.cnblogs.com/xiaoshi1991/archive/2012/09/18/2690608.html
php开发流程
1、配置php开发环境,使用xampp
https://www.apachefriends.org/zh_cn/download.html
2、配置apache中的httpd-vhost.conf
该文件中有两个默认的虚拟主机
而实际上,这两个虚拟主机是不存在的,在没有配置任何其他虚拟主机时,可能会导致访问localhost时出现如下提示:
Forbidden
You don't have permission to access /index.php on this server
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "/Applications/XAMPP/xamppfiles/docs/dummy-host.example.com"
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error_log"
CustomLog "logs/dummy-host.example.com-access_log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "/Applications/XAMPP/xamppfiles/docs/dummy-host2.example.com"
ServerName dummy-host2.example.com
ErrorLog "logs/dummy-host2.example.com-error_log"
CustomLog "logs/dummy-host2.example.com-access_log" common
</VirtualHost>
我的配置文件
配置虚拟主机,还需要将httpd.conf中的虚拟主机的注释去掉,相当于启用虚拟主机
# Virtual hosts
Include etc/extra/httpd-vhosts.conf
Include etc/extra/httpd-vhosts.conf
<VirtualHost jiuyuan:80>
#ServerAdmin 737333500@qq.com
DocumentRoot "/myspace/workspace/webdesign/html/jiuyuan"
ServerName jiuyuan
ServerAlias www.jiuyuan.com
DirectoryIndex index.html
<Directory "/myspace/workspace/webdesign/html/jiuyuan">
#Options -Indexes FollowSymLinks
#AllowOverride None
#Order allow,deny
#Allow from all
Require all granted
</Directory>
ErrorLog "logs/error_log"
CustomLog "logs/access_log" common
</VirtualHost>
<VirtualHost phpfirst:80>
#ServerAdmin 737333500@qq.com
DocumentRoot "/myspace/workspace/webroot/phpfirst"
ServerName phpfirst
ServerAlias www.phpfirst.com
DirectoryIndex index.html index.php
<Directory "/myspace/workspace/webroot/phpfirst">
#Options -Indexes FollowSymLinks
#AllowOverride None
#Order allow,deny
#Allow from all
Require all granted
</Directory>
ErrorLog "logs/error_log"
CustomLog "logs/access_log" common
</VirtualHost>
还需要在etc/hosts加上一条127.0.0.1 jiuyuanny
配置后需要终端关闭hosts对应进程sudo killall -HUP mDNSResponder
访问地址如下
http://jiuyuanny/jiuyuan/pages/product.html
3、安装php-eclipse,也可以使用sublime等工具
4、使用框架yii2
你可以通过Composer来安装这个模板。从这里下载Composer:http://getcomposer.org/,或者在Linux/Unix/MacOS平台上运行如下命令:
1
curl -s http:
//getcomposer.org/installer | php
然后你可以使用如下命令创建一个基础应用程序:
1
php composer.phar create-project --prefer-dist --stability=dev yiisoft/yii2-app-basic /path/to/yii-application
在Web服务器配置文件中设置 document root 目录为 /path/to/yii-application/web,你可以使用 URL
http://localhost/
来访问这个应用。也可以在虚拟服务器中配置一个节点,用来访问这个目录的内容
问题
1、下载的过程中可能会遇到下载bootstrap没有权限的问题,需要你输入对应的网址获取token,然后在命令行中粘贴token,注意是不可见的
88785ac9dfda7f2e102ae962c8e6f256e98bdcc4
2、配置hosts和虚拟主机后,重启apache和hosts进程,正常的话就会出现yii界面,是用bootstrap构建的界面,还有可能会缺少jquery或者bootstrap文件,1)可以将bower下面bower-assert的文件移动到bower下面
2)可以在目录下面 /path/to/yii-application/vendor/yiisoft/yii2/base
第456行将目录bower改为bower/bower-assert
这样就可以直接通过配置在hosts中的域名访问虚拟主机,从而访问yii2了
0 0
- xampp+yii2环境搭建
- bugfree+XAMPP环境搭建
- agileone+xampp环境搭建
- yii2.0环境搭建
- yii2 环境搭建
- Yii2开发环境搭建
- 利用XAMPP搭建本地环境
- WIN7+XAMPP搭建PHP环境
- XAMPP搭建JSP+PHP环境
- [XMPP]xampp服务器环境搭建
- xampp php环境搭建注意事项
- Linux环境搭建xampp+禅道
- php开发环境搭建 XAMPP
- PHPStorm+XAMPP开发环境搭建
- 在Mac下配置Yii2----安装服务环境XAMPP
- 快速利用xampp搭建j2ee环境+虚拟主机
- Eclipse+XAMPP组合搭建PHP开发环境
- php eclipse xampp环境的搭建
- MySQL 5.7版本新特性
- 纪念博客开通了!
- unity5之代码创建状态机,玩的666
- 上传控件图片直接在页面显示
- MD5加密之中文
- xampp+yii2环境搭建
- 程序员修炼之路
- 发送POST请求
- 华为机试——判断手机号码合法性
- 【java基础】JSTL标签库的使用
- Parcelable和Serializable
- java中的集合
- Editext 获取焦点事件
- 4245: [ONTAK2015]OR-XOR 贪心+按位处理+前缀异或和