Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Problems with installing smarty on NT, HELP PLEASE

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Installation and Setup
View previous topic :: View next topic  
Author Message
cowok
Smarty n00b


Joined: 23 May 2003
Posts: 2

PostPosted: Fri May 23, 2003 12:34 am    Post subject: Problems with installing smarty on NT, HELP PLEASE Reply with quote

Hi all,

I am getting this error while I tried to run my test index.php with smarty installed on D:/smarty directory

[code]
Fatal error: Smarty error: [in index.tpl line 9]: [plugin] modifier 'capitalize' is not implemented (Smarty.class.php, line 2543) in D:\InetPub\smarty\libs\Smarty.class.php on line 2652
[/code]

Funny thing is If you look at the error message it still says the the smarty is running on the Inetpub directory...


Thanks for your help in advance...
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Fri May 23, 2003 12:38 am    Post subject: Reply with quote

In your php.ini, did you replace the old inet path with your new smarty path in your PHP includes? I personally don't put smarty in the include path but instead set SMARTY_DIR.

A few more details about your installation would help.
Back to top
View user's profile Send private message
cowok
Smarty n00b


Joined: 23 May 2003
Posts: 2

PostPosted: Fri May 23, 2003 12:51 am    Post subject: Reply with quote

I did not put the smarty under wwwroot directory because I only want to access the smarty directory from my index.php file which reside under wwwroot directory.

I would appreciate if you could give me a sample code on how to get your code working on windows environment...

I did tried to put the smarty in the wwwroot directory I am getting this error message:

[code]
Warning: Smarty error: unable to read template resource: "index.tpl" in D:\InetPub\wwwroot\CPMSalary_Dev\smarty\libs\Smarty.class.php on line 1042
[/code]

thanks
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Fri May 23, 2003 4:19 am    Post subject: Reply with quote

Quote:
I would appreciate if you could give me a sample code on how to get your code working on windows environment...

cowok, you aren't the first to have this problem. I put the following together as a sample starting point for a relatively flexible installation. It is certainly not the only way to do this. I assume Apache, but only because that is what I use.

Lets assume you want a single version of Smarty to support many different sites. Modify the directory paths to suit your purposes, but all mentioned paths must exist.

c:\usr\local\Smarty\ This should not be in your your WWW path!

Unpack the Smarty distribution files here. You must keep the libs directory, but you may remove everything else if you wish.

c:\var\mysite\ This should not be in your your WWW path!

This is the main site directory including everything including templates, etc. Like I said, this is a very simple organization that you can start with.

c:\var\mysite\templates
c:\var\mysite\templates_c
c:\var\mysite\cache
c:\var\mysite\configs

c:\var\mysite\www
This is the root directory for your site.

One way of rooting an url to this directory is by putting the following code in your Apache httpd.conf:

* note slashes -- they are there (or not there) for a reason!
* to hinder cut-and-pasters, this is configured for localhost only
Code:

Alias /mysite/ "C:/var/mysite/www/"
<Directory "C:/var/mysite/www">
  AllowOverride FileInfo AuthConfig Limit
  Order Allow,Deny
  Allow from 127.0.0.1
  DefaultType application/x-httpd-php
</Directory>


Restart Apache and your site located at http://localhost/mysite/ is rooted in your filesystem at c:\var\mysite\www\.

We will use a small boot-strap include file. There are other ways to get the environment set as discussed in the manual and these forums.

c:\var\mysite\www\_autostart.inc
Code:

<?php
// first setup your environment
// the double backslashes are there for your own good
// yes, non-portable windows only paths :(
define ( 'MY_ROOT_DIR', 'c:\\var\\mysite\\' );
define ( 'SMARTY_DIR', 'c:\\usr\\local\\Smarty\\libs\\' );

include_once SMARTY_DIR . 'Smarty.class.php';

class MySmarty extends Smarty
{
    function MySmarty()
    {
        $this->config_dir = MY_ROOT_DIR . 'configs';
        $this->template_dir = MY_ROOT_DIR . 'templates';
        $this->compile_dir = MY_ROOT_DIR . 'templates_c';
        $this->cache_dir = MY_ROOT_DIR . 'cache';
        $this->Smarty();
    }
}
?>


Finally, an example page. This assumes that you have a template called mypage.tpl in the templates directory.

c:\var\mysite\www\index.php
Code:

<?php
include_once '_autostart.inc';
$smarty = new MySmarty;
$smarty->assign('myvar', 'I am assigned');
$smarty->display('mypage.tpl');
?>


HTH
Back to top
View user's profile Send private message
Dirtbox
Smarty Rookie


Joined: 07 Nov 2003
Posts: 11
Location: Belfast

PostPosted: Tue Feb 17, 2004 2:25 pm    Post subject: Reply with quote

Yea im getn the same problem as the guy in the first post i get the error

Fatal error: Smarty error: [in view_application_manage.tpl line 6]: [plugin] modifier 'capitalize' is not implemented (Smarty.class.php, line 2543) in /usr/local/lib/php/smarty/Smarty.class.php on line 2652

my include path in the php.ini has been set to include this directory. Just cant work it out at all.

cheers any help would be great.

[/code]
Back to top
View user's profile Send private message
Dirtbox
Smarty Rookie


Joined: 07 Nov 2003
Posts: 11
Location: Belfast

PostPosted: Tue Feb 17, 2004 2:29 pm    Post subject: Reply with quote

duuhh sorry lads just realised that im missing my plugin directory


sorry for the hassle Embarassed
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Installation and Setup All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP