kev Posted January 14, 2012 Share Posted January 14, 2012 I'm very bad at R.T.F.M. so I would be grateful if there's someone who could assist and help me to get Smarty installed on Wamp. Quote Link to comment https://forums.phpfreaks.com/topic/255027-installing-smarty-on-wamp-help-wanted/ Share on other sites More sharing options...
solanki_mahendra131 Posted January 30, 2012 Share Posted January 30, 2012 - Download and extract Smarty Folder to your project folder - Create templates, templates_c folder - So you have directories as follows project Folder - Smarty - templates - index.tpl [Create this file and write something in it for testing] - templates_c <?php // put full path to Smarty.class.php require('Smarty/Smarty.class.php'); // Create Object $smarty = new Smarty(); $smarty->setTemplateDir('templates'); $smarty->setCompileDir('templates_c'); $smarty->display('index.tpl'); ?> Quote Link to comment https://forums.phpfreaks.com/topic/255027-installing-smarty-on-wamp-help-wanted/#findComment-1312519 Share on other sites More sharing options...
kev Posted January 30, 2012 Author Share Posted January 30, 2012 Hello Mahendra. Thanks for replying. I have actually managed to get that far with the 'basic setup' from... http://ubuntu-linux-apache-mysql-php.blogspot.com/2009/10/how-to-install-smarty-with-wampserver.html What I'm now in conflict with is the 'extended setup' described on the same webpage, at the first try it's throwing out an error, but this might be due to using a slightly later version of Smarty than from the webpage, at the moment my version is 3.1.0. My problem is trying to get the concept and path into my head. Have a look at the page and tell me what you think and also how would it be modified for the latest stable Smarty 3.1.7. Kev Quote Link to comment https://forums.phpfreaks.com/topic/255027-installing-smarty-on-wamp-help-wanted/#findComment-1312650 Share on other sites More sharing options...
solanki_mahendra131 Posted January 31, 2012 Share Posted January 31, 2012 Hello Kev, can give me description or screenshot of the error you get. so i can better understand. And one more thing, about path, you can do this in two way. 1.. You can set Smarty class path by modifying php.ini file as done on webpage you have given. include_path = ".;c:\wamp\bin\php\php5.3.0\pear;c:\wamp\bin\php\php5.3.0\Smarty\libs" by doing this you just need to insert line of code like "require_once(SMARTY_DIR . 'Smarty.class.php');" Here SMARTY_DIR is constant, which automatically set by Smarty. 2.. second way is what i have done in my previous reply In all cases you have to make path to smarty class file that's it.. Quote Link to comment https://forums.phpfreaks.com/topic/255027-installing-smarty-on-wamp-help-wanted/#findComment-1312870 Share on other sites More sharing options...
kev Posted January 31, 2012 Author Share Posted January 31, 2012 Hello Mahedra. Thanks form replying. I had already used the setup and code from Jon Lyles blog and it threw out an error, this I corrected (more by accident than design) by removing from the "include_once" the 'SMARTY_DIR .' reference, it all worked fine after that. The interest now, after having success with the 'Basic' setup was to get the 'Extended setup' to function, I think Jon Lyle's code for this particular type of setup needs examining and maybe modifying to suit a newer version of Smarty. I have attempted to contact Jon Lyle but without success. I am a rank amateur at coding and would be grateful for your help. Kev Quote Link to comment https://forums.phpfreaks.com/topic/255027-installing-smarty-on-wamp-help-wanted/#findComment-1312920 Share on other sites More sharing options...
kev Posted February 1, 2012 Author Share Posted February 1, 2012 Hello again Mahendra. I found what amounted to a couple of typo's in my script for using Smarty extended setup and it now almost works. At a guess I would say this error is due to a problem with some sort of variation with the Smarty version that I am using and the version that Jon Lyle used, here is the error. Fatal error: Uncaught exception 'SmartyException' with message 'Call of unknown function 'Smarty'.' in C:\wamp\bin\php\php5.3.0\Smarty\libs\sysplugins\smarty_internal_templatebase.php:692 Stack trace: #0 [internal function]: Smarty_Internal_TemplateBase->__call('Smarty', Array) #1 C:\wamp\bin\php\php5.3.0\includes\guestbook\setup.php(18): Smarty_GuestBook->Smarty() #2 C:\wamp\www\guestbook\index.php(4): Smarty_GuestBook->Smarty_GuestBook() #3 {main} thrown in C:\wamp\bin\php\php5.3.0\Smarty\libs\sysplugins\smarty_internal_templatebase.php on line 692 Thans Kev Quote Link to comment https://forums.phpfreaks.com/topic/255027-installing-smarty-on-wamp-help-wanted/#findComment-1313264 Share on other sites More sharing options...
kev Posted February 1, 2012 Author Share Posted February 1, 2012 Hello again Mahendra. I had another go at the 'extended setup' I compared Jon Lyles 'setup.php' against Smarty.net 'extended setup' I had to make one or two alterations and the thing worked first time. That's that sorted now to fix 'PEAR' Kev Quote Link to comment https://forums.phpfreaks.com/topic/255027-installing-smarty-on-wamp-help-wanted/#findComment-1313480 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.