Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 148 Revision 991
Zeile 1... Zeile 1...
1
Troubleshooting
1
# Troubleshooting
2
===============
-
 
Zeile 3... Zeile 2...
3
 
2
 
4
Smarty/PHP errors {#smarty.php.errors}
-
 
Zeile 5... Zeile 3...
5
=================
3
## Smarty/PHP errors
6
 
4
 
7
Smarty can catch many errors such as missing tag attributes or malformed
5
Smarty can catch many errors such as missing tag attributes or malformed
Zeile 8... Zeile 6...
8
variable names. If this happens, you will see an error similar to the
6
variable names. If this happens, you will see an error similar to the
9
following:
7
following:
10
 
8
 
11
 
9
```
12
    Warning: Smarty: [in index.tpl line 4]: syntax error: unknown tag - '%blah'
10
Warning: Smarty: [in index.tpl line 4]: syntax error: unknown tag - '%blah'
13
           in /path/to/smarty/Smarty.class.php on line 1041
11
       in /path/to/smarty/Smarty.class.php on line 1041
14
 
12
 
Zeile 15... Zeile 13...
15
    Fatal error: Smarty: [in index.tpl line 28]: syntax error: missing section name
13
Fatal error: Smarty: [in index.tpl line 28]: syntax error: missing section name
16
           in /path/to/smarty/Smarty.class.php on line 1041
14
       in /path/to/smarty/Smarty.class.php on line 1041
17
 
15
```
Zeile 18... Zeile 16...
18
        
16
        
19
 
17
 
20
Smarty shows you the template name, the line number and the error. After
18
Smarty shows you the template name, the line number and the error. After
Zeile 21... Zeile -...
21
that, the error consists of the actual line number in the Smarty class
-
 
22
that the error occurred.
19
that, the error consists of the actual line number in the Smarty class
23
 
-
 
24
There are certain errors that Smarty cannot catch, such as missing close
20
that the error occurred.
25
tags. These types of errors usually end up in PHP compile-time parsing
-
 
26
errors.
21
 
27
 
22
There are certain errors that Smarty cannot catch, such as missing close
28
 
23
tags. These types of errors usually end up in PHP compile-time parsing
29
    Parse error: parse error in /path/to/smarty/templates_c/index.tpl.php on line 75
24
errors.
30
 
25
 
31
        
26
`Parse error: parse error in /path/to/smarty/templates_c/index.tpl.php on line 75`
32
 
27
    
33
When you encounter a PHP parsing error, the error line number will
28
When you encounter a PHP parsing error, the error line number will
34
correspond to the compiled PHP script, NOT the template itself. Usually
29
correspond to the compiled PHP script, NOT the template itself. Usually
Zeile -... Zeile 30...
-
 
30
you can look at the template and spot the syntax error. Here are some
-
 
31
common things to look for: missing close tags for
-
 
32
[`{if}{/if}`](../designers/language-builtin-functions/language-function-if.md) or
-
 
33
[`{section}{/section}`](../designers/language-builtin-functions/language-function-section.md), 
-
 
34
or syntax of logic within an `{if}` tag. If you can\'t find the error, you might have to
-
 
35
open the compiled PHP file and go to the line number to figure out where
-
 
36
the corresponding error is in the template.
Zeile 35... Zeile -...
35
you can look at the template and spot the syntax error. Here are some
-
 
36
common things to look for: missing close tags for
-
 
37
[`{if}{/if}`](#language.function.if) or
-
 
38
[`{section}{/section}`](#language.function.if), or syntax of logic
-
 
39
within an `{if}` tag. If you can\'t find the error, you might have to
37
 
40
open the compiled PHP file and go to the line number to figure out where
38
```
Zeile 41... Zeile 39...
41
the corresponding error is in the template.
39
Warning: Smarty error: unable to read resource: "index.tpl" in...
42
 
40
```
43
 
41
or
44
    Warning: Smarty error: unable to read resource: "index.tpl" in...
42
```
Zeile 45... Zeile -...
45
    or
-
 
46
    Warning: Smarty error: unable to read resource: "site.conf" in...
-
 
47
 
43
Warning: Smarty error: unable to read resource: "site.conf" in...
48
-   The [`$template_dir`](#variable.template.dir) is incorrect, doesn\'t
44
```
49
    exist or the file `index.tpl` is not in the `templates/` directory
45
 
-
 
46
-   The [`$template_dir`](../programmers/api-variables/variable-template-dir.md) is incorrect, doesn't
Zeile 50... Zeile -...
50
 
-
 
51
-   A [`{config_load}`](#language.function.config.load) function is
-
 
52
    within a template (or [`configLoad()`](#api.config.load) has been
47
    exist or the file `index.tpl` is not in the `templates/` directory
53
    called) and either [`$config_dir`](#variable.config.dir) is
48
 
54
    incorrect, does not exist or `site.conf` is not in the directory.
49
-   A [`{config_load}`](../designers/language-builtin-functions/language-function-config-load.md) function is
Zeile 55... Zeile -...
55
 
-
 
56
<!-- -->
-
 
57
 
50
    within a template (or [`configLoad()`](../programmers/api-functions/api-config-load.md) has been
58
 
51
    called) and either [`$config_dir`](../programmers/api-variables/variable-config-dir.md) is
59
    Fatal error: Smarty error: the $compile_dir 'templates_c' does not exist,
52
    incorrect, does not exist or `site.conf` is not in the directory.
Zeile 60... Zeile 53...
60
    or is not a directory...
53
 
61
 
54
```
62
        
55
Fatal error: Smarty error: the $compile_dir 'templates_c' does not exist,
63
 
-
 
64
-   Either the [`$compile_dir`](#variable.compile.dir)is incorrectly
-
 
65
    set, the directory does not exist, or `templates_c` is a file and
-
 
66
    not a directory.
-
 
67
 
-
 
68
<!-- -->
-
 
Zeile -... Zeile 56...
-
 
56
or is not a directory...
-
 
57
```
-
 
58
 
-
 
59
-   Either the [`$compile_dir`](../programmers/api-variables/variable-compile-dir.md)is incorrectly
Zeile 69... Zeile -...
69
 
-
 
70
 
60
    set, the directory does not exist, or `templates_c` is a file and
71
    Fatal error: Smarty error: unable to write to $compile_dir '....
61
    not a directory.
72
 
62
 
73
        
63
```
Zeile 74... Zeile 64...
74
 
64
Fatal error: Smarty error: unable to write to $compile_dir '....
-
 
65
```
75
-   The [`$compile_dir`](#variable.compile.dir) is not writable by the
66
        
Zeile 76... Zeile -...
76
    web server. See the bottom of the [installing
-
 
77
    smarty](#installing.smarty.basic) page for more about permissions.
-
 
78
 
-
 
79
<!-- -->
-
 
80
 
67
 
81
 
68
-   The [`$compile_dir`](../programmers/api-variables/variable-compile-dir.md) is not writable by the
82
    Fatal error: Smarty error: the $cache_dir 'cache' does not exist,
69
    web server. See the bottom of the [installing
83
    or is not a directory. in /..
70
    smarty](../getting-started.md#installation) page for more about permissions.
84
 
-
 
85
        
-
 
86
 
-
 
87
-   This means that [`$caching`](#variable.caching) is enabled and
-
 
88
    either; the [`$cache_dir`](#variable.cache.dir) is incorrectly set,
-
 
89
    the directory does not exist, or `cache/` is a file and not a
-
 
Zeile -... Zeile 71...
-
 
71
 
-
 
72
```
-
 
73
Fatal error: Smarty error: the $cache_dir 'cache' does not exist,
90
    directory.
74
or is not a directory. in /..
Zeile 91... Zeile 75...
91
 
75
```
92
<!-- -->
76
        
93
 
77
-   This means that [`$caching`](../programmers/api-variables/variable-caching.md) is enabled and
94
 
78
    either; the [`$cache_dir`](../programmers/api-variables/variable-cache-dir.md) is incorrectly set,
95
    Fatal error: Smarty error: unable to write to $cache_dir '/...
79
    the directory does not exist, or `cache/` is a file and not a
96
 
80
    directory.
97
        
81
 
Zeile 98... Zeile 82...
98
 
82
```