]> git.immae.eu Git - github/shaarli/Shaarli.git/blame - doc/md/Troubleshooting.md
code clean: cookie expiration
[github/shaarli/Shaarli.git] / doc / md / Troubleshooting.md
CommitLineData
53ed6d7d 1# Troubleshooting
2
6335a0fc 3## Browser
53ed6d7d 4
6335a0fc 5### Redirection issues (HTTP Referer)
53ed6d7d 6
6335a0fc
V
7Depending on its configuration and installed plugins, the browser may remove or alter (spoof) HTTP referers, thus preventing Shaarli from properly redirecting between pages.
8
9See:
43ad7c8e 10
53ed6d7d 11- [HTTP referer](https://en.wikipedia.org/wiki/HTTP_referer) (Wikipedia)
12- [Improve online privacy by controlling referrer information](http://www.ghacks.net/2015/01/22/improve-online-privacy-by-controlling-referrer-information/)
13- [Better security, privacy and anonymity in Firefox](http://b.agilob.net/better-security-privacy-and-anonymity-in-firefox/)
6335a0fc
V
14
15### Firefox HTTP Referer options
53ed6d7d 16
6335a0fc
V
17HTTP settings are available by browsing `about:config`, here are the available settings and their values.
18
19`network.http.sendRefererHeader` - determines when to send the Referer HTTP header
43ad7c8e
V
20
21- `0`: Never send the referring URL
6335a0fc 22 - not recommended, may break some sites
43ad7c8e
V
23- `1`: Send only on clicked links
24- `2` (default): Send for links and images
6335a0fc
V
25
26`network.http.referer.XOriginPolicy` - Cross-domain origin policy
43ad7c8e
V
27
28- `0` (default): Always send
29- `1`: Send if base domains match
30- `2`: Send if hosts match
6335a0fc
V
31
32`network.http.referer.spoofSource` - Referer spoofing (~faking)
43ad7c8e
V
33
34- `false` (default): real referer
35- `true`: spoof referer (use target URI as referer)
36 - known to break some functionality in Shaarli
6335a0fc
V
37
38`network.http.referer.trimmingPolicy` - trim the URI not to send a full Referer
43ad7c8e
V
39
40- `0`: (default): send full URI
41- `1`: scheme+host+port+path
42- `2`: scheme+host+port
6335a0fc
V
43
44### Firefox, localhost and redirections
53ed6d7d 45
43ad7c8e
V
46`localhost` is not a proper Fully Qualified Domain Name (FQDN); if Firefox has
47been set up to spoof referers, or only accept requests from the same base domain/host,
48Shaarli redirections will not work properly.
6335a0fc
V
49
50To solve this, assign a local domain to your host, e.g.
51```
52127.0.0.1 localhost desktop localhost.lan
53::1 localhost desktop localhost.lan
54```
55
56and browse Shaarli at http://localhost.lan/.
57
58Related threads:
53ed6d7d 59- [What is localhost.localdomain for?](https://bbs.archlinux.org/viewtopic.php?id=156064)
60- [Stop returning to the first page after editing a bookmark from another page](https://github.com/shaarli/Shaarli/issues/311)
6335a0fc 61
992af0b9 62## Login
53ed6d7d 63
992af0b9 64### I forgot my password!
53ed6d7d 65
992af0b9
V
66Delete the file `data/config.php` and display the page again. You will be asked for a new login/password.
67
68### I'm locked out - Login bruteforce protection
53ed6d7d 69
992af0b9
V
70Login form is protected against brute force attacks: 4 failed logins will ban the IP address from login for 30 minutes. Banned IPs can still browse links.
71
72To remove the current IP bans, delete the file `data/ipbans.php`
73
74### List of all login attempts
53ed6d7d 75
992af0b9
V
76The file `data/log.txt` shows all logins (successful or failed) and bans/lifted bans.
77Search for `failed` in this file to look for unauthorized login attempts.
78
79## Hosting problems
53ed6d7d 80
6335a0fc 81### Old PHP versions
53ed6d7d 82
43ad7c8e
V
83On **free.fr**: free.fr now supports php 5.6.x([link](http://les.pages.perso.chez.free.fr/migrations/php5v6.io))
84and so support now the tag autocompletion but you have to do the following.
85
86At the root of your webspace create a `sessions` directory and a `.htaccess` file containing:
992af0b9 87
43ad7c8e 88```xml
f8b936e7
V
89<IfDefine Free>
90php56 1
91</IfDefine>
992af0b9
V
92```
93
43ad7c8e
V
94- If you have an error such as: `Parse error: syntax error, unexpected '=', expecting '(' in /links/index.php on line xxx`, it means that your host is using php4, not php5. Shaarli requires php 5.1. Try changing the file extension to `.php5`
95- On **1and1** : If you add the link from the page (and not from the bookmarklet), Shaarli will no be able to get the title of the page. You will have to enter it manually. (Because they have disabled the ability to download a file through HTTP).
96- If you have the error `Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /…/index.php on line xxx`, it means that your host has disabled the ability to fetch a file by HTTP in the php config (Typically in 1and1 hosting). Bad host. Change host. Or comment the following lines:
992af0b9
V
97
98```php
99//list($status,$headers,$data) = getHTTP($url,4); // Short timeout to keep the application responsive.
100// FIXME: Decode charset according to charset specified in either 1) HTTP response headers or 2) <head> in html
101//if (strpos($status,'200 OK')) $title=html_extract_title($data);
102```
103
43ad7c8e
V
104- On hosts which forbid outgoing HTTP requests (such as free.fr), some thumbnails will not work.
105- On **lost-oasis**, RSS doesn't work correctly, because of this message at the begining of the RSS/ATOM feed : `<? // tout ce qui est charge ici (generalement des includes et require) est charge en permanence. ?>`. To fix this, remove this message from `php-include/prepend.php`
992af0b9
V
106
107### Dates are not properly formatted
53ed6d7d 108
992af0b9
V
109Shaarli tries to sniff the language of the browser (using HTTP_ACCEPT_LANGUAGE headers) and choose a date format accordingly. But Shaarli can only use the date formats (and more generaly speaking, the locales) provided by the webserver. So even if you have a browser in French, you may end up with dates in US format (it's the case on sebsauvage.net :-( )
110
111### Problems on CentOS servers
53ed6d7d 112
992af0b9
V
113On **CentOS**/RedHat derivatives, you may need to install the `php-mbstring` package.
114
992af0b9 115### My session expires! I can't stay logged in
53ed6d7d 116
992af0b9
V
117This can be caused by several things:
118
43ad7c8e
V
119- Your php installation may not have a proper directory setup for session files. (eg. on Free.fr you need to create a `session` directory on the root of your website.) You may need to create the session directory of set it up.
120- Most hosts regularly clean the temporary and session directories. Your host may be cleaning those directories too aggressively (eg.OVH hosts), forcing an expire of the session. You may want to set the session directory in your web root. (eg. Create the `sessions` subdirectory and add `ini_set('session.save_path', $_SERVER['DOCUMENT_ROOT'].'/../sessions');`. Make sure this directory is not browsable !)
121- If your IP address changes during surfing, Shaarli will force expire your session for security reasons (to prevent session cookie hijacking). This can happen when surfing from WiFi or 3G (you may have switched WiFi/3G access point), or in some corporate/university proxies which use load balancing (and may have proxies with several external IP addresses).
122- Some browser addons may interfer with HTTP headers (ipfuck/ipflood/GreaseMonkey…). Try disabling those.
123- You may be using OperaTurbo or OperaMini, which use their own proxies which may change from time to time.
124- If you have another application on the same webserver where Shaarli is installed, these application may forcefully expire php sessions.
992af0b9
V
125
126## Sessions do not seem to work correctly on your server
53ed6d7d 127
128Follow the instructions in the error message. Make sure you are accessing shaarli via a direct IP address or a proper hostname. If you have **no dots** in the hostname (e.g. `localhost` or `http://my-webserver/shaarli/`), some browsers will not store cookies at all (this respects the [HTTP cookie specification](http://curl.haxx.se/rfc/cookie_spec.html)).
992af0b9
V
129
130### pubsubhubbub support
53ed6d7d 131
132Download [publisher.php](https://pubsubhubbub.googlecode.com/git/publisher_clients/php/library/publisher.php) at the root of your Shaarli installation and set `$GLOBALS['config']['PUBSUBHUB_URL']` in your `config.php`