Run the following queries
CREATE USER 'phpcode'@'localhost' IDENTIFIED BY '#####';
GRANT ALL PRIVILEGES ON * . * TO 'pramod'@'localhost';
Run the following queries
CREATE USER 'phpcode'@'localhost' IDENTIFIED BY '#####';
GRANT ALL PRIVILEGES ON * . * TO 'pramod'@'localhost';
Make sure you have the following line added in ngin configuration
upstream fastcgi_backend { server unix:/var/run/php/php7.0-fpm.sock; }
Or
upstream fastcgi_backend {
server 127.0.0.1:9000;
}
first check for current session life time
php bin/magento config:show admin/security/session_lifetime
If there is no entry issue the following query
insert into core_config_data (config_id, scope, scope_id, path, value) values (null, 'default', 0, 'admin/security/session_lifetime', 36000);
If entry is there increase the session life time. It can be done in two ways
UPDATE core_config_data SET value = 86400 WHERE path = 'admin/security/session_lifetime';
OR
Issue the following command from magento root directory
php bin/magento config:set admin/security/session_lifetime 86400
php bin/magento cache:clean
This should solve the problem
Issue the following command
sed -i '1,10539d' FILENAME
Run the following command
php bin/magento sampledata:deploy
Open the file \vendor\magento\framework\Serialize\Serializer\json.php and replace the function unserialize() with the below
public function unserialize($string) {
/* Added the following if clause to resolve the issue */
if($this->is_serialized($string)){
$string = $this->serialize($string);
}
$result = json_decode($string, true);
if (json_last_error() !== JSON_ERROR_NONE) {
throw new \InvalidArgumentException('Unable to unserialize value.');
}
return $result;
}
Also add the following function as well
function is_serialized($value, &$result = null) {
// Bit of a give away this one
if (!is_string($value))
{
return false;
}
// Serialized false, return true. unserialize() returns false on an
// invalid string or it could return false if the string is serialized
// false, eliminate that possibility.
if ($value === 'b:0;')
{
$result = false;
return true;
}
$length = strlen($value);
$end = '';
switch ($value[0])
{
case 's':
if ($value[$length - 2] !== '"')
{
return false;
}
case 'b':
case 'i':
case 'd':
// This looks odd but it is quicker than isset()ing
$end .= ';';
case 'a':
case 'O':
$end .= '}';
if ($value[1] !== ':')
{
return false;
}
switch ($value[2])
{
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
break;
default:
return false;
}
case 'N':
$end .= ';';
if ($value[$length - 1] !== $end[0])
{
return false;
}
break;
default:
return false;
}
if (($result = @unserialize($value)) === false)
{
$result = null;
return false;
}
return true;
}
open the file
vendor/magento/module-authorization/Model/Acl/AclRetriever.php and replaced the below code
if (!$role) {
throw new AuthorizationException(
__('We can\'t find the role for the user you wanted.')
);
}
$allowedResources = $this->getAllowedResourcesByRole($role->getId());
with
if (!$role) {
$allowedResources = array();
}
and revert it on sucess.
test
Magento 2 is strict about the XML configuration.
The code <remove src="css/print.css" media="print" /> in magento2-theme-performance/Magento_Theme/layout/default_head_blocks.xml Generates this error.
If you remove the ‘media’ attribute of print.css this issue is resolved.
Following are the fields you need to set 0 or 1 in core_config_data table to minify css/js files.
dev/js/minify_files - Minify Js
dev/css/minify_files - Minify css
Following are the fields you need to set 0 or 1 in core_config_data table to merge / unmergae css/js files.
dev/js/merge_files - Merge Js
update core_config_data set value=0 where path='dev/js/merge_files';
dev/css/merge_css_files - Merge css
update core_config_data set value=0 where path='dev/css/merge_css_files' limit 20;