How to force reload of configuration after modifying LocalSettings.php file in MediaWiki - mediawiki

I need to reload configuration after modifying LocalSettings.php without restarting Apache.
How is it possible?
Kind regards

If your LocalSettings.php is cached with opcache, you need to flush it. How it is done, is told here. In a nutshell:
mod_php: apachectl graceful,
php-fpm: service php-fpm reload,
CGI or FastCGI: no need.
If you have APC: this answer.

Related

Enable Tidy on openshift

I'm trying to get the Tidy module to load for my PHP app that I'm hosting on Openshift. Editing the PHP.ini seems to not be allowed as when I restart the app, the file reverts to the old content.
I've tried adding the following to my php script but it doesn't seem to work:
ini_set('tidy.clean_output', '1');
I've also added this to the .htaccess
<IfModule mod_php5.c>
php_value tidy.clean_output On
</IfModule>
Any help gratefully appreciated.
According to this page (http://php.net/manual/en/tidy.installation.php), Tidy must be installed using the "--with-tidy" option when configuring PHP, along with, on Red Hat Linux, installing both libtidy and libtidy-devel. If you create a phpinfo page (http://php.net/manual/en/function.phpinfo.php) you can see by the generated output that Tidy is not enabled. You would not be able to enable this module just by updating your php.ini.
The best option would be to visit openshift.uservoice.com and add Tidy as a feature that you would like to have enabled, then you can have other users go vote on it.
Even if you compiled your own version of PHP on your gear Tidy would not work unless those two packages were installed as listed above.

Changing Apache directives on GoDaddy shared server

The site I'm working on is hosted on GoDaddy's shared servers. I need to increase the limit on the Apache directive LimitRequestBody. I've tried adding the following to .htaccess:
LimitRequestBody 20250000
But that doesn't have any effect. I've called GoDaddy support several times, and nobody there seems to know how to help.
Any ideas?
Make sure your .htaccess file is affecting the correct directory - the one where the script you want to limit lives. To affect only that directory, put your .htaccess file in the root directory(above your script) and wrap your directive with
<Directory "/var/www/path/to/script">
LimitRequestBody 20250000
</Directory>
After you change the .htaccess file, you need to run
# service httpd reload
I hope this helps.

How to clear cached javascript files using chrome as browser and nginx as webserver

I am running localhost the following code
What happens is that my browser/server appears to cache the outdated javascript file in js folder.
I have cleared my browser cache and turn on disable cache when devtools is on.
But the app.js continues to be outdated copy.
Am I supposed to do something to the nginx server?
I finally figured out why.
I am using VirtualBox and I needed to turn off the sendfile configuration.
See this for more details:
Prevent VirtualBox Guest from Delivering Cached Files
Just make sure for the relevant conf file inside the /etc/nginx/sites-available you explicitly say
sendfile off;
try setting expires -1; in your nginx location rule for js files.

openshift : need to edit httpd.conf to enable or add directive according to my needs but it's not work

i've build my application on localhost and running it without any error. i choose openshift to host my application code but i have a problem to make it works perfectly like on my localhost.
i want to add directive of AllowEncodedSlashes and set it to On in my apache2 configuration file, i have tried to edit the file from ~/php/configuration/etc/conf/httpd.conf and then restart the server using ctl_all restart. but the result are http error code 400 (Bad Request). before i add this directive into httpd.conf the result are http error code 404, i am just not sure if the changes are in effect or not. or apache is bugging?
is there anyone knows howto make this work for me?
See if you can add it into .htaccess file instead of httpd.conf file. Also the best way to troubleshoot these problems would be by reviewing your application logs for errors. All you have to do is run "rhc tail {appName}" from your client machine (where the rhc client tools are installed). That gives you the current log entries.
To get to the entire log, you'll want to ssh onto the gear(s) on which the language framework/cartridge is installed using this FAQ and run: more ~/{cartridgeID}/logs/*.log
where {cartridgeID} is your framework cartridge like nodejs-0.6, or your embedded cartridge logs like mysql-5.1.
I created a feature request for this. See this Trello card and feel free to vote it up.

Cannot login to phpMyAdmin, no errors shown

I have MySQL set up correctly on my linux computer, however I want a better way to input data into the database besides terminal. For this reason, I downloaded phpMyAdmin. However, when I try to log in to the phpMyAdmin from index.php, it doesnt do anything. It seems to just refresh the page without doing anything. I am putting in the correct MySQL username and password. What is the issue?
Here is a screen shot of what it shows after I click "go".
This is a possible issue when the path to save php_session is not correctly set :
The directory for storing session does not exists or php do not have sufficient rights to write to it.
To define the php_session directory simply add the following line to the php.ini :
session.save_path="/tmp/php_session/"
And give write rights to the http server.
usually, the http server run as user daemon in group daemon. If it is the case, the following commands will make it :
chown -R :daemon /tmp/php_session
chmod -R g+wr /tmp/php_session
service httpd restart
Login fails if session folder in not writeable. To check that, create a PHP file in your web directory with:
<?php
$sessionPath = 'undefined';
if (!($sessionPath = ini_get('session.save_path'))) {
$sessionPath = isset($_ENV['TMP']) ? $_ENV['TMP'] : sys_get_temp_dir();
}
if (!is_writeable($sessionPath)) {
echo 'Session directory "'. $sessionPath . '"" is not writeable';
} else {
echo 'Session directory: "' . $sessionPath . '" is writeable';
}
If session folder is not writeable do either
sudo setfacl -R -m u:www-data:rwx <session directory> or chmod 777 sudo setfacl -R -m u:www-data:rwx <session directory>
-
I am late to the game, but on Amazon linux AMI I could not log in to phpmyadmin ... it just kept refreshing the login screen with no errors.
I have fixed with below command
sudo chmod -R 755 /var/lib/php/session
I fixed my issue on CentOS 7 with MariaDB and phpmyadmin I downloaded from offical phpmyadmin site by adding
session.save_path = "/var/lib/php/session"
to /etc/php.ini
and
chown -R :lighttpd /var/lib/php/session
I also restarted php-fpm and lighttpd after
In my case the solution was to set an Apache setting properly:
ProxyPassReverseCookiePath
This was required, because ProxyPass and ProxyPassReverse were in use, but cookie paths are not changed automatically.
It'd be great if PHPMyAdmin had shown something like session not found or anything, when password is sent with POST.
Do you have a .htaccess file in one of the parent directories that strips off index.php from the url by doing a 301 redirect?
301 redirects discard the form data and redirect you as if you didn't submit anything. So you get returned to the login page.
So you should create a local .htaccess file in the phpmyadmin directory with a single line RewriteEngine On. This will overwrite the previous rewrite rule to nothing.
You may need to clear the browser cache as Chrome aggressively caches 301 redirects.
In my case the hard drive was full.
Use df -h to check the space left on your hard drive, and if you want you can free some space by using the command sudo apt-get clean, which removes installation files.
I hope this will help some future users.
I ran these commands and it worked for me:
sudo service httpd restart
sudo service mysqld stop
sudo service mysqld start
Try searching the web for installation or setup guides for phpMyAdmin. Look at two or three of these and make sure you have covered all the required steps. (If you have already done so, please include which guides you have followed it in the question).
See if it helps to edit config.inc.php (acecoder mentioned this as well).
Check if this guide is of any help.
Which distro are you on? Try searching for the name of the distro you are using together with "phpMyAdmin guide" or "phpMyAdmin setup howto".
If you encounter errors along the way, post the error text here, if it's short (or paste via a pastebin-like site if it's long).
Are you sure that mysql is running? I had the same issue after doing a database import and filling up the volume containing the mysql database. After changing various permissions and clearing sessions, I tried to restart mysql (/etc/init.d/mysql restart) and it failed because the volume was full. After increasing /var and starting mysql successfully, I was able to log into phpmyadmin just fine.
If you have an error like:
Host 'host_name' is blocked because of many connection errors.
Login in your mysql as root and run the flush hosts command
1.- mysql -u root -p
2.- mysql > flush hosts
After this I was able to login again in phpmyadmin
phpMyAdmin will show errors when login fails. If it doesn't, it means that your setup has an error.
The most likely place to check is your php.ini settings. Since there doesn't seem to be an official list of phpMyAdmin-compatible settings, it's mostly trial and error.
Make sure you have enabled the stuff that needs to be enabled. Also check that you did not enable uncommon php.ini settings (like enable_post_data_reading = Off) because phpMyAdmin assumes them to be "the usual ones".
To ease debugging, start with a clean default php.ini file then tweak them line by line to see which setting is causing the error. (Don't forget that you need to restart your server after changing the php.ini file for the changes to take place.)
In my case it was due to an old Apache session.
Stop Apache, clear all pending sessions in your sessions.save_path directory (example: /var/lib/php/session) and restart Apache.
Make sure to set a 32 chars long random key in 'config.inc.php' in the $cfg['blowfish_secret'] value. That solved it for me.
Didn't realize I need to restart MariaDB after modifying config.inc.php:
service mariadb restart
Otherwise at least in my case changes didn't come affect. Also make sure your php session directory is writable by webserver (typically session.save_path = "/var/lib/php/session")