Solved: Validate Class Not Found from Basename in Magento 2
Are you facing Validate Class not Found from Basename error in Magento 2? If yes, then here is the complete solution for it.
User experience and checkout convenience of website plays a vital role in the success of eCommerce businesses. A poor user experience can lead to less conversions and thus can affect the overall growth of your online business.
Magento 2 provides a seamless shopping experience to the customers through its quick and convenient checkout process. However, sometimes, it may show the ‘Validate Class not Found’ error to the customers that can prevent them from completing their purchase and can affect the conversion rate.
The following error is displayed to the customers on the checkout page, whenever the they tries to place the order using email address:
1 2 |
Validate class not found from basename Magento\Framework\Validator\EmailAddress |
Solving this error becomes highly important for the Magento 2 store owners as it may worsen the user experience. Here, in this post, I have provided complete solution to prevent the Validate Class Not Found from Basename in Magento 2 error.
How to Solve Validate Class not Found from Basename in Magento 2?
In order to solve the ‘Validate Class not Found from Baseame’ in Magento 2, you need to open the Loader.php file from vendor/magento/zendframework1/library/Zend/ and update the code as f0llowing:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
public static function isReadable($filename) { if (is_readable($filename)) { // Return early if the filename is readable without needing the // include_path return true; } if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN' && preg_match('/^[a-z]:/i', $filename) ) { // If on windows, and path provided is clearly an absolute path, // return false immediately return false; } foreach (self::explodeIncludePath() as $path) { if ($path == '.') { if (self::is_readable2($filename)) { return true; } continue; } $file = $path . '/' . $filename; if (self::is_readable2($file)) { return true; } } return false; } private static function is_readable2($filename) { try { return is_readable($filename); } catch (Exception $ex) { return false; } } |
The error ‘Validate Class not Found from Baseame’ in Magento 2 appears to the customers at the time of placing an order on the checkout page which is displayed as shown below:
To get your error solved easily, you simply need to choose the most appropriate directory path for your website. You should not select the pub directory path, but need to opt for main path where app library vendor directory is available.
That’s it!
I hope you will find this solution helpful for the ‘Validate Class not Found from Basename’ error in Magento 2. Likewise solve SQLSTATE[42S22] in Magento 2 admin grid massaction, it is one of the most common errors that is displayed when a certain column is not found in the database.
In case you still have any query or doubt regarding the solution, feel free to ask in the comment section. I would be happy to help! 😊
Also, do not forget to share this solution with your Magento friends via social media.
Thanks for reading!😃
Sanjay Jethva
Sanjay is the co-founder and CTO of Meetanshi with hands-on expertise with Magento since 2011. He specializes in complex development, integrations, extensions, and customizations. Sanjay is one the top 50 contributor to the Magento community and is recognized by Adobe.
His passion for Magento 2 and Shopify solutions has made him a trusted source for businesses seeking to optimize their online stores. He loves sharing technical solutions related to Magento 2 & Shopify.
Prev
How to Add Size Chart in Magento 2
Fixed: Magento 2 Full Text Search Not Working in Admin Grid
Next