Drupal 7 "Access Denied" after PHP update / Sessions table empty - session

I cannot login to Drupal after attempting php 5.4 update.
I have two users, the default admin from install and a user level account with limited permissions. After logging in at mysite.com/user/login I am redirected to mysite.com/user/1 with the following message displayed "You are not authorized to access this page." I get the same when I attempt mysite.com/admin
I have commented out the $base_url and $cookies_domain entries in settings.php with no luck.
If I attempt to login with bad credentials my login is denied. So credentials verification is working.
Also, I purged the SESSIONS table in the database. I have attempted login many times after the SESSIONS purge but there are no new rows being created in that table.
Somehow I am passing the credentials verification stage but then the session fails to save to the database... ergo my "not authorized" message.
I'm not the least bit familiar with what is going on in Drupal core. Normally my Drupal installs just work.
Do you think this is a Drupal issue or PHP? Have I missed some stupid setting in php.ini?
p.s. - I actually have two apache virtual hosts, one with a Drupal 6 install and another with my Drupal 7... this login issue is happening to both installs. (Probably because they share PHP ?)
I greatly appreciate any thoughts or suggestions :-)

Seems that you try several attempts there. Anyway I would suggest you the following:
Clear cache and run cron: $ drush cc all && $ drush cron
Start the: /user/logout # to stop login sessions and try to login again.
Add to your index.php:
error_reporting(E_ALL | E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
Also check the watchdog table if you can recognize anything there.
I'm on PHP 5.4.3 and not having any issues with that. If you will not find any workaround for that, PHP 5.3.10 is the minimal version required for D8 so a downgrade to it will be OK.
Did you try to make a fresh install of Drupal on your new PHP version?

Related

How to disabled Phusion Passenger for hosting on Plesk? When I refresh web app in VueJS I always have error

My server has Plesk and I have mydomain.com with frontend in Vue and backend in api.mydomain.com with laravel. Before, when I went to mydomain.com/clients and tried to refresh the page, I got an error with Phusion Passenger. I have disabled Phusion Passenger on this domain but I don't remember how I did it.
Now, I have the same problem with the same front and back system. The only difference is that both domains are subdomains, that is, I have front.domain.es and api.domain.es.
If I refresh front.domain.com it works perfectly. If I navigate from the system menu it works fine. But, if I am in front.domain.com/clients for example and I try to refresh page, I get Pushion Passenger error.
Important comment that the system work perfectly, just when you try to refresh the page has this error. On the first example that I comment, now works perfecty without Passenger, I can refresh without problem, but I don't remember how I did it.
I want to disable Phusion Passenger for this hosting on plesk or domain or whatever, I hope you can help me!
Thank you very much!!
Log File:
[ E 2023-02-02 08:44:42.0486 476333/Tf age/Cor/App/Implementation.cpp:221 ]: Could not spawn process for application /var/www/vhosts/domain.com/front.domain.com: The application process exited prematurely.
Error ID: dbcc318c
Error details saved to: /tmp/passenger-error-BX09me.html
Go in Tools&Settings >> PHP Setting
In top of the page you should find this " Select the PHP handlers you want to make available. You can install additional handlers using the Plesk Installer. "
Follow the link and will take you to Plesk Installer, there you can enable/disable modules including fusion

Magento 1.9.3.1 Upgrade Error

I have upgraded Magento to 1.9.3.1 from 1.9.1.1 from magento connect manager and after successful up-gradation I got this error:
Exception during cache and session cleaning
When I access my site I got this error:
You have been blocked from accessing this site. If you feel this is a
mistake please email abuse#securedserverspace.com
Which is I think is not a Magento error but more of a server error anyways whatever it is how do I fix it? Please help.
Case 1:
You have to consult with hosting provider.
Case 2: you have doubt regarding code then you can update via following method.
Update to Magento 1.9.3.1 - Via FTP -
1) Enable Maintenance Mode by creating a file in root magento folder called maintenance.flag
2) For admin (you) to have access to the frontpage while you perform upgrade (check everything as it should be)
Find this
$maintenanceFile = 'maintenance.flag';
Add following to line 49 and 50
$ip = $_SERVER['REMOTE_ADDR'];
$allowed = array('Your Ip Address');
Where the ip-address is your IP. Replace line 59 should be
if (file_exists($maintenanceFile)) {
With
if (file_exists($maintenanceFile) && !in_array($ip, $allowed)) {
3) Disable Compiling and also disable cache. Remember to flush cache.
4) Unpack the Magento 1.9.3.1 files on your computer and upload them to your root.
5) Refresh your webpage when the files are uploaded. You can see in Admin section that the magento
has been updated.
NB! Remember to check for upgrades for your third party modules / themes if you have this. This will only upgrade magento.
Also a good idea before uploading the files is to delete the error_log in your root folder and logs under var/log. This way you can see what errors may occur when you have done the proceeding.

