Admin Prestashop cannot login after migration

Unable login to Admin Prestashop after migration to another server

Try to resolve with following step by step but no success (https://stackoverflow.com/questions/11335073/prestashop-cant-login-in-admin)

  • Clear your browser cache and your cookies
  • Try using Firefox instead of Chrome (which seems have some unexpected problems)
  • Check PS_SHOP_DOMAIN and PS_SHOP_DOMAIN_SSL in ps_configuration table
  • Manually clear smarty cache : remove all files from tools/smarty/compile and tools/smarty/cache
  • Disable the IP check in classes/Cookie.php (this can causes many issues with dynamics IP) : in isLoggedBack(), remove or comment the fourth condition :
AND (!isset($this->_content['remote_addr']) OR $this->_content['remote_addr'] == ip2long(Tools::getRemoteAddr()) OR !Configuration::get('PS_COOKIE_CHECKIP'))
  • Make the expire time shorter for cookies (IE can have issues with longest time cookies) : in classes/Cookie.php constructor,
set : $this->_expire = isset($expire) ? (int)($expire) : (time() + 3600);
instead of $this->_expire = isset($expire) ? (int)($expire) : (time() + 1728000);

Another Solutions

Find last error log

#tail -f /var/log/apache2/error.log
#
.............................
[Tue Dec 26 06:46:40.753880 2017] [:error] [pid 3816] [client 100.1.10.22:43351] PHP Fatal error: Call to undefined function mcrypt_encrypt() in /var/www/html/classes/Rijndael.php on line 50
..............................

Solutions
Install php_mcrypt

On Windows

#;extension=php_mcrypt.dll to extension=php_mcrypt.dll
then restart your apache server

On Redhat

##yum install php55-mcrypt

//if php5.5

##yum install php-mcrypt

//if less than 5.4

##service httpd restart

//if apache 2.4

##/etc/init.d/httpd restart

//if apache 2.2 or less

On Ubuntu

##apt-get install php5-mcrypt
##service apache2 restart

Fix prestashop search module not working

How to fix prestashop search module not working

Search
No results found for your search “Product ABC”

Check php error from terminal console

#tail -f /var/log/apache2/error.log
..........................................................
[Sun Jun 04 05:19:28 2017] [error] [client 192.168.1.10] PHP Warning: preg_replace(): Compilation failed: disallowed Unicode code point (>= 0xd800 && <= 0xdfff) at offset 1829 in /var/www/classes/Search.php on line 84, referer: http://myprestashopweb.com/admin55/index.php?tab=AdminSearchConf&token=a20b3bdcb31d9a2bdcc064e53eb8487d&conf=4
..........................................................

Solutions;

Open and edit file Search.php (classes/Search.php)

vim /var/www/classes/Search.php

Find line 56:

'\x{a806}\x{a80b}\x{a823}-\x{a82b}\x{d800}-\x{f8ff}\x{fb1e}\x{fb29}\x{fd3e}'

Solve it by replace to;

'\x{a806}\x{a80b}\x{a823}-\x{a82b}\x{e000}-\x{f8ff}\x{fb1e}\x{fb29}\x{fd3e}'

Or only replaced;

d800 to e000

Save and restart apache

Then go to administrator -> preferences -> search
Click
-> Add missing products to index and
-> Re-build entire index.
Save

CaptchaSecurityImages.php Error function imagettfbbox Debian 7

CaptchaSecurityImages.php Error function imagettfbbox Debian 7

Php gd has been installed

Error Image security code not show

Solutions:

Open and edit CaptchaSecurityImages.php

Changed: "var $font = 'monofont.ttf';" to "var $font = './monofont.ttf';"

Save and restart apache2

Note: On CentOS server working good without any modification on code