fenl 发表于 2015-11-17 02:56:18

wamp 配置 mysql配置 时间配置 虚拟主机配置 thinkphp配置smarty配置

  
1 phpMyadmin主页
权限->root localhost ->编辑权限->修改密码
修改密码

2
F:\Program Files\wamp\apps\phpmyadmin3.4.10.1


config.inc.php
$cfg['Servers'][$i]['password'] = '';
3
F:\Program Files\wamp\apps\phpmyadmin3.4.10.1\libraries


config.default.php
$cfg['Servers'][$i]['password'] = '';

4.time设置php.ini

; Defines the default timezone used by the date functions
http://php.net/date.timezone
date.timezone = Asia/Shanghai
5.虚拟主机配置


1编辑httpd.conf,查找Include conf/extra/httpd-vhosts.conf,把前面注释符号“#”删掉。
2编辑httpd-vhosts.conf,我把WAMPServer安装在D:/wamp,所以我这里的路径是D:\wamp\Apache2\conf\extra。


把里面的内容清空掉或者注释,换成下面的内容:
NameVirtualHost *:80
#原来默认的目录
<VirtualHost *:80>
    ServerName localhost
    ServerAlias localhost
    DocumentRoot &quot;F:/Program Files/wamp/www&quot;
</VirtualHost>
#这个是新增的努力目录
<VirtualHost *:80>
ServerName www.shop.com
ServerAlias www.shop.com
DocumentRoot &quot;F:/PHPhomework/web/shop&quot;
<Directory &quot;F:/PHPhomework/web/shop&quot;>
    Options Indexes FollowSymLinks
    AllowOverride all
    Order Allow,Deny
    Allow from all
</Directory>
</VirtualHost>


3修改C:/WINDOWS/system32/drivers/etc/host这个文件,用记事本打开,加上如下内容:
   127.0.0.1www.shop.com


好了,然后重启apache,在浏览器里面输入www.cms.com,看看访问到的内容是不是workplace这个目录呢。
--------------------------------------------------------------------------------------------------------------------------
thinkphp示例包 配置
ThinkPHP示例(for ThinkPHP3.1&#43;版本)
[安装须知]
要使用示例,首先需要安装ThinkPHP核心(https://github.com/liu21st/thinkphp)
然后把示例放到Web目录下面,如果根目录下面有SQL文件则首先导入到数据库,然后修改示例下面的 Conf/config.php 文件中的数据库连接信息。
在config.php 里一定注意 以下数值
   'URL_MODEL'=>3, // 如果你的环境不支持PATHINFO 请设置为3
--------------------------------------------------------------------------------------------------------------------------
smarty 配置
<?php
/*定义服务器的绝对路径*/
define(&quot;BASE_PATH&quot;,$_SERVER['DOCUMENT_ROOT']);
echo BASE_PATH;
/*定义Smarty的绝对路径*/
define(&quot;SMARTY_PATH&quot;,'/smarty/');
require BASE_PATH.SMARTY_PATH.&quot;Smarty.class.php&quot;;
$smarty=new Smarty;
//下面的(你的网站目录)用绝对路径,可以用相对路径(./templates)
$smarty->template_dir=BASE_PATH.SMARTY_PATH.'templates/';
$smarty->config_dir=BASE_PATH.SMARTY_PATH.'configs/';
$smarty->cache_dir=BASE_PATH.SMARTY_PATH.'cache/';
$smarty->compile_dir=BASE_PATH.SMARTY_PATH.'templates_c/';




/*修改定界符*/
$smarty->left_delimiter='<{';
$smarty->right_delimiter='}>';
?>



<?php
/*定义服务器的绝对路径*/
define('BASE_PATH',$_SERVER['DOCUMENT_ROOT']);
/*定义Smarty目录的绝对路径*/
define('SMARTY_PATH','\Smarty\\');
/*加载Smarty类库文件    */
require BASE_PATH.SMARTY_PATH.'Smarty.class.php';
/*实例化一个Smarty对象*/
$smarty = new Smarty;
/*定义各个目录的路径    */
$smarty->template_dir = BASE_PATH.SMARTY_PATH.'templates/';
$smarty->compile_dir = BASE_PATH.SMARTY_PATH.'templates_c/';
$smarty->config_dir = BASE_PATH.SMARTY_PATH.'configs/';
$smarty->cache_dir = BASE_PATH.SMARTY_PATH.'cache/';
/*调试控制台*/
//$smarty->debugging = true;
/*定义定界符*/
$smarty->left_delimiter = '<{';
$smarty->right_delimiter = '}>';
?>



<?php
   //当前目录
define(&quot;ROOT&quot;, str_replace(&quot;\\&quot;, &quot;/&quot;, dirname(__FILE__)).&quot;/&quot;);
   //define(&quot;ROOT&quot;,dirname(__FILE__));
   // echo ROOT.&quot;/libs/Smarty.class.php&quot;;
include ROOT.&quot;/libs/Smarty.class.php&quot;;




$smarty = new Smarty;
//      这是smarty2时期的用法
// $smarty -> template_dir = &quot;./views/&quot;;
// $smarty -> compile_dir = &quot;./comps/&quot;;




// 以下是smarty3时期用法
$smarty -> setTemplateDir(ROOT.&quot;/views/&quot;);
$smarty -> setCompileDir(ROOT.&quot;/comps/&quot;);
$smarty -> setConfigDir(ROOT.&quot;/configs/&quot;);
$smarty -> setCacheDir(ROOT.&quot;/cache/&quot;);
// $smarty -> addTemplateDir(&quot;./home/&quot;);


//就可以让定界符号使用空格
$smarty -> auto_literal = false;
//设置定界符号
$smarty -> left_delimiter = &quot;<{&quot;;
$smarty -> right_delimiter = &quot;}>&quot;;









  

         版权声明:本文为博主原创文章,未经博主允许不得转载。
页: [1]
查看完整版本: wamp 配置 mysql配置 时间配置 虚拟主机配置 thinkphp配置smarty配置