]> git.immae.eu Git - github/shaarli/Shaarli.git/blame - doc/Troubleshooting.html
Bump version to v0.8.0
[github/shaarli/Shaarli.git] / doc / Troubleshooting.html
CommitLineData
992af0b9
V
1<!DOCTYPE html>
2<html>
3<head>
4 <meta charset="utf-8">
5 <meta name="generator" content="pandoc">
6 <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
5409ade2 7 <title>Shaarli – Troubleshooting</title>
992af0b9 8 <style type="text/css">code{white-space: pre;}</style>
992af0b9 9 <style type="text/css">
5409ade2 10div.sourceCode { overflow-x: auto; }
992af0b9
V
11table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
12 margin: 0; padding: 0; vertical-align: baseline; border: none; }
13table.sourceCode { width: 100%; line-height: 100%; }
14td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
15td.sourceCode { padding-left: 5px; }
5409ade2
A
16code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
17code > span.dt { color: #902000; } /* DataType */
18code > span.dv { color: #40a070; } /* DecVal */
19code > span.bn { color: #40a070; } /* BaseN */
20code > span.fl { color: #40a070; } /* Float */
21code > span.ch { color: #4070a0; } /* Char */
22code > span.st { color: #4070a0; } /* String */
23code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
24code > span.ot { color: #007020; } /* Other */
25code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
26code > span.fu { color: #06287e; } /* Function */
27code > span.er { color: #ff0000; font-weight: bold; } /* Error */
28code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
29code > span.cn { color: #880000; } /* Constant */
30code > span.sc { color: #4070a0; } /* SpecialChar */
31code > span.vs { color: #4070a0; } /* VerbatimString */
32code > span.ss { color: #bb6688; } /* SpecialString */
33code > span.im { } /* Import */
34code > span.va { color: #19177c; } /* Variable */
35code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
36code > span.op { color: #666666; } /* Operator */
37code > span.bu { } /* BuiltIn */
38code > span.ex { } /* Extension */
39code > span.pp { color: #bc7a00; } /* Preprocessor */
40code > span.at { color: #7d9029; } /* Attribute */
41code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
42code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
43code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
44code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
992af0b9
V
45 </style>
46 <link rel="stylesheet" href="github-markdown.css">
5409ade2
A
47 <!--[if lt IE 9]>
48 <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
49 <![endif]-->
992af0b9
V
50</head>
51<body>
52<div id="local-sidebar">
53<ul>
54<li><a href="Home.html">Home</a></li>
fdf88d19 55<li>Setup
992af0b9 56<ul>
fdf88d19
A
57<li><a href="Download-and-Installation.html">Download and Installation</a></li>
58<li><a href="Upgrade-and-migration.html">Upgrade and migration</a></li>
992af0b9
V
59<li><a href="Server-requirements.html">Server requirements</a></li>
60<li><a href="Server-configuration.html">Server configuration</a></li>
5409ade2 61<li><a href="Server-security.html">Server security</a></li>
992af0b9 62<li><a href="Shaarli-configuration.html">Shaarli configuration</a></li>
08dcd8ea 63<li><a href="Plugins.html">Plugins</a></li>
992af0b9 64</ul></li>
5409ade2 65<li><a href="Docker.html">Docker</a></li>
992af0b9
V
66<li><a href="Usage.html">Usage</a>
67<ul>
68<li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li>
5409ade2 69<li><a href="Browsing-and-Searching.html">Browsing and Searching</a></li>
992af0b9
V
70<li><a href="Firefox-share.html">Firefox share</a></li>
71<li><a href="RSS-feeds.html">RSS feeds</a></li>
72</ul></li>
73<li>How To
74<ul>
75<li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li>
76<li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li>
5409ade2 77<li><a href="Create-and-serve-multiple-Shaarlis-(farm).html">Create and serve multiple Shaarlis (farm)</a></li>
992af0b9 78<li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li>
6335a0fc 79<li><a href="Datastore-hacks.html">Datastore hacks</a></li>
992af0b9
V
80</ul></li>
81<li><a href="Troubleshooting.html">Troubleshooting</a></li>
82<li><a href="Development.html">Development</a>
83<ul>
84<li><a href="GnuPG-signature.html">GnuPG signature</a></li>
85<li><a href="Coding-guidelines.html">Coding guidelines</a></li>
86<li><a href="Directory-structure.html">Directory structure</a></li>
87<li><a href="3rd-party-libraries.html">3rd party libraries</a></li>
88<li><a href="Plugin-System.html">Plugin System</a></li>
5409ade2 89<li><a href="Release-Shaarli.html">Release Shaarli</a></li>
992af0b9
V
90<li><a href="Security.html">Security</a></li>
91<li><a href="Static-analysis.html">Static analysis</a></li>
92<li><a href="Theming.html">Theming</a></li>
93<li><a href="Unit-tests.html">Unit tests</a></li>
94</ul></li>
95<li>About
96<ul>
97<li><a href="FAQ.html">FAQ</a></li>
98<li><a href="Community-&amp;-Related-software.html">Community &amp; Related software</a></li>
992af0b9
V
99</ul></li>
100</ul>
101</div>
102<h1 id="troubleshooting">Troubleshooting</h1>
6335a0fc
V
103<h2 id="browser">Browser</h2>
104<h3 id="redirection-issues-http-referer">Redirection issues (HTTP Referer)</h3>
105<p>Depending on its configuration and installed plugins, the browser may remove or alter (spoof) HTTP referers, thus preventing Shaarli from properly redirecting between pages.</p>
106<p>See:</p>
107<ul>
108<li><a href="https://en.wikipedia.org/wiki/HTTP_referer">HTTP referer</a> (Wikipedia)<a href=".html"></a></li>
109<li><a href="http://www.ghacks.net/2015/01/22/improve-online-privacy-by-controlling-referrer-information/">Improve online privacy by controlling referrer information</a><a href=".html"></a></li>
110<li><a href="http://b.agilob.net/better-security-privacy-and-anonymity-in-firefox/">Better security, privacy and anonymity in Firefox</a><a href=".html"></a></li>
111</ul>
112<h3 id="firefox-http-referer-options">Firefox HTTP Referer options</h3>
113<p>HTTP settings are available by browsing <code>about:config</code>, here are the available settings and their values.</p>
114<p><code>network.http.sendRefererHeader</code> - determines when to send the Referer HTTP header</p>
115<ul>
116<li>0: Never send the referring URL
117<ul>
118<li>not recommended, may break some sites</li>
119</ul></li>
120<li>1: Send only on clicked links</li>
121<li>2 (default): Send for links and images</li>
122</ul>
123<p><code>network.http.referer.XOriginPolicy</code> - Cross-domain origin policy</p>
124<ul>
125<li>0 (default): Always send</li>
126<li>1: Send if base domains match</li>
127<li>2: Send if hosts match</li>
128</ul>
129<p><code>network.http.referer.spoofSource</code> - Referer spoofing (~faking)</p>
130<ul>
131<li>false (default): real referer</li>
132<li>true: spoof referer (use target URI as referer)</li>
fdf88d19 133<li>known to break some functionality in Shaarli</li>
6335a0fc
V
134</ul>
135<p><code>network.http.referer.trimmingPolicy</code> - trim the URI not to send a full Referer</p>
136<ul>
137<li>0 (default): send full URI</li>
138<li>1: scheme+host+port+path</li>
139<li>2: scheme+host+port</li>
140</ul>
141<h3 id="firefox-localhost-and-redirections">Firefox, localhost and redirections</h3>
fdf88d19 142<p><code>localhost</code> 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, Shaarli redirections will not work properly.</p>
6335a0fc
V
143<p>To solve this, assign a local domain to your host, e.g.</p>
144<pre><code>127.0.0.1 localhost desktop localhost.lan
145::1 localhost desktop localhost.lan</code></pre>
146<p>and browse Shaarli at <a href="http://localhost.lan/" class="uri">http://localhost.lan/</a>.</p>
147<p>Related threads:</p>
148<ul>
149<li><a href="https://bbs.archlinux.org/viewtopic.php?id=156064">What is localhost.localdomain for?</a><a href=".html"></a></li>
150<li><a href="https://github.com/shaarli/Shaarli/issues/311">Stop returning to the first page after editing a bookmark from another page</a><a href=".html"></a></li>
151</ul>
992af0b9
V
152<h2 id="login">Login</h2>
153<h3 id="i-forgot-my-password">I forgot my password!</h3>
154<p>Delete the file <code>data/config.php</code> and display the page again. You will be asked for a new login/password.</p>
155<h3 id="im-locked-out---login-bruteforce-protection">I'm locked out - Login bruteforce protection</h3>
156<p>Login 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.</p>
157<p>To remove the current IP bans, delete the file <code>data/ipbans.php</code></p>
158<h3 id="list-of-all-login-attempts">List of all login attempts</h3>
5409ade2
A
159<p>The file <code>data/log.txt</code> shows all logins (successful or failed) and bans/lifted bans.<br />
160Search for <code>failed</code> in this file to look for unauthorized login attempts.</p>
992af0b9 161<h2 id="hosting-problems">Hosting problems</h2>
6335a0fc 162<h3 id="old-php-versions">Old PHP versions</h3>
992af0b9 163<ul>
f8b936e7 164<li>On <strong>free.fr</strong> : free.fr now support php 5.6.x(<a href="http://les.pages.perso.chez.free.fr/migrations/php5v6.io">link</a>)and so support now the tag autocompletion but you have to do the following : At the root of your webspace create a <code>sessions</code> directory and a <code>.htaccess</code> file containing:<a href=".html"></a></li>
992af0b9 165</ul>
5409ade2 166<div class="sourceCode"><pre class="sourceCode ini"><code class="sourceCode ini"><span class="dt">&lt;IfDefine Free&gt;</span>
f8b936e7 167<span class="dt">php56 1</span>
5409ade2 168<span class="dt">&lt;/IfDefine&gt;</span></code></pre></div>
992af0b9
V
169<ul>
170<li>If you have an error such as: <code>Parse error: syntax error, unexpected '=', expecting '(' in /links/index.php on line xxx</code>, it means that your host is using php4, not php5. Shaarli requires php 5.1. Try changing the file extension to <code>.php5</code></li>
171<li>On <strong>1and1</strong> : 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).</li>
172<li>If you have the error <code>Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /…/index.php on line xxx</code>, 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:<a href=".html"></a></li>
173</ul>
5409ade2 174<div class="sourceCode"><pre class="sourceCode php"><code class="sourceCode php"><span class="co">//list($status,$headers,$data) = getHTTP($url,4); // Short timeout to keep the application responsive.</span>
992af0b9 175<span class="co">// FIXME: Decode charset according to charset specified in either 1) HTTP response headers or 2) &lt;head&gt; in html </span>
5409ade2 176<span class="co">//if (strpos($status,&#39;200 OK&#39;)) $title=html_extract_title($data);</span></code></pre></div>
992af0b9
V
177<ul>
178<li>On hosts which forbid outgoing HTTP requests (such as free.fr), some thumbnails will not work.</li>
179<li>On <strong>lost-oasis</strong>, RSS doesn't work correctly, because of this message at the begining of the RSS/ATOM feed : <code>&lt;? // tout ce qui est charge ici (generalement des includes et require) est charge en permanence. ?&gt;</code>. To fix this, remove this message from <code>php-include/prepend.php</code></li>
180</ul>
181<h3 id="dates-are-not-properly-formatted">Dates are not properly formatted</h3>
182<p>Shaarli 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 :-( )</p>
183<h3 id="problems-on-centos-servers">Problems on CentOS servers</h3>
184<p>On <strong>CentOS</strong>/RedHat derivatives, you may need to install the <code>php-mbstring</code> package.</p>
185<h3 id="my-session-expires-i-cant-stay-logged-in">My session expires! I can't stay logged in</h3>
186<p>This can be caused by several things:</p>
187<ul>
188<li>Your php installation may not have a proper directory setup for session files. (eg. on Free.fr you need to create a <code>session</code> directory on the root of your website.) You may need to create the session directory of set it up.</li>
189<li>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 <code>sessions</code> subdirectory and add <code>ini_set('session.save_path', $_SERVER['DOCUMENT_ROOT'].'/../sessions');</code>. Make sure this directory is not browsable !)<a href=".html"></a></li>
190<li>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).</li>
191<li>Some browser addons may interfer with HTTP headers (ipfuck/ipflood/GreaseMonkey…). Try disabling those.</li>
192<li>You may be using OperaTurbo or OperaMini, which use their own proxies which may change from time to time.</li>
193<li>If you have another application on the same webserver where Shaarli is installed, these application may forcefully expire php sessions.</li>
194</ul>
195<h2 id="sessions-do-not-seem-to-work-correctly-on-your-server">Sessions do not seem to work correctly on your server</h2>
196<p>Follow the instructions in the error message. Make sure you are accessing shaarli via a direct IP address or a proper hostname. If you have <strong>no dots</strong> in the hostname (e.g. <code>localhost</code> or <code>http://my-webserver/shaarli/</code>), some browsers will not store cookies at all (this respects the <a href="http://curl.haxx.se/rfc/cookie_spec.html">HTTP cookie specification</a>).<a href=".html"></a></p>
197<h3 id="pubsubhubbub-support">pubsubhubbub support</h3>
198<p>Download <a href="https://pubsubhubbub.googlecode.com/git/publisher_clients/php/library/publisher.php">publisher.php</a> at the root of your Shaarli installation and set <code>$GLOBALS['config'['PUBSUBHUB_URL']</code> in your <code>config.php</code>]('PUBSUBHUB_URL']<code>-in-your-</code>config.php`.html)</p>
199</body>
200</html>