Magento Admin Backend Blank Page after login

i have a serious problem in Magento Admin Backend. After login its shows a BLANK Page. i used the same files and database in different server, there it was working fine but when i have transferred files into LIVE then Admin issues came. Please help me over this as i got frustrated from last some dayz. If you need any more dertails then plz ask but i need to resolve this soon. Link: http://studywings.com/index.php/admin/
Magento ver: 1.7
flush your magento root /var/cache folder and /var/session folders, It may have previous server session that may cause problems.
Otherwise disable all third party modules and try again. I think this will help
I had the Same problem,
i have also debug the any errors occured, i tried index.php file
ini_set('display_errors', 1);
error_reporting(E_ALL);
$_SERVER['MAGE_IS_DEVELOPER_MODE'] = true;
pleced above code in index.php file. after that i have tried admin login.
showing the errors are session related, header already send errors.
i have to add the code in root/index.php file in top add the following line.
ob_start();
after that tried the login its worked.
Cheers..!
Is url changes to this after click login button or not?
http://yourdomain.com/index.php/admin/index/index/key/(key value)/
if url changes but not not show the dashboard page then go to
app/code/core/Mage/Core/Model/Session/Abstract/Varien.php
make copy of this file
Find the code for setting session cookie parameters these started on line 77
Comment out the final three lines and be sure to remove the comma after $this->getCookie()->getPath(). You should end up with this:
// set session cookie params
session_set_cookie_params(
$this->getCookie()->getLifetime(),
$this->getCookie()->getPath()
// $this->getCookie()->getDomain(),
// $this->getCookie()->isSecure(),
// $this->getCookie()->getHttponly()
also line 104 comment out :
//call_user_func_array('session_set_cookie_params', $cookieParams);
If there is no change in url after click login then try to uncomment display error and see error_log file of your server
I think this problem is due to file permissions. As you added files from one server to another, permissions might be get changed.. Try to give the permissions to all the files. Check this http://www.mage-shop.com/forum/threads/3-Magento-Admin-Backend-Blank-Page-Error
There are a number of things that can cause it, but it's most common after migrating to a new server, last time it happened to me it was an excessively low php memory_limit setting on the new server - the Admin part of the site uses a lot more resources per user than the frontend.
In general when having this issue:
Flush out your cache by emptying var/cache
Clear out sessions by emptying var/sessions
Check the magento error logs/reports for an error code in var\logs and var/reports
Turn on magento error logs in mysql if logging isn't already on! (look in core_config_data for WHERE path like 'dev/log/active'
Check if your php configuration is displaying errors
Check your apache/php error logs for more clues - memory errors will show up here for example
Try this solution
It sounds like you want to enable Developer mode. Add this to your .htaccess file:
SetEnv MAGE_IS_DEVELOPER_MODE "true"
You may also want to enable display errors in index.php:
ini_set('display_errors', 1);
The best way I have found to debug is with X-Debug in a local environment. You can also use log files to help debug in a production environment, if your unable to run X-Debug in the environment.
I've got a more detailed posting here:
http://www.molotovbliss.com/debugging-tips-and-tricks-with-magento-commerce
Consider also installing XDebug
Hope this helps you!
Just to complete the other answers....
I am upgrading a magento install, and got the same problem, in the end I had another folder inside of var/
magento/var/minifycache
Only worked after clear deleting the files inside of this folder.
I had the same problem after uninstalling an extension. I thought that clearing cache would be enough, and I did without success... later speaking with the technical team, they commented me that it did not work because I hace memcache installed, and needed to be done the cleaning via system - backend (that i coudl not see...)

Magento has a redirect loop

My Magento web site home page has a redirect loop error. When I try to open it it goes to my old server url and gives the error:
The webpage resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer.
When I try to go into admin it takes to me old server admin url without any error.
I down loaded the fresh data base and connected my store to that it works fine but when i connect it my old data base it give same error.
Please advise me.
This isn't an ideal solution, but I was having issues with Magento 1.9.x.
The setup was: Nginx Proxy & SSL Terminator => Apache Webserver
No matter what I did enabling SSL caused a redirection loop. I narrowed the issue down to Magento rather than the Nginx configurations.
It was like Magento didn't know it was receiving a secure connection from Nginx even though the correct headers were set.
The dirty solution was to add some code to the very bottom of index.php within the magento root directory (ie. /var/www/magento) just before the Mage::run... line, like so:
if( isset($_SERVER['HTTP_X_FORWARDED_PROTO']) ) {
$_SERVER['HTTPS'] = 'on';
$_SERVER['SERVER_PORT'] = 443;
}
Mage::run($mageRunCode, $mageRunType);
Wrong permissions can also cause this to happen. So in addition to truncating the var/cache and var/session folders, go ahead and make sure that you have the proper permissions on the app, skin, and includes directories, sub-directories and files. I believe the suggested permission setting is 644. You can do this with a proper FTP client such as FireZilla.
Go to table core_config_data
Update these value to be your localhost url(or whatever url you are providing while installation):
web/secure/base_url //(new url)
web/unsecure/base_url // (new url)
Empty the var folder.
I got it fixed.
I manually deleted my cache i was unable to login in my amdin and it get fixed
My issue was Cloudflare, put it in Development mode and it worked. It was cache related.
Issue: ERR_TOO_MANY_REDIRECTS - redirected you too many times
This issue is related cookie domain name.
For ex: if you already installed Magento 2 in www.example.com, and now you change magento base path to sub domain path like www.subdomain.example.com means, then you need to update your cookie domain entry inside of core_config_data table. You cannot access magento 2 backend so you can use following query to check record exist else use insert query.
SELECT * FROM `core_config_data` WHERE `path` REGEXP 'cookie_domain'
if record exit then update subdomain.example.com to the value column.
else
INSERT INTO `core_config_data` (`scope`, `scope_id`, `path`, `value`) VALUES ('default', 0, 'web/cookie/cookie_domain', 'subdomain.example.com');
Then flush cache using command php bin/magento cache:flush
Refresh magento 2 admin, now you can access admin. try this. thanks.
Note: if you are not using cookie domain, then don't configure this settings, if you configuration wrong then also you can face this error, so to fix that error update value to default configuration.
I had the same issue and after reloading and reloading my page I noticed that the error message responded to www.mydomain.tld and sometimes to mydomain.tld. I'm using Plesk on the server and I remembered that I set the Domain to always be called without www. I just changed that to none in the hosting settings of the domain. Lucky me, that solved that issue. Hope that helps someone else.

Magento Admin 404

We recently migrated our Multi-domain magento setup from a shared host to a dedicated server.
All is working fine fronted, but when I try to go to the admin section I get a 404 error on anything after login.
It seems to work if I remove index.php from the url but then as soon as I click on another link in the admin section it 404's again with the index.php back in the URL.
-- You need to go your server directly and do this via SSH/ FTP
You have to delete the following file
app/etc/use_cache.ser
If you get an error after that like
Notice: Undefined index: 0 in
/srv/www/vhosts/javra.com/htdocs/munchad2/app/code/core/Mage/Core/Model/Mysql4/Config.php
on line 92
Then go to your Database Management.
Open PhpMyAdmin
Go to your database
Click SQL
Run the following SQL Query:
_
SET FOREIGN_KEY_CHECKS=0;
UPDATE `core_store` SET store_id = 0 WHERE code='admin';
UPDATE `core_store_group` SET group_id = 0 WHERE name='Default';
UPDATE `core_website` SET website_id = 0 WHERE code='admin';
UPDATE `customer_group` SET customer_group_id = 0 WHERE customer_group_code='NOT LOGGED IN';
SET FOREIGN_KEY_CHECKS=1;
Some thing strange happens with the cache when you move the databases from one server to another so it seems like you need to clear it out.
Check in this way
> http://www.yourstore.com/index.php/admin/
or
> http://www.yourstore.com/admin/
After migration from www.domain1.com/magento/ to www.domain2.com/magento/
I was getting 500 Internal Server Error.
So I just renamed my .htaccess to htaccess.txt.
And my frontend started working fine,
But at Backend http://www.yourstore.com/admin/ I was getting Same 500 Internal Server error.
After trying many option suggested online nothing worked for me and after that I tried to access admin via following URL and voilĂ  worked perfect, Hope this help others.
Try to access as this > http://www.yourstore.com/index.php/admin/
Does the dedicated server have mod_rewerite enabled? Does the apache configuration allow .htaccess files to make changes to configuration directives via AllowOverride? Both of those are common ways that the Magento config gets pooched up.
This is an old thread but I've also had an issue with ownership what was returning a 404 in admin.
I'd been doing some work on securing the server and some files were owned as root, not apache. So a chown -R apache:apache . fixed it right up.

Resources