Phpmyadmin doesn't work if session.save_handler set to memcache - php

Phpmyadmin doesn't work if session.save_handler set to memcache. as soon as I login I get your session has expired, please login again
php.ini
session.save_handler = memcache
session.save_path = "tcp://localhost:11211"
I tried the latest version available from
http://www.phpmyadmin.net/home_page/downloads.php

I am having the same problem here... After I enabled memcache session handling in PHP, I can't connect anymore to phpmyadmin. It's due to incompatibility between phpmyadmin own session handling mechanism and memcache.
You can disable memcache session handling by putting at the top of your phpmyadmin config.inc.php:
ini_set('session.save_path', '');
ini_set('session.save_handler', 'files');
cf. http://thinkfuturetechs.blogspot.fr/2014/06/phpmyadmin-and-memcache.html

This appears to have been a server misconfiguration issue; from the bug report on the phpMyAdmin issue tracker a reporter wrote that memcached was missing. Check that memcached is properly installed and configured. You can see the bug report at https://github.com/phpmyadmin/phpmyadmin/issues/10464

Cannot reproduce your problem with the same settings as yours. I have memcached running and the memcache extension installed. Tested with phpMyAdmin 4.0.6 and 4.1-dev.

With phpMyAdmin 4.7 and memcached it works if you add one line to libraries/common.inc
ini_set('session.save_path', '127.0.0.1:11211');
the issue at my installation was having more than one memcached server
Remember: using memcached no tcp:// using memcache use tcp:// in front of your memcached Server IP

You might have to change this lines in phpmyadmin folder 'libraries/session.inc.php':
Try include this line at the top of the file:
ini_set('session.save_path', "/tmp/");
Uncomment this line (about 74):
ini_set('session.save_handler', 'files');

Related

Failed to write session data (memcache)

I'm noticing an intermittent issue with our Memcached session handler. The error that occurs is:
Unknown: Failed to write session data (memcache). Please verify that
the current setting of session.save_path is correct.
Notes:
It seems to be an intermittent issue that occurs 5 or 6 times a day to various users.
Memcached is not localhost. i.e. It's on a different server than the web server.
I'm using the Memcache extension (as opposed to the MemcacheD extension).
I'm using the tcp prefix. If you look at this question, you'll see that the "fix" was to put tcp:// a prefix if you're using the Memcache extension.
My php.ini settings:
session.save_handler = memcache
session.save_path = "tcp://64.233.191.255:11211"
Note that I've also used:
session.save_path = "tcp://64.233.191.255:11211?persistent=1&weight=1&timeout=1&retry_interval=15"
But it doesn't seem to matter.
Checked the memcached.log file, where I found the following error:
Failed to write, and not due to blocking: Connection reset by peer.
Note: This particular error occurs at least once, at the same time (01:07AM), everyday. It will then occur sporadically throughout the day.
Maybe you're running out of filehandles? Perhaps the backups make your machine swap, resulting in slower responses, meaning more concurrent connections to the memcached process resulting in a stampeding hurd.

Not optimal PHP configuration detected on this machine

I'm trying to install PHPmyadmin in IIS 8, seem not success, because PHPmanager said "Not optimal PHP configuration detected on this machine". what does it mean? Anyone can help me to make PHPmyadmin works in IIS 8? Thank you!
Gary
I am not sure but maybe IIS and phpmyadmin are running on same port 80(default for both IIS and apache server).
Change the apache service for to something other than 80.
Look for line Listen 80 in apache configuration file and change it.
Does your IIS 8 support phpMyAdmin's requirements? Check that carefully. I had similar problem, read requirements, reconfigured sever - and et voilĂ ! Check also ports - phpMyAdmin port has to be other that IIS port.
Session support. Make sure that sessions are configured properly (see
below) and session.cookie_secure is Off if you are not using a secure
connection (i.e. "https")
Either the mysql or mysqli extensions (more details)
The mbstring extension
GD2 support in PHP to display inline thumbnails of JPEGs ("image/jpeg: inline") with their original aspect ratio
PHP 4.3.0 or newer is needed to use the "text/plain: external" MIME-based transformation
If you are using the Hardened PHP Suhosin extension make sure to increase the values for suhosin.request|get|post.max_* see also
Suhosin Configuration and Hardened-PHP request limits. You can examine
some increased suhosin.x values on the demo server -> main page ->
Show PHP information, e.g., suhosin.post.max_value_length and
suhosin.request.max_value_length = 128000 . See also FAQ 1.38. Another
such obstacle is "mod_security" on fedora boxes, error: "Method Not
Implemented. GET ..."; a possible solution:
http://forums.theplanet.com/index.php?showtopic=89327 .
If any paths are defined in your php.ini like session.save_path or upload_tmp_dir make sure that they do exist and your os is able to
write to them. Especially on a Windows system "/tmp" does not exist by
default! Due to a broken WIN PHP 5.2 installer paths are definitely
wrong in that version bugs.php.net/bug.php?id=39842. Using IIS as
webserver you also need an user named "IUSR" or "IUSR_MACHINENAME"
with r/w/modify rights granted on those folders.
Not really a requirement but a strong suggestion: if you are using the cookie authentication method, having the mcrypt PHP extension on
your web server accelerates not only the login phase but every other
action that you do in phpMyAdmin
On 64 bit systems the mcrypt PHP extension is required for auth_type "cookie". The alternative blowfish routines only work on
32-bit systems at the moment (due to a PHP 5.2.0/1 bug, should be
fixed in PHP 5.2.2 meanwhile). The same issue leads to the cryptic
"#1045 access denied for user www-data.." messages on Ubuntu boxes.
If you have weird random problems also check out whether apc or eaccelerator is the culprit. If the problem is with APC it's possible
to prevent scripts in the phpMyAdmin directory from being cached with
apc.filters. For instance you can add something like this to your
php.ini: apc.filters = "-/usr/share/phpmyadmin/.*"

Failed to write session data, php and memcached

I have recently tried implementing memcached for session saving in php.
I modified the session.save_handler in my php.ini and for the most part it works correctly. Sessions are saved in it. However, once in a while, I get this weird message for certain sessions:
PHP Warning: Unknown: Failed to write session data (memcached). Please verify that the current setting of session.save_path is correct (x.x.x.x:11211) in Unknown on line 0.
The session data is the same, way under the 1MB barrier of memcached and I have yet to see a pattern in the occurences of this message... maybe a couple of times every minute. The website is usually under medium load, 150 users concurrently.
If you are using memcache then save_path must have the tcp:// prefix.
If you are using memcached then the save_path should not have the tcp:// prefix.
The answer is Memcached objects can be maximum of 1MB (default)
if your array or object exceeds this limit, the object will be removed magically :)
All the items in your session will be removed, just saying this because right now at this moment I have experienced it my self
I solved it by starting the Memcached Session server like this
memcached -I 10m
I believe it is something to do with using the memcached extension and it not initializing before the sessions. I switched to using the memcache extension rather than the memcached extension and it works.
session.save_handler = memcache
session.save_path="tcp://192.168.1.103:11211"
I had a similar issue with symfony2 and memcached on a docker-compose stack.
The error stated:
Warning: Failed to write session data (user). Please verify that the current setting of session.save_path is correct
And the problem was that I had an outdated ./app/config/parameters.yml
Check your memchached setting to fit your needs, e.g.:
parameters:
session_memcached.host: '%session_memcached_host%'
session_memcached.port: '%session_memcached_port%'
session_memcached.prefix: '%session_memcached_prefix%'
session_memcached.expire: '%session_memcached_expire%'

phpmyadmin using mysqli connects, but my php using mysqli errors out

This is driving me nuts! I am getting the classic "Can't connect to local MySQL server through socket '/var/run/mysql4d/mysql4d.sock' (13)".
Everything I've dug up so far tells me my setup should be OK (eg, defining the sockets in php.ini and my.cnf, etc). Worse... phpmyadmin works with the same un/pw I am using in my own php. So obviously it's possible to connect, but I am screwing it up
I tried reverse-engineering the connection from phpmyadmin, but gave up it as too convoluted after a couple hours.
Can anyone offer some advice?
My configuration: Ubuntu 9.10 (Karmic), Apache 2.2, PHP 5.2.6, MySQL 4.1.22 (for legacy app reasons).
my.cnf (/var/lib/mysql4/my.cnf):
[client]
port = 3306
socket = /var/run/mysql4d/mysql4d.sock
[mysqld]
port = 3306
socket = /var/run/mysql4d/mysql4d.sock
php.ini (/etc/php5/apache2/php.ini):
[MySQL]
mysql.default_socket = /var/run/mysql4d/mysql4d.sock
[MySQLi]
mysql.default_socket = /var/run/mysql4d/mysql4d.sock
Same problem using mysql instead of mysqli, btw.
EDIT:
I should mention that I have installed mysql4 alongside the ubuntu default install of php & mysql for use with a legacy application and it is this installation that I am having trouble connecting with. I tried this:
ini_set('mysql.default_socket', '/var/run/mysql4d/mysql4d.sock');
and now the connection goes thru, but all queries return empty sets. (cries in frustration)
This sounds like a permission problem in /var/run/mysql4d/mysql4d.sock. What user are you running this as? Are the permissions o.k. on file system level?
If you Google for the error messages, you'll find a lot of people who had this and it was always a permission issue, sometimes due to an activated SELinux. Check this thread for a few possible solutions.

wamp cannot load mysqli extension

WAMP installed fine, no problems, BUT...
When going to phpMyAdmin, I get the error from phpMyAdmin as follows:
Cannot load mysqli extension. Please check your PHP configuration
Also, phpMyAdmin documentation explains this error message as follows:
To connect to a MySQL server, PHP needs a set of MySQL functions
called "MySQL extension". This extension may be part of the PHP
distribution (compiled-in), otherwise it needs to be loaded
dynamically. Its name is probably mysql.so or php_mysql.dll.
phpMyAdmin tried to load the extension but failed. Usually, the
problem is solved by installing a software package called "PHP-MySQL"
or something similar.
Finally, the apache_error.log file has the following PHP warnings (see the mySQL warning):
PHP Warning: Zend Optimizer does not support this version of PHP - please upgrade to the latest version of Zend Optimizer in Unknown on line 0
PHP Warning: Zend Platform does not support this version of PHP - please upgrade to the latest version of Zend Platform in Unknown on line 0
PHP Warning: Zend Debug Server does not support this version of PHP - please upgrade to the latest version of Zend Debug Server in Unknown on line 0
PHP Warning: gd wrapper does not support this version of PHP - please upgrade to the latest version of gd wrapper in Unknown on line 0
PHP Warning: java wrapper does not support this version of PHP - please upgrade to the latest version of java wrapper in Unknown on line 0
PHP Warning: mysql wrapper does not support this version of PHP - please upgrade to the latest version of mysql wrapper in Unknown on line 0
So, for some reason PHP is not recognizing the mysql extension.
Anyone know why? Any solution or workaround?
I deleted the PHP in program files ad everything started working , the problem that there two installations of pHp
I tried many solutions, and none worked for me. I tried the following solutions:
Restart wampserver
Reinstall wampserver
restart machine
and all other solutions mentioned in this question.
However, none of these worked. Then I found that my PHPMyAdmin was not working in chrome and was working in firefox. So I tried clearing cache, restarting browser etc, but still it would not work.
Then I deleted all the files from C:\wamp\tmp and then tried again, and it works. I am not sure why it works, but here is what I think. The session was cached and not getting cleared. So as soon as I deleted all files in this directory all the sessions were deleted and hence it worked fine.
First, make sure that the php.ini file is loading the mysqli extension.
If you are using WAMPServer, click on the icon in the system tray, go to PHP -> PHP Extensions and make sure it is checked. If not, go into the php.ini file and make sure that the line: extension=php_mysqli.dll is uncommented (eg, remove the ; if it exists). If that line does not exist, add it.
If this still does not work, double check that the right php.ini file is being loaded.
To do so, view your phpinfo() (Here for WAMPServer). Scroll down to the Loaded Configuration File row and see which php.ini is being loaded.Make sure it is the right file. If you're using WAMPServer, it should be(WAMP INSTALL FOLDER)\bin\apache\Apache2.2.11\bin\php.ini. By default, it isC:\wamp\bin\apache\Apache2.2.11\bin\php.ini`.
If a different php.ini file is being loaded, just rename it to something else so that PHP will try and find the file somewhere else. There should be a way to specify which on eyou want to use, but I forget exactly how to do that...
If this still doesn't work... Try messing around with phpMyAdmin's settings, or using another answer, but I'm afraid I can't help beyond this.
I was running WAMP with two PHP versions 1) 5.2.9 and 2) 5.2.13.
As per site requirement i needed to change PHP version to 5.2.9 from 5.2.13. after swapping PHP version, error was "mysqli extension is missing". after debugging long time i get to know it was due to wrong "extension_dir" path in php.ini file.
So i changed its value:
Old: "extension_dir" c:/wamp/bin/php/php5.2.13/ext/
New: "extension_dir" c:/wamp/bin/php/php5.2.9/ext/
Restarted All services in wamp server, then it's fixed.
I had the same problem. I had WAMP server installed. All was working fine. Then one day I restarted my computer and it just stopped working! I tried desperately going through all help posts and doing them but nothing worked.
What they usually suggest you do is, first go to your php.ini file and make sure your 'extension_dir' is properly set. Then to make sure these two lines are not commented (remove the ; infront):
extension=php_mysql.dll
extension=php_mysqli.dll
Then some suggested that I download fresh copies of these two files but none worked. I also tried uninstalling everything (php/mysql/apache) and reinstalled fresh copies of WAMP server several times but with no luck.
Finally I managed to find an alternative solution. I switched to 'easyphp' (http://www.easyphp.org/). This is something very similar to WAMP. First I made backups of my sql databases so I can reload them on the new installation.
Then I installed 'easyphp' and everything seems to work fine. I reloaded my sql databases from my backup and now things are back to normal.
I hope someone suffering from a similar prob. will find this useful. If someone has really found a fix to make WAMP server work. Pls do be kind enough to post it here so many will benefit.
in wampserver go to php.ini. open the file and uncomment extension=msql.dll by removing semicolon(;) for respective operating sytem.
Just add in your php.ini:
[PHP_MCRYPT]
extension=php_mcrypt.dll
[PHP_MYSQL]
extension=php_mysql.dll
[PHP_MYSQLI]
extension=php_mysqli.dll
Also setup the mysql password:
SET PASSWORD FOR root#localhost=PASSWORD('your_password');
And the phpmyadmin mysql password in config.inc.php:
$cfg['Servers'][$i]['password'] = 'your_password';
Had the same problem, with wamp. Try to exchange your current version of php.ini with a backup. There is one in: wamp\bin\php\php5.3.0phpForApache.txt. Worked for me.
Just wanted to chime in on this one. Using Wamp Server 2.0, and using Zend Studio with Zend debugger for development.
I wasn't able as of yet (will get back to it at some point) to get the zend debugger working with php 5.3. So in wamp I loaded an earlier php version, 5.2.11. I was getting the same error when acessing php my admin.
What I had to do was change the php.ini file value for "extension_dir" to c:/wamp/bin/php/php5.2.11/ext/ to match the version of php I was using. After that it was all good.
I had this problem and spent 2 hours trying all the solutions online, none worked.
Tried this, and it woked:
Change
mysql.default_host =
to
mysql.default_host = localhost
and restart WAMP. pay attention if you are using mysqli or not.
I had the same error. When I increased the script memory size and enabled E_ALL then restarted the server, I got that error in phpmyadmin. All I had to do to fix it was restart my computer!
I got this problem for a long time. Tried all I've read on forums and this finally worked for me:
Open your php.ini (I assume you've got the good one that is loaded...) and find this line
mysqli.default_port = 3306
change for
mysqli.default_port = 80
Restart all services
Go to localhost/phpmyadmin -> won't work
Reopen the php.ini file and retype this
mysqli.default_port = 3306
Restart all services
Worked for me.
For me worked this, after searching all logs/internet/every non-normal things.
You have to register dl by:
Through application:
WAMP -> PHP settings -> enable dl
or
# php.ini #
; Whether or not to enable the dl() function. The dl() function does NOT work
; properly in multithreaded servers, such as IIS or Zeus, and is automatically
; disabled on them.
; http://php.net/enable-dl
enable_dl = On
I have just installed WampServer, and faced same problem. I have found solution, that works for me, it is ridiculously simple.
Disable PHP extension php_mysqli.
Restart WampServer, visit local phpmyadmin.
Enable php_mysqli back.
Repeat step 2.
After few page refreshes, remaining errors plates (about MySQL and sqli) had gone.
i tried hard by
installing the wamp again and again,
by checking the php.ini file,
by restarting the machine,
by replacing the index.php file,
but none works.
then i go to the wamp/temp and deleted all files and it works fine now.
I had path variable in windows set to some random version of php.
The fix was to update it and set it to the folder within my wampserver installation:
C:\wamp64\bin\php\php5.6.38
Then I realized this is wrong also for my specific case, and I should actually be running the script from within vagrant. Live and learn.
I had this issue because of a different reason:
Check the PHP Error Log(Get from the Wamp Tray -> PHP -> PHP Error Log.
I had a syntax error in the php.ini file while I was editing the file.
Check the log and clear the error. This will open your PhpMyAdmin properly.
Check your phpForApache.ini file's extensions. This file should be same as your php.ini file.

Categories