(redirected from Main.InstallingSmarty)
On this page... (hide)
Installing Smarty is really quite simple on certain distributions.
Debian/Ubuntu and derivatives
Simple as running apt-get:
and Bob's your uncle.
The above command puts the smarty installation in one of the standard php library include paths, so you can include it in your PHP code with:
OS/X
It's a little more difficult to do on OS/X, since there are a few different possibilities, depending on how and where you've installed PHP.
You can always install Smarty directly yourself, which is simply a matter of downloading the files from http://www.smarty.net/download -- you probably want the latest stable release.
Unpack the .zip file someplace temporarily (I often just do this in my ~/Downloads directory). Then, move the files from the libs directory to an appropriate place on your PHP include path. You can place them directly in a directory on the include path, or you can do like the Debian install does and put them in a sub-directory called "smarty".
If you've installed the Smarty libraries directly on the include path, then the line to include it in your application is:
If you've installed Smarty in a sub-directory on your include path, then:
If you've installed Smarty someplace else entirely, you will need to do 2 things:
- Define the constant SMARTY_DIR to point to the absolute path where Smarty lives.
- Use the SMARTY_DIR define in your
require_oncedirective:
require_once(SMARTY_DIR.'Smarty.class.php');
On to Configuring Smarty >>
| Tags: | Categories: Articles |
Recent Changes |
Printable View |
Page History |
Edit Page
Page last modified on April 13, 2012, at 01:52 PM by tamara