codecamp
1.1 apache 服务器配置

PHP 开发环境配置

  1. Windows wamp=windows+apache+mysql+php
  2. Linux lamp=linux+apache+mysql+php
  3. Mac

虚拟目录配置

步骤1: 配置虚拟目录在 apache 的 conf 目录下 httpd.conf 的 <IfModule dir_module>节点后添加如下代码

<IfModule dir_module>
    #相当于欢迎页面
    DirectoryIndex index.html index.htm index.php
    #你站点的别名
    Alias /myblog “D:/myblog”
    <Directory d:/myblog>
    #这是访问权限设置
    Order allow,deny
    Allow from all
    <Directory>
</IfModule>

步骤2: 注销 DocumentRoot 根目录

步骤3: 重启apache

虚拟主机配置

步骤1: 启用 httpd-vhosts.conf 虚拟主机 在 httpd.conf 文件中搜索 vhost

步骤2: 在 httpd-vhosts.conf 做配置

<VirtualHost 127.0.0.1:80>
    DocumentRoot “d:/myblog”
    #这里配置欢迎页面
    DirectoryIndex index.html index.htm index.php
    <Directory />
    Options FollowSymLinks
    #不允许别人修改我们的页面
    AllowOverride None
    #设置访问权限
    Order allow,deny
    Allow from all
    </Directory>
</VirtualHost>

步骤3: 修改 hosts 文件 重启 apache

1.2 基本语法介绍
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }