Password must include both numeric and alphabetic characters - Magento

By: Emiley J  

While installing a fresh Magento installation, some users are stuck at the 'Create Admin Account' step, with this error: 'Password must include both numeric and alphabetic characters.'. Follow this simple step to resolve this issue.

The reason for this error is in the following code in the file app/code/core/Mage/Admin/Model/User.php

if (!preg_match(’/[a-z]/iu’, $this->getNewPassword()) 
|| !preg_match(’/[0-9]/u’, $this->getNewPassword()) 
) { 
$errors[] = Mage::helper(’adminhtml’)->__(’Password must include both numeric and alphabetic characters.’); 
}

The preg_match() function is the culprit. It fails because the PCRE extenion in perl is not installed properly. This can be easily resolved by running the following command in your linux

yum install pcre
#if yum doesn't work use apt-get (depends on your linux variant)



Archived Comments

1. Michaelkex
View Tutorial          By: Michaelkex at 2017-03-22 02:57:55

2. Thanks it worked. Just remember to restart apache after you install pcre.
View Tutorial          By: Raj at 2014-02-08 08:42:26


Most Viewed Articles (in PHP )

A Basic Example using PHP in AWS (Amazon Web Services)

Reading and Writing .gz files in PHP

PHP Warning: Unknown(): Unable to load dynamic library '/usr/local/php4/lib/php/extensions/no-debug ......

PHP ./configure RESULTING IN [email protected]_2_2_3_... AND UNRESOLVED REFERENCES WITH ORACLE OCI8

Where does the PHP run?

PHP 5.1.4 INSTALLATION on Solaris 9 (Sparc)

Building PHP 5.x with Apache2 on SuSE Professional 9.1/9.2

Installing PHP 5.x with Apache 2.x on HP UX 11i and configuring PHP 5.x with Oracle 9i

Cannot load /usr/local/apache/libexec/libphp4.so into server: ld.so.1:......

Setting up PHP in Windows 2003 Server IIS7, and WinXP 64

error: "Service Unavailable" after installing PHP to a Windows XP x64 Pro

Function to force strict boolean values in PHP

Function to convert strings to strict booleans in PHP

Function to sort array by elements and count of element in PHP

Malware: global $ob_starting;

Latest Articles (in PHP)

Comment on this tutorial