From 4f36d58bc40833eae4282ce04f7df39609f3213f Mon Sep 17 00:00:00 2001 From: mohrt Date: Fri, 26 Apr 2002 14:08:17 +0000 Subject: [PATCH] update FAQ, QUICKSTART, small doc syntax fix --- FAQ | 19 +++++++++++++++++-- QUICKSTART | 23 ++++++++++++----------- docs/programmers.sgml | 2 +- 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/FAQ b/FAQ index f4686d03..b2032ba3 100644 --- a/FAQ +++ b/FAQ @@ -18,6 +18,9 @@ Q: Can you change the mailing list so reply-to sends to the list and not the TROUBLESHOOTING 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: Warning: Wrong parameter count for preg_replace() in 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. Q: I get the following error when running Smarty: - Warning: Wrong parameter count for preg_replace() in - Smarty.class.php on line 371 + Warning: Smarty error: problem creating directory "templates_c/239/239105369" + 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 requires. Upgrade to at least 4.0.6 to fix all known PHP issues with Smarty. diff --git a/QUICKSTART b/QUICKSTART index ecb9de6b..6b37e5f6 100644 --- a/QUICKSTART +++ b/QUICKSTART @@ -13,13 +13,13 @@ should understand the difference in your OS regarding file permissions. INSTALLATION ------------ -Unpack the Smarty tarball. You will see four class files: Smarty.class.php, -Smarty_Compiler.class.php and Config_File.class.php and a -"plugins" directory. You will need to have all four of these files somewhere in -your PHP include path, so when you call require("Smarty.class.php") from within -your application, it can find the class. Alternatively, you can set the -SMARTY_DIR constant in your application, and Smarty will use that directory as -the path to the Smarty class files. Be sure the path ends with a slash! +Unpack the Smarty tarball. You will see some files: Smarty.class.php, +Smarty_Compiler.class.php, Config_File.class.php and a "plugins" directory. You +will need all of these files somewhere in your PHP include path, so when you call +require("Smarty.class.php") from within your application, it can find the +class. Alternatively, you can set the SMARTY_DIR constant in your application, +and Smarty will use that directory as the path to the Smarty class files. Be +sure the SMARTY_DIR path ends with a slash! 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", @@ -37,9 +37,10 @@ $> mkdir configs 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 -web server user (usually nobody) has write access to this directory. You can -chmod 777 the directory, but be aware of security concerns on multi-user -systems. See the documentation for more info on this. +web server user (usually "nobody:nobody", Mac OS X uses "www:www") has write +access to this directory. You can chmod 777 the directory, but be aware of +security concerns on multi-user systems. See the documentation for more info on +this. $> chown nobody:nobody 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 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 -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 and the total number of times the section is looped. Also note the {sectionelse}. This would have been displayed if looped array $FirstName was diff --git a/docs/programmers.sgml b/docs/programmers.sgml index 67cdb136..3da3552e 100644 --- a/docs/programmers.sgml +++ b/docs/programmers.sgml @@ -1,4 +1,4 @@ - + Smarty For Programmers Variables