Welcome 微信登录

首页 / 操作系统 / Linux / 在Fedora 10上安装Smarty

1. 在Fedora 10上安装Smarty前准备,从官方网站上, 下载Smarty主程式,,
请注意需要PHP Version 4.0.6以上的版本才支持, 
http://www.smarty.net/download.php http://www.smarty.net/download.php 2. 将Smarty下载下来, 先放到/tmp目录下
# cd /tmp
# tar zxvf Smarty-2.6.25.tar.gz
# mkdir /var/www/smarty
# cp -R Smarty-2.6.25/libs/* /var/www/smarty/3. 建立Smarty 所需的目录
# mkdir /var/www/smarty/templates
# mkdir /var/www/smarty/templates_c
# mkdir /var/www/smarty/cache
# mkdir /var/www/smarty/configs
# chmod 775 /var/www/smarty/templates_c
# chmod 775 /var/www/smarty/cache4. 编辑test.php, 然后把下面程式存档
# cd /var/www/html
# vi test.php<?php
require("/var/www/smarty/Smarty.class.php");
$tpl = new Smarty();
$tpl->template_dir = "/var/smarty/templates";
$tpl->compile_dir = "/var/smarty/templates_c";
$tpl->cache_dir = "/var/smarty/cache"; 
$tpl->config_dir = "/var/smarty/configs";
$tpl->left_delimiter = "<{";
$tpl->right_delimiter = "}>";
$tpl->assign("hello", "Hello World");
$tpl->display("test.tpl");
?> 5. 编辑Smarty 的test.tpl, 然后把下面程式存档$> vi /var/www/smarty/templates/test.tpl<html>
<head>
<title>My First Smarty</title>
</head>
<body>
<{$hello}>
</body>
</html>6. 打开Browser, 输入http://localhost/test.php , 就可以看到 Hello WorldFedora 10搭配VMware Workstation 6.5的问题嵌入式Linux让网卡IP地址由DHCP获得相关资讯      Fedora 10  Smarty 
  • Smarty远程任意代码执行漏洞(CVE-  (10/29/2014 18:06:24)
  • PHP模板引擎 Smarty 3.1.1 发布  (09/26/2011 16:04:25)
  • 在Fedora 10中安装IRAF  (07/22/2009 09:21:28)
  • Smarty 3.1.7 发布  (12/23/2011 06:51:34)
  • Fedora 10 安装最新Oracle   (09/18/2009 15:18:56)
  • Fedora 10 下rsync的配置和使用  (07/22/2009 05:13:15)
本文评论 查看全部评论 (0)
表情: 姓名: 字数