]> git.immae.eu Git - github/shaarli/Shaarli.git/blame - doc/md/Troubleshooting.md
**General rewording, proof-reading, deduplication, shortening, reordering, simplifica...
[github/shaarli/Shaarli.git] / doc / md / Troubleshooting.md
CommitLineData
53ed6d7d 1# Troubleshooting
2
91a21c27 3First of all, ensure that both the [web server](Server-configuration.md) and [Shaarli](Shaarli-configuration.md) are correctly configured.
4
5
992af0b9 6## Login
53ed6d7d 7
992af0b9 8### I forgot my password!
53ed6d7d 9
48679a15 10Delete the file `data/config.json.php` and display the page again. You will be asked for a new login/password.
992af0b9
V
11
12### I'm locked out - Login bruteforce protection
53ed6d7d 13
91a21c27 14Login 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 Shaares.
992af0b9 15
74c1d020 16- To remove the current IP bans, delete the file `data/ipbans.php`
17- To list all login attempts, see `data/log.txt` (succesful/failed logins, bans/lifted bans)
992af0b9 18
91a21c27 19--------------------------------------
20
74c1d020 21## Browser issues
53ed6d7d 22
74c1d020 23### Redirection issues (HTTP Referer)
24
91a21c27 25Shaarli relies on `HTTP_REFERER` for some functions (like redirects and clicking on tags). If you have disabled or altered/spoofed [HTTP referers](https://en.wikipedia.org/wiki/HTTP_referer) in your browser, some features of Shaarli may not work as expected (depending on configuration and installed plugins), notably redirections between pages.
26
27Firefox Referer settings are available by browsing `about:config` and are documented [here](https://wiki.mozilla.org/Security/Referrer). `network.http.referer.spoofSource = true` in particular is known to break some functionality in Shaarli.
28
74c1d020 29
30### Firefox, localhost and redirections
31
32`localhost` is not a proper Fully Qualified Domain Name (FQDN); if Firefox has been set up to spoof referers, or only accept requests from the same base domain/host,
33Shaarli redirections will not work properly. To solve this, assign a local domain to your host, e.g. `localhost.lan` in your [hosts file](https://en.wikipedia.org/wiki/Hosts_(file)) and browse Shaarli at http://localhost.lan/.
992af0b9 34
91a21c27 35-----------------------------------------
36
992af0b9 37## Hosting problems
53ed6d7d 38
6335a0fc 39### Old PHP versions
53ed6d7d 40
43ad7c8e
V
41On **free.fr**: free.fr now supports php 5.6.x([link](http://les.pages.perso.chez.free.fr/migrations/php5v6.io))
42and so support now the tag autocompletion but you have to do the following.
43
44At the root of your webspace create a `sessions` directory and a `.htaccess` file containing:
992af0b9 45
43ad7c8e 46```xml
f8b936e7
V
47<IfDefine Free>
48php56 1
49</IfDefine>
992af0b9
V
50```
51
43ad7c8e
V
52- 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`
53- 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).
54- 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
55
56```php
57//list($status,$headers,$data) = getHTTP($url,4); // Short timeout to keep the application responsive.
48679a15 58// FIXME: Decode charset according to charset specified in either 1) HTTP response headers or 2) <head> in html
992af0b9
V
59//if (strpos($status,'200 OK')) $title=html_extract_title($data);
60```
61
43ad7c8e
V
62- On hosts which forbid outgoing HTTP requests (such as free.fr), some thumbnails will not work.
63- 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
64
65### Dates are not properly formatted
53ed6d7d 66
48679a15
V
67Shaarli tries to sniff the language of the browser (using `HTTP_ACCEPT_LANGUAGE` headers)
68and choose a date format accordingly. But Shaarli can only use the date formats
69(and more generally speaking, the locales) provided by the webserver.
70So even if you have a browser in French, you may end up with dates in US format
71(it's the case on sebsauvage.net :-( )
992af0b9 72
992af0b9 73### My session expires! I can't stay logged in
53ed6d7d 74
992af0b9
V
75This can be caused by several things:
76
43ad7c8e
V
77- 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.
78- 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 !)
79- 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).
80- Some browser addons may interfer with HTTP headers (ipfuck/ipflood/GreaseMonkey…). Try disabling those.
81- You may be using OperaTurbo or OperaMini, which use their own proxies which may change from time to time.
82- If you have another application on the same webserver where Shaarli is installed, these application may forcefully expire php sessions.
992af0b9 83
91a21c27 84
74c1d020 85### Old apache versions, Internal Server Error
86
87If you hosting provider only provides apache 2.2 and no support for `mod_version`, `.htaccess` files may cause 500 errors (Internal Server Error). See [this workaround](https://github.com/shaarli/Shaarli/issues/1196#issuecomment-412271085).
88
91a21c27 89
90### Sessions do not seem to work correctly on your server
53ed6d7d 91
92Follow 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)).
5256f83d 93
91a21c27 94----------------------------------------------------------
95
96## Upgrades
97
98### You must specify an integer as a key
99
100In `v0.8.1` we changed how Shaare keys are handled (from timestamps to incremental integers). Take a look at `data/updates.txt` content.
101
102
103### `updates.txt` contains `updateMethodDatastoreIds`
104
105Try to delete it and refresh your page while being logged in.
106
107### `updates.txt` doesn't exist or doesn't contain `updateMethodDatastoreIds`
108
1091. Create `data/updates.txt` if it doesn't exist
1102. Paste this string in the update file `;updateMethodRenameDashTags;`
1113. Login to Shaarli
1124. Delete the update file
1135. Refresh
114
115
116
117--------------------------------------------------------
118
119## Import/export
120
121### Importing shaarli data to Firefox
122
123- In Firefox, open the bookmark manager (`Bookmarks menu > Show all bookmarks` or `Ctrl+Shift+B`), select `Import and Backup > Import bookmarks in HTML format`
124- Make sure the `Prepend note permalinks with this Shaarli instance's URL` box is checked when exporting, so that text-only/notes Shaares still point to the Shaarli instance you exported them from.
125- Depending on the number of bookmarks, the import can take some time.
126
127You may be interested in these Firefox addons to manage bookmarks imported from Shaarli
128
129- [Bookmark Deduplicator](https://addons.mozilla.org/en-US/firefox/addon/bookmark-deduplicator/) - provides an easy way to deduplicate your bookmarks
130- [TagSieve](https://addons.mozilla.org/en-US/firefox/addon/tagsieve/) - browse your bookmarks by their tags
131
132### Diigo
133
134If you export your bookmark from Diigo, make sure you use the Delicious export, not the Netscape export. (Their Netscape export is broken, and they don't seem to be interested in fixing it.)
135
136### Mister Wong
137
138See [this issue](https://github.com/sebsauvage/Shaarli/issues/146) for import tweaks.
139
140### SemanticScuttle
141
142To correctly import the tags from a [SemanticScuttle](http://semanticscuttle.sourceforge.net/) HTML export, edit the HTML file before importing and replace all occurences of `tags=` (lowercase) to `TAGS=` (uppercase).
143
144### Scuttle
145
146Shaarli cannot import data directly from [Scuttle](https://github.com/scronide/scuttle).
147
148However, you can use the third-party [scuttle-to-shaarli](https://github.com/q2apro/scuttle-to-shaarli)
149tool to export the Scuttle database to the Netscape HTML format compatible with the Shaarli importer.
150
151### Refind.com
152
153You can use the third-party tool [Derefind](https://github.com/ShawnPConroy/Derefind) to convert refind.com bookmark exports to a format that can be imported into Shaarli.
154
155
156-------------------------------------------------------
157
158## Other
159
160### The bookmarklet doesn't work
161
162Websites which enforce Content Security Policy (CSP), such as github.com, disallow usage of bookmarklets. Unfortunately, there is nothing Shaarli can do about it ([1](https://github.com/shaarli/Shaarli/issues/196), [2](https://bugzilla.mozilla.org/show_bug.cgi?id=866522), [3](https://code.google.com/p/chromium/issues/detail?id=233903).
163
164Under Opera, you can't drag'n drop the button: You have to right-click on it and add a bookmark to your personal toolbar.
165
166
167### Changing the timestamp for a shaare
168
169- Look for `<input type="hidden" name="lf_linkdate" value="{$link.linkdate}">` in `tpl/editlink.tpl` (line 14)
170- Replace `type="hidden"` with `type="text"` from this line
171- A new date/time field becomes available in the edit/new Shaare dialog.
172- You can set the timestamp manually by entering it in the format `YYYMMDD_HHMMS`.
173
174
175-------------------------------------------------------
176
177## Support
178
179If the solutions above did not help, please:
180
181- Come and ask question on the [Gitter chat](https://gitter.im/shaarli/Shaarli) (also reachable via [IRC](https://irc.gitter.im/))
182- Search for [issues](https://github.com/shaarli/Shaarli/issues) and [Pull Requests](https://github.com/shaarli/Shaarli/pulls)
183 - if you find one that is related to the issue, feel free to comment and provide additional details (host/Shaarli setup...)
184 - check issues labeled [`feature`](https://github.com/shaarli/Shaarli/labels/feature), [`enhancement`](https://github.com/shaarli/Shaarli/labels/enhancement), and [`plugin`](https://github.com/shaarli/Shaarli/labels/plugin) if you would like a feature added to Shaarli.
185 - else, [open a new issue](https://github.com/shaarli/Shaarli/issues/new), and provide information about the problem:
186 - _what happens?_ - display glitches, invalid data, security flaws...
187 - _what is your configuration?_ - OS, server version, activated extensions, web browser...
188 - _is it reproducible?_