update FAQ, QUICKSTART, small doc syntax fix

This commit is contained in:
mohrt
2002-04-26 14:08:17 +00:00
parent 7e14a31152
commit 4f36d58bc4
3 changed files with 30 additions and 14 deletions

19
FAQ
View File

@@ -18,6 +18,9 @@ Q: Can you change the mailing list so reply-to sends to the list and not the
TROUBLESHOOTING TROUBLESHOOTING
Q: Smarty doesn't work. Q: Smarty doesn't work.
Q: I get the following error when running Smarty:
Warning: Smarty error: problem creating directory "templates_c/239/239105369"
in /path/to/Smarty.class.php on line 542
Q: I get the following error when running Smarty: Q: I get the following error when running Smarty:
Warning: Wrong parameter count for preg_replace() in Warning: Wrong parameter count for preg_replace() in
Smarty.class.php on line 371 Smarty.class.php on line 371
@@ -147,8 +150,20 @@ A: You must be using PHP 4.0.6 or later if you use any version of Smarty
past 2.0.1. Read the BUGS file for more info. past 2.0.1. Read the BUGS file for more info.
Q: I get the following error when running Smarty: Q: I get the following error when running Smarty:
Warning: Wrong parameter count for preg_replace() in Warning: Smarty error: problem creating directory "templates_c/239/239105369"
Smarty.class.php on line 371 in /path/to/Smarty.class.php on line 542
A: Your web server user does not have permission to write to the templates_c
directory, or is unable to create the templates_c directory. Be sure the
templates_c directory exists in the location defined in Smarty.class.php,
and the web server user can write to it. If you do not know the web server
user, chmod 777 the templates_c directory, reload the page, then check the
file ownership of the files created in templates_c. Or, you can check the
httpd.conf (usually in /usr/local/apache/conf) file for this setting:
User nobody
Group nobody
Q: I get the following error when running Smarty: Warning: Wrong parameter
count for preg_replace() in Smarty.class.php on line 371
A: preg_replace had a parameter added in PHP 4.0.2 that Smarty A: preg_replace had a parameter added in PHP 4.0.2 that Smarty
requires. Upgrade to at least 4.0.6 to fix all known PHP issues with requires. Upgrade to at least 4.0.6 to fix all known PHP issues with
Smarty. Smarty.

View File

@@ -13,13 +13,13 @@ should understand the difference in your OS regarding file permissions.
INSTALLATION INSTALLATION
------------ ------------
Unpack the Smarty tarball. You will see four class files: Smarty.class.php, Unpack the Smarty tarball. You will see some files: Smarty.class.php,
Smarty_Compiler.class.php and Config_File.class.php and a Smarty_Compiler.class.php, Config_File.class.php and a "plugins" directory. You
"plugins" directory. You will need to have all four of these files somewhere in will need all of these files somewhere in your PHP include path, so when you call
your PHP include path, so when you call require("Smarty.class.php") from within require("Smarty.class.php") from within your application, it can find the
your application, it can find the class. Alternatively, you can set the class. Alternatively, you can set the SMARTY_DIR constant in your application,
SMARTY_DIR constant in your application, and Smarty will use that directory as and Smarty will use that directory as the path to the Smarty class files. Be
the path to the Smarty class files. Be sure the path ends with a slash! sure the SMARTY_DIR path ends with a slash!
Now change directories somewhere inside of your web server document root. For Now change directories somewhere inside of your web server document root. For
this guide, we'll create a directory under the document root named "Smarty", this guide, we'll create a directory under the document root named "Smarty",
@@ -37,9 +37,10 @@ $> mkdir configs
Smarty needs to be able to write to the templates_c directory. It is Smarty needs to be able to write to the templates_c directory. It is
recommended that you change the ownership and write permissions such that the recommended that you change the ownership and write permissions such that the
web server user (usually nobody) has write access to this directory. You can web server user (usually "nobody:nobody", Mac OS X uses "www:www") has write
chmod 777 the directory, but be aware of security concerns on multi-user access to this directory. You can chmod 777 the directory, but be aware of
systems. See the documentation for more info on this. security concerns on multi-user systems. See the documentation for more info on
this.
$> chown nobody:nobody templates_c $> chown nobody:nobody templates_c
$> chmod 700 templates_c $> chmod 700 templates_c
@@ -243,7 +244,7 @@ Here we are introducing the {$smarty} variable, which is used to reference
values internal to the template. Notice that when printing variables inside of values internal to the template. Notice that when printing variables inside of
the section, the section name must be referenced in the name of the variable the section, the section name must be referenced in the name of the variable
being displayed. This lets Smarty understand that you want to print the value being displayed. This lets Smarty understand that you want to print the value
in the array postion indexed by the current loop value. There are also internal in the array position indexed by the current loop value. There are also internal
template variables available within the section that display the loop iteration template variables available within the section that display the loop iteration
and the total number of times the section is looped. Also note the and the total number of times the section is looped. Also note the
{sectionelse}. This would have been displayed if looped array $FirstName was {sectionelse}. This would have been displayed if looped array $FirstName was

View File

@@ -1,4 +1,4 @@
<part id="smarty.for.programmersr"> <part id="smarty.for.programmers">
<title>Smarty For Programmers</title> <title>Smarty For Programmers</title>
<chapter id="api.variables"> <chapter id="api.variables">
<title>Variables</title> <title>Variables</title>