亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
樓主: wenhuaixiang
打印 上一主題 下一主題

PHP5用smarttemplate的時候總是報錯誤啊~ [復(fù)制鏈接]

論壇徽章:
1
技術(shù)圖書徽章
日期:2013-12-05 23:25:45
21 [報告]
發(fā)表于 2006-08-01 09:04 |只看該作者
原帖由 wenhuaixiang 于 2006-8-1 08:49 發(fā)表
我的環(huán)境是RH AS 4+PHP5+smarttemplate-1.2.1+APache2
代碼如下:
<HTML>;
<H3>;{TITLE}</H3>;
</HTML>;


<?php

    require_once "/var/smartte ...


Debug Strict (PHP 5): /SmartTemplate/smarttemplate-1.2.1/class.smarttemplateparser.php line 20 - var: Deprecated. Please use the public/private/protected modifiers

Zend建議采用PHP5的標準格式,但是我們的代碼在PHP4和PHP5都通用,所以這里使用的var。
你可以這么做:
打開這個文件,最前面的變量定義部分,依據(jù):
@access
修改為private或者public

論壇徽章:
1
技術(shù)圖書徽章
日期:2013-12-05 23:25:45
22 [報告]
發(fā)表于 2006-08-01 09:07 |只看該作者
另外:
在第12樓,我們才知道你的錯誤提示到底是什么!

在第19樓,我們才知道,你使用的Zend調(diào)試器的時候的提示!

你為什么不在第1樓就告訴我們呢?

Zend調(diào)試器的檢查可能較為嚴格。

我不用,所以你自己可以看Zend調(diào)試器的手冊和說明,把這樣子的檢查的級別調(diào)低。

或者干脆久不用Zend調(diào)試器。

