{"id":1311,"date":"2020-10-22T09:00:53","date_gmt":"2020-10-22T09:00:53","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/2020\/10\/22\/magento-1-php-fatal-error-getalloptions-on-php-7-2\/"},"modified":"2025-05-22T11:36:36","modified_gmt":"2025-05-22T06:06:36","slug":"magento-1-php-fatal-error-getalloptions-on-php-7-2","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/magento-1-php-fatal-error-getalloptions-on-php-7-2\/","title":{"rendered":"Magento 1 &#8211; PHP Fatal error: getAllOptions() on PHP 7.2"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Ever faced an error that says,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>PHP Fatal error: Declaration of Mage_Customer_Model_Customer_Attribute_Source_Website::getAllOptions() must be compatible with Mage_Eav_Model_Entity_Attribute_Source_Table::getAllOptions($withEmpty = true, $defaultValues = false) in \/app\/code\/core\/Mage\/Customer\/Model\/Customer\/Attribute\/Source\/Website.php on line 34<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It looks something like this in Magento 1 store:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2020\/10\/Magento-1-PHP-Fatal-error-getAllOptions-on-PHP7.2-1.png\" alt=\"Magento 1 - PHP Fatal error: getAllOptions() on PHP7.2\" class=\"wp-image-11047\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The above PHP error usually occurs in Magento 1 store when upgrading to PHP 7.2. When this error occurs, you may not be able to open any customers in the admin dashboard.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Also, you may not be able to export customers from the backend when this php error occurs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This post discusses the programmatic solution for this&nbsp;<em><strong>Magento 1 \u2013 PHP Fatal error: getAllOptions() on PHP7 .2.<\/strong><\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Implement the steps shown below to resolve the error.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Solution for Magento 1 \u2013 PHP Fatal error: getAllOptions() on PHP 7.2:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">app\/code\/core\/Mage\/Customer\/Model\/Resource\/Address\/Attribute\/Source\/Country.php<br>app\/code\/core\/Mage\/Customer\/Model\/Entity\/Address\/Attribute\/Source\/Country.php<br>app\/code\/core\/Mage\/Customer\/Model\/Customer\/Attribute\/Source\/Group.php<br>app\/code\/core\/Mage\/Customer\/Model\/Customer\/Attribute\/Source\/Website.php<br>app\/code\/core\/Mage\/Customer\/Model\/Customer\/Attribute\/Source\/Store.php<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Copy these files to the local folder<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So the paths will be created as follows:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">app\/code\/local\/Mage\/Customer\/Model\/Resource\/Address\/Attribute\/Source\/Country.php<br>app\/code\/local\/Mage\/Customer\/Model\/Entity\/Address\/Attribute\/Source\/Country.php<br>app\/code\/local\/Mage\/Customer\/Model\/Customer\/Attribute\/Source\/Group.php<br>app\/code\/local\/Mage\/Customer\/Model\/Customer\/Attribute\/Source\/Website.php<br>app\/code\/local\/Mage\/Customer\/Model\/Customer\/Attribute\/Source\/Store.php<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In these five files, you\u2019ll find a line that states:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public function getAllOptions()<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Change the above line to<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public function getAllOptions($withEmpty = true, $defaultValues = false)<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That\u2019s it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Also, make sure to migrate to the latest Magento 2 store in order to avail the performance and security features offered by Magento 2.4.1<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can skip the tedious task and simply opt for Meetanshi\u2019s Magento 2 Migration Service that will offer professional help in migrating your store to the latest Magento 2 version under the guidance of certified Magento developers!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Do share the post with Magento 1 developers via social media.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ever faced an error that says, PHP Fatal error: Declaration of Mage_Customer_Model_Customer_Attribute_Source_Website::getAllOptions() must be compatible with Mage_Eav_Model_Entity_Attribute_Source_Table::getAllOptions($withEmpty = true, $defaultValues = false) in \/app\/code\/core\/Mage\/Customer\/Model\/Customer\/Attribute\/Source\/Website.php on&#8230;<\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-1311","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1311","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=1311"}],"version-history":[{"count":2,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1311\/revisions"}],"predecessor-version":[{"id":14642,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1311\/revisions\/14642"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=1311"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=1311"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=1311"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}