Use the smarty template on Windows

Source: Internet
Author: User
OK I worked out the bugs. hopefully this information will help other folks that want to install smarty on Windows. I wish I had this info when I started, the documentation is geared towards * nix and is confusing but it was a good learning experience. (thanks to boots for making the whole 'templates' folder click in my head) Hopefully, Monte or the smarty folks will include this info on their web or More importantly in the installation documentation in the smarty download. john --------------------------------------------- installing smarty in windowsthis document assumes that your webserver and PhP5 is running. download smarty-http://smarty.php.netInstallation-Windows, IIS/Apache, php5extract files, rename smarty. x. x. X to smarty (suggest outside of your www root !) Example: D: \ smartyrun phpinfo. PHP to find out your php. INI locationedit PHP. INI's desired de_path and add the location of the libs folder. example: Export de_path = ".; d: \ smarty \ Libs "restart IIS/apachesetup these two folders inside your www root :( wwwroot)/smarty/templates (this is where your templates will go) (wwwroot) /smarty/configssetup these two folders outside of your www root: D:/smarty/templates_c D:/smarty/cachesetup security settings for the webserver to write to these four foldersin (wwwroot) Create index. PHP and in (wwwroot)/smarty/templates/index. TPL with the following code: Index. PHP: <? PHP // load smarty libraryrequire ('smarty. class. PHP '); $ smarty = new smarty; $ smarty-> template_dir = 'd:/inetpub/wwwroot/smarty/templates'; $ smarty-> config_dir = 'd: /inetpub/wwwroot/smarty/config '; $ smarty-> cache_dir = 'd:/smarty/smarty_cache'; $ smarty-> compile_dir = 'd:/smarty/smarty_templates_c '; $ smarty-> assign ('name', 'fish boy! '); $ Smarty-> display ('index. TPL');?> Index. TPL <HTML> <body> hello, {$ name }! </Body> 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.