論壇徽章:
0
23 [報告]
發(fā)表于 2006-08-01 09:15 |只看該作者
什么意思?我的代碼寫錯了?還有就是我的php是5.1.4
就是你提供下載的官方網(wǎng)站下下來的就三個.php的文件下面是其中之一。我的另外兩個文件還用改什么嗎?
<?php
        /**
        * SmartTemplate Class
        *
        * 'Compiles' HTML-Templates to PHP Code
        *
        *
        * Usage Example I:
        *
        * $page = new SmartTemplate( "template.html" );
        * $page->assign( 'TITLE',  'TemplateDemo - Userlist' );
        * $page->assign( 'user',   DB_read_all( 'select * from ris_user' ) );
        * $page->output();
        *
        * Usage Example II:
        *
        * $data = array(
        *             'TITLE' => 'TemplateDemo - Userlist',
        *             'user'  => DB_read_all( 'select * from ris_user' )
        *         );
        * $page = new SmartTemplate( "template.html" );
        * $page->output( $data );
        *
        *
        * @author Philipp v. Criegern philipp@criegern.com
        * @author Manuel 'EndelWar' Dalla Lana endelwar@aregar.it
        * @version 1.2.1 03.07.2006
        *
        * CVS ID: $Id: class.smarttemplate.php,v 1.7 2006/07/02 22:17:15 endelwar Exp $
        */
        class SmartTemplate
        {
                /**
                * Whether to store compiled php code or not (for debug purpose)
                *
                * @access public
                */
                var $reuse_code                = true;

                /**
                * Directory where all templates are stored
                * Can be overwritten by global configuration array $_CONFIG['template_dir']
                *
                * @access public
                */
                var $template_dir        = 'templates/';

                /**
                * Where to store compiled templates
                * Can be overwritten by global configuration array $_CONFIG['smarttemplate_compiled']
                *
                * @access public
                */
                var $temp_dir                = 'templates_c/';

                /**
                * Temporary folder for output cache storage
                * Can be overwritten by global configuration array $_CONFIG['smarttemplate_cache']
                *
                * @access public
                */
                var $cache_dir      =  'templates_c/';

                /**
                * Default Output Cache Lifetime in Seconds
                * Can be overwritten by global configuration array $_CONFIG['cache_lifetime']
                *
                * @access public
                */
                var $cache_lifetime =  600;

                /**
                * Temporary file for output cache storage
                *
                * @access private
                */
                var $cache_filename;

論壇徽章:
0
24 [報告]
發(fā)表于 2006-08-01 09:23 |只看該作者
x



Warning: fopen(templates_c/hello_world_tpl_html.php) [function.fopen]: failed to open stream: No such file or directory in /var/www/temp/class.smarttemplateparser.php on line 255
SmartTemplate Parser Error: Could not write compiled file.

論壇徽章:
0
25 [報告]
發(fā)表于 2006-08-01 09:26 |只看該作者
現(xiàn)在的錯誤提示變成 :
  Warning: fopen(templates_c/hello_world_tpl_html.php) [function.fopen]: failed to open stream: No such file or directory in /var/www/temp/class.smarttemplateparser.php on line 255
SmartTemplate Parser Error: Could not write compiled file.

類源代碼如下:
if ($hd = @fopen($template_filename, "r"))  //錯誤行
                        {
                                if (filesize($template_filename))
                                {
                                        $this->template = fread($hd, filesize($template_filename));
                                }
                                else
                                {
                                        $this->template = "SmartTemplate Parser Error: File size is zero byte: '$template_filename'";
                                }

論壇徽章:
0
26 [報告]
發(fā)表于 2006-08-01 09:40 |只看該作者
斑竹,還是不行,我的就報上面的錯誤啊~趕緊幫個忙啊

論壇徽章:
0
27 [報告]
發(fā)表于 2006-08-01 10:12 |只看該作者
原帖由 fendou_2005 于 2006-8-1 09:23 發(fā)表
x



Warning: fopen(templates_c/hello_world_tpl_html.php) [function.fopen]: failed to open stream: No such file or directory in /var/www/temp/class.smarttemplateparser.php on line 255
SmartTe ...


按你的路徑配置一下
include "smarttemplate/class.smarttemplate.php";
//SmartTemplate配置
$_CONFIG = array(
        'smarttemplate_compiled'        =>        dirname(__FILE__) . '/cache/',
        'smarttemplate_cache'                =>        dirname(__FILE__) . '/cache/',
        'cache_lifetime'                        =>        3600,
        'template_dir'                                =>        dirname(__FILE__) . 'templates/',
        );

論壇徽章:
0
28 [報告]
發(fā)表于 2006-08-01 10:13 |只看該作者
原帖由 fendou_2005 于 2006-8-1 09:26 發(fā)表
現(xiàn)在的錯誤提示變成 :
  Warning: fopen(templates_c/hello_world_tpl_html.php) [function.fopen]: failed to open stream: No such file or directory in /var/www/temp/class.smarttemplateparser.php on lin ...


提示的很詳細,在模版文件目錄中找不到hello_world_tpl_html.php模版文件
templates_c/hello_world_tpl_html.php

你的模版文件放在什么地方

論壇徽章:
0
29 [報告]
發(fā)表于 2006-08-01 10:16 |只看該作者
bool $reuse_code

設(shè)置是否使用模板最后編譯所產(chǎn)生的文件. 如果設(shè)置為 false, SmartTemplate 在每次使用到該模板時都會重新編譯一次.

string $template_dir

設(shè)置模板文件的目錄. 全局配置數(shù)組 $_CONFIG[’template_dir’] 也可以設(shè)置,并且覆蓋此處的設(shè)置.

string $temp_dir

設(shè)置編譯文件的目錄. 全局配置數(shù)組 $_CONFIG[’smarttemplate_compiled’] 也可以設(shè)置,并且覆蓋此處的設(shè)置. 當心: 請確認PHP有權(quán)限讀寫該目錄,否則無法正常工作!

string $cache_dir

設(shè)置輸出緩存的目錄. 全局配置數(shù)組 $_CONFIG[’smarttemplate_cache’] 也可以設(shè)置,并且覆蓋此處的設(shè)置. 當心: 請確認PHP有權(quán)限讀寫該目錄,否則無法正常工作!

int $cache_lifetime

設(shè)置默認的輸出緩存更新時間. 全局配置數(shù)組 $_CONFIG[’cache_lifetime’] 也可以設(shè)置,并且覆蓋此處的設(shè)置.

論壇徽章:
0
30 [報告]
發(fā)表于 2006-08-01 10:19 |只看該作者
能說得具體點嗎?我還不是很清楚,我的html和.php(代碼)都放到1個文件夾下面了
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP