The problem I am having is that I can not log on to my newly created wiki that I made using MediaWiki. I have searched the web for an answer, and the ones I found did not help w
I found a fix, I'll put it in steps:
LocalSettings.php
session_save_path("tmp");
tmp
in the folder where you have MediaWiki installed.Be root:
su -
Then edit the php.ini
file:
nano /etc/php5/apache2/php.ini
And set those variables to /tmp:
session.save_path = "/tmp"
session.cookie_path = "/tmp"
You can also correct the permissions just in case:
chmod -R 1777 /tmp
I had to uncomment the wgCookieSecure setting in LocalSettings.php:
#$wgCookieSecure=true;
only found this after having checked that another wiki on the same computer ran just fine with similar settings. So to debug you might want to install a fresh mediawiki in a neighbour directory and check whether that gives you any trouble. Then you can go thru all the suggestions here as well as the one at https://www.mediawiki.org/wiki/Topic:Rg3w5u0e70fs8l4e
Just ran into this issue on a Win2008 R2 server running IIS, when creating a user gave this (red) msg:
Account creation error The user account was not created, as we could not confirm its source. Ensure you have cookies enabled, reload this page and try again.
Also if a user tried to log into the Wiki, they would get this (red) msg:
Login error (WikiName) uses cookies to log in users. You have cookies disabled. Please enable them and try again.
Failed attempts:
localsettings.php
file (despite stopping the server).What finally did work was to use IIS's PHP manager to change the
MediaWiki's PHP settings; session.use_cookies
from 0 to 1
This solved the problem without any reboot.
The easiest solution, also recommended by Aaron Schulz, is generally to set
$wgSessionsInObjectCache = true;
$wgMainCacheType = CACHE_ANYTHING;
in your LocalSettings.php
. In recent PHP you'll have OPcache enabled by default; if no accelerator is available, at worst this configuration will use the database.
See also cache documentation.
I'm adding a new answer because my setup was slightly different, and the steps I took were similar but not identical to everyone else's.
I installed MediaWiki on CentOS with NGINX. After running it successfully for a few months, I started to get the same cookie error out of nowhere.
The issue I had was that the php-fpm user lacked access to the session.save_path
folder. I don't know why it happened, but here's now I fixed it.
I ran a variation of SprintCycle's command to identify where the sessions were stored:
php-fpm -i|grep --color save_path
In my case, it was /var/lib/php/session
.
Then I changed directories and set permissions:
cd /var/lib/php
chmod -R 1777 session
I restarted the services, and everything worked again.
service nginx restart
service php-fpm restart