Error when taking live Magento site locally - php

First I like to say I'm new to Magento, and have been given the task to work on the site but I'm having an issue taking the live site and installing locally for development work. Here is the errors I'm receiving when trying to install site locally.
Fatal error: Uncaught Error: Function name must be a string in
/Applications/MAMP/htdocs/site/app/code/core/Mage/Core/Model/Layout.php:556
Stack trace: #0
/Applications/MAMP/htdocs/site/app/code/core/Mage/Core/Controller/Varien/Action.php(390):
Mage_Core_Model_Layout->getOutput() #1
/Applications/MAMP/htdocs/site/app/code/core/Mage/Install/controllers/WizardController.php(120):
Mage_Core_Controller_Varien_Action->renderLayout() #2
/Applications/MAMP/htdocs/site/app/code/core/Mage/Core/Controller/Varien/Action.php(418):
Mage_Install_WizardController->beginAction() #3
/Applications/MAMP/htdocs/site/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254):
Mage_Core_Controller_Varien_Action->dispatch('begin') #4
/Applications/MAMP/htdocs/site/app/code/core/Mage/Core/Controller/Varien/Front.php(172):
Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
5 /Applications/MAMP/htdocs/site in /Applications/MAMP/htdocs/site/app/code/core/Mage/Core/Model/Layout.php
on line 556
I've followed these steps so far:
Download the magento files using any ftp client.
Export the database from live server.
Put the downloaded Magento files in your localhost root folder.
Create a blank database in my local computer and import the database backup that I exported from the live one.
Delete/Rename the file app/etc/local.xml
Change secure and unsecure URL's in 'core_config_data' table.
Any help will be appreciated as I really need to get this working.
Using Magento version 1.9.0.1 and line 556 is the
$out .= $this->getBlock($callback[0])->$callback[1]();
Here is the whole function:
public function getOutput()
{
$out = '';
if (!empty($this->_output)) {
foreach ($this->_output as $callback) {
$out .= $this->getBlock($callback[0])->$callback[1]();
}
}
return $out;
}
This is the exception log printout:
Exception: load error: failed to find /var/www/vhosts/siteuk.virtualsplash.com/httpdocs/skin/frontend/mtbelano/default/css/styles.less in /Applications/MAMP/htdocs/site/lib/Soczed/less/lessc.inc.php:2379
Stack trace:
#0 /Applications/MAMP/htdocs/site/lib/Soczed/less/lessc.inc.php(2528): lessc->__construct('/var/www/vhosts...')
#1 /Applications/MAMP/htdocs/site/app/code/community/Soczed/Less/Model/Observer.php(178): lessc::cexecute(Array, false, Array, Array)
#2 /Applications/MAMP/htdocs/site/app/code/core/Mage/Core/Model/App.php(1338): Soczed_Less_Model_Observer->beforeLayoutRender(Object(Varien_Event_Observer))
#3 /Applications/MAMP/htdocs/site/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Soczed_Less_Model_Observer), 'beforeLayoutRen...', Object(Varien_Event_Observer))
#4 /Applications/MAMP/htdocs/site/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('controller_acti...', Array)
#5 /Applications/MAMP/htdocs/site/app/code/core/Mage/Core/Controller/Varien/Action.php(384): Mage::dispatchEvent('controller_acti...')
#6 /Applications/MAMP/htdocs/site/app/code/core/Mage/Cms/Helper/Page.php(137): Mage_Core_Controller_Varien_Action->renderLayout()
#7 /Applications/MAMP/htdocs/site/app/code/core/Mage/Cms/Helper/Page.php(52): Mage_Cms_Helper_Page->_renderPage(Object(Mage_Cms_IndexController), 'new_home_page')
#8 /Applications/MAMP/htdocs/site/app/code/core/Mage/Cms/controllers/IndexController.php(45): Mage_Cms_Helper_Page->renderPage(Object(Mage_Cms_IndexController), 'new_home_page')
#9 /Applications/MAMP/htdocs/site/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Cms_IndexController->indexAction()
#10 /Applications/MAMP/htdocs/site/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index')
#11 /Applications/MAMP/htdocs/site/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#12 /Applications/MAMP/htdocs/site/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#13 /Applications/MAMP/htdocs/site/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#14 /Applications/MAMP/htdocs/site/index.php(94): Mage::run('', 'store')
#15 {main}

Change the line $out .= $this->getBlock($callback[0])->$callback[1](); with the below-mentioned code
$out .= $this->getBlock($callback[0])->{$callback[1]}();

When we configured site from one place to another place, in magento we need to do fillowing thigs.
Change secure and unsecure URL's in 'core_config_data' table.
Configured your new server detail in this file.
app\etc\local.xml
<connection>
<host><![CDATA[localhost]]></host>
<username><![CDATA[YOUR_DATABASE_USER_NAME]]></username>
<password><![CDATA[YOUR_DATABASE_USER_PASSWORD]]></password>
<dbname><![CDATA[YOUR_DATABASE_NAME]]></dbname>
</connection>

Related

Fatal error: Uncaught Error: Class "VBORemindersHelper" Vik Booking Plugin Wordpress

I am trying to use VikBooking on my localhost (XAMPP). After installing and activating the plugin, this error keeps popping up anytime I want to configure or import sample data.
Fatal error: Uncaught Error: Class "VBORemindersHelper" not found in
C:\xampp\htdocs\hotel\wp-content\plugins\vikbooking\admin\helpers\widgets\reminders.php:420
Stack trace: #0
C:\xampp\htdocs\hotel\wp-content\plugins\vikbooking\admin\helpers\admin_widgets.php(336):
VikBookingAdminWidgetReminders->preload() #1
C:\xampp\htdocs\hotel\wp-content\plugins\vikbooking\admin\layouts\sidepanel\multitasking.php(32):
VikBookingHelperAdminWidgets->getWidgetNames(true) #2
C:\xampp\htdocs\hotel\wp-content\plugins\vikbooking\libraries\adapter\layout\file.php(135):
include('C:\xampp\htdocs...') #3
C:\xampp\htdocs\hotel\wp-content\plugins\vikbooking\libraries\adapter\layout\helper.php(69):
JLayoutFile->render(Array) #4
C:\xampp\htdocs\hotel\wp-content\plugins\vikbooking\admin\helpers\helper.php(222):
JLayoutHelper::render('sidepanel.multi...', Array) #5
C:\xampp\htdocs\hotel\wp-content\plugins\vikbooking\admin\controller.php(5443):
VikBookingHelper::printHeader('1') #6
C:\xampp\htdocs\hotel\wp-content\plugins\vikbooking\libraries\adapter\mvc\controller.php(323): VikBookingController->prices() #7
C:\xampp\htdocs\hotel\wp-content\plugins\vikbooking\libraries\system\body.php(55):
JController->execute('prices') #8
C:\xampp\htdocs\hotel\wp-content\plugins\vikbooking\vikbooking.php(196):
VikBookingBody::process() #9
C:\xampp\htdocs\hotel\wp-includes\class-wp-hook.php(307):
{closure}('') #10
C:\xampp\htdocs\hotel\wp-includes\class-wp-hook.php(331):
WP_Hook->apply_filters(NULL, Array) #11
C:\xampp\htdocs\hotel\wp-includes\plugin.php(474):
WP_Hook->do_action(Array) #12
C:\xampp\htdocs\hotel\wp-settings.php(587): do_action('init') #13
C:\xampp\htdocs\hotel\wp-config.php(96):
require_once('C:\xampp\htdocs...') #14
C:\xampp\htdocs\hotel\wp-load.php(50):
require_once('C:\xampp\htdocs...') #15
C:\xampp\htdocs\hotel\wp-admin\admin.php(34):
require_once('C:\xampp\htdocs...') #16 {main} thrown in
C:\xampp\htdocs\hotel\wp-content\plugins\vikbooking\admin\helpers\widgets\reminders.php
on line 420
That used to be a conflict with Windows servers and the new spl autoload register functions introduced with the 1.5.x series of Vik Booking for WordPress. Due to an unescaped backslash (Windows directory separator is a backslash rather than a slash like on Linux/Unix servers) in a regex, the spl autoloader was unable to require the proper class file for one admin widget. Just update the plugin to its latest version and that error will disappear.
In any case, you can contact the tech VikWP team by using the official website. You will get a prompt answer.

Yii2 migration can't find database

I'm trying to migrate two table from extension created by me. I've created it on XAMPP and my migration worked fine there ( tested it few times ). Then I decided to test it on another server and what I get as an error is:
Exception 'yii\db\Exception' with message 'SQLSTATE[HY000] [1045] Access denied for user 'ivailo'#'localhost' (using password: YES)'
in Z:\extension\slide\vendor\yiisoft\yii2\db\Connection.php:624
Stack trace:
#0 Z:\extension\slide\vendor\yiisoft\yii2\db\Connection.php(996): yii\db\Connection->open()
#1 Z:\extension\slide\vendor\yiisoft\yii2\db\Connection.php(983): yii\db\Connection->getMasterPdo()
#2 Z:\extension\slide\vendor\yiisoft\yii2\db\Command.php(253): yii\db\Connection->getSlavePdo()
#3 Z:\extension\slide\vendor\yiisoft\yii2\db\Command.php(1143): yii\db\Command->prepare(true)
#4 Z:\extension\slide\vendor\yiisoft\yii2\db\Command.php(399): yii\db\Command->queryInternal('fetchAll', NULL)
#5 Z:\extension\slide\vendor\yiisoft\yii2\db\mysql\Schema.php(312): yii\db\Command->queryAll()
#6 Z:\extension\slide\vendor\yiisoft\yii2\db\mysql\Schema.php(125): yii\db\mysql\Schema->findColumns(Object(yii\db\TableSchema))
#7 Z:\extension\slide\vendor\yiisoft\yii2\db\Schema.php(744): yii\db\mysql\Schema->loadTableSchema('migration')
#8 Z:\extension\slide\vendor\yiisoft\yii2\db\Schema.php(194): yii\db\Schema->getTableMetadata('{{%migration}}', 'schema', true)
#9 Z:\extension\slide\vendor\yiisoft\yii2\console\controllers\MigrateController.php(210): yii\db\Schema->getTableSchema('{{%migration}}
', true)
#10 Z:\extension\slide\vendor\yiisoft\yii2\console\controllers\BaseMigrateController.php(875): yii\console\controllers\MigrateControlle
r->getMigrationHistory(NULL)
#11 Z:\extension\slide\vendor\yiisoft\yii2\console\controllers\BaseMigrateController.php(166): yii\console\controllers\BaseMigrateContr
oller->getNewMigrations()
#12 [internal function]: yii\console\controllers\BaseMigrateController->actionUp(0)
#13 Z:\extension\slide\vendor\yiisoft\yii2\base\InlineAction.php(57): call_user_func_array(Array, Array)
#14 Z:\extension\slide\vendor\yiisoft\yii2\base\Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#15 Z:\extension\slide\vendor\yiisoft\yii2\console\Controller.php(148): yii\base\Controller->runAction('up', Array)
#16 Z:\extension\slide\vendor\yiisoft\yii2\base\Module.php(528): yii\console\Controller->runAction('up', Array)
#17 Z:\extension\slide\vendor\yiisoft\yii2\console\Application.php(180): yii\base\Module->runAction('migrate/up', Array)
#18 Z:\extension\slide\vendor\yiisoft\yii2\console\Application.php(147): yii\console\Application->runAction('migrate/up', Array)
#19 Z:\extension\slide\vendor\yiisoft\yii2\base\Application.php(386): yii\console\Application->handleRequest(Object(yii\console\Request
))
#20 Z:\extension\slide\yii(23): yii\base\Application->run()
#21 {main}
My Yii2 is fresh installed one. Only added the extension via composer. Database configuration is correct ( user and password that we are using for years ). I've created test table and executed one line Yii::$app->db->createCommand('INSERT INTO test VALUES (1,'testname')') and that passed fine. That way I decide that the connection is ok. But with console migration php yii migrate/up --migrationPath=#vendor/********/*******/migrations it gave me the error above. Want to mention that I am not familiar with our server configurations ( All I know is OS: Ubuntu 14.04 H: Apache2 ) and system administrating at all if the problem is about that somehow. Thank you in advance!

Magento ver 1.14.2.2 exception 'Quote totals must be collected before this operation'

I've upgraded latest Magento EE version 1.14.2.2. When I proceed to checkout, last step I press button Place Order, it redirects to cart page. Here's log exception:
exception 'Exception' with message 'Quote totals must be collected before this operation.' in /home/beadahol/public_html/app/code/core/Mage/Sales/Model/Quote.php:1861
Stack trace:
#0 /home/Project/public_html/app/code/core/Mage/Sales/Model/Service/Quote.php(326): Mage_Sales_Model_Quote->prepareRecurringPaymentProfiles()
#1 /home/Project/public_html/app/code/core/Mage/Sales/Model/Service/Quote.php(223): Mage_Sales_Model_Service_Quote->_submitRecurringPaymentProfiles()
#2 /home/Project/public_html/app/code/core/Mage/Sales/Model/Service/Quote.php(238): Mage_Sales_Model_Service_Quote->submitNominalItems()
#3 /home/Project/public_html/app/code/core/Mage/Checkout/Model/Type/Onepage.php(812): Mage_Sales_Model_Service_Quote->submitAll()
#4 /home/Project/public_html/app/code/core/Mage/Checkout/controllers/OnepageController.php(583): Mage_Checkout_Model_Type_Onepage->saveOrder()
#5 /home/Project/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Checkout_OnepageController->saveOrderAction()
#6 /home/Project/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('saveOrder')
#7 /home/Project/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#8 /home/Project/public_html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#9 /home/Project/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#10 /home/Project/public_html/index.php(83): Mage::run('', 'store')
#11 {main}
I don't modify or overwrite file Quote.php. This error only occurred web server, on local still works well.
Based on research internet in this link they show ' the problem was finally solved by the switch to SuPHP (PHP handler)'. (My server configure Apache to run PHP as FastCGI)
Does anyone have a same issue on Magento 1.14.2.2? Please give me the solution to result this issue.
I faced a similar issue. What worked for me was i went to the database << table 'core_config_data' and changed the values for path 'design/email/header' and 'design/email/footer' from '2' to '0'.
Worked for me !!

Cannot find named PHP session module (memcache)

I update from Magento 1.6.2 to 1.8.1 and now I get this on my page:
Warning: session_module_name(): Cannot find named PHP session module (memcache) in /app/code/core/Mage/Core/Model/Session/Abstract/Varien.php on line 73
#0 [internal function]: mageCoreErrorHandler(2, 'session_module_...', '/var/www/vhosts...', 73, Array)
#1 /app/code/core/Mage/Core/Model/Session/Abstract/Varien.php(73): session_module_name('memcache')
#2 /app/code/core/Mage/Core/Model/Session/Abstract/Varien.php(168): Mage_Core_Model_Session_Abstract_Varien->start('adminhtml')
#3 /app/code/core/Mage/Core/Model/Session/Abstract.php(84): Mage_Core_Model_Session_Abstract_Varien->init('core', 'adminhtml')
#4 /app/code/core/Mage/Core/Model/Session.php(42): Mage_Core_Model_Session_Abstract->init('core', 'adminhtml')
#5 /app/code/core/Mage/Core/Model/Config.php(1353): Mage_Core_Model_Session->__construct(Array)
#6 /app/Mage.php(463): Mage_Core_Model_Config->getModelInstance('core/session', Array)
#7 /app/Mage.php(477): Mage::getModel('core/session', Array)
#8 /app/code/core/Mage/Core/Controller/Varien/Action.php(493): Mage::getSingleton('core/session', Array)
#9 /app/code/core/Mage/Adminhtml/Controller/Action.php(160): Mage_Core_Controller_Varien_Action->preDispatch()
#10 /app/code/core/Mage/Core/Controller/Varien/Action.php(407): Mage_Adminhtml_Controller_Action->preDispatch()
#11 /app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#12 /app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#13 /app/code/local/Mage/Core/Model/App.php(349): Mage_Core_Controller_Varien_Front->dispatch()
#14 /app/Mage.php(684): Mage_Core_Model_App->run(Array)
#15 index.php(87): Mage::run('', 'store')
#16 {main}
I have checked everything I could find on the net, but can't seem to solve this one?
I don't know what session module it is looking for? PHP? memcache?
I have been locked out for 3 days now!!!
It looks like your app/etc/local.xml file is configured to use the PHP memcache session storage handler. When Magento reads this configuration value in and tries to set the session handler with the session_module_name function it finds the version of PHP you're using doesn't have the memcache session hander installed and/or enabled.
You'll need to disable this configuration value in your app/etc/local.xml file and use the standard file/database session storage method, or you'll need to install/enable the session handler on the server you've installed Magento on.

Magento 1.5.1 checkout Method "" is not defined in ""

I'm running Magento 1.5.1 (which I am using because it is the latest version that works with Lightspeed POS) with a custom theme that I created. I am running the Lightspeed POS Connector and I have manually installed the Virtual Merchant add-on. My server is share hosted by hostmonster.
When I try to checkout I get an alert with the error Method "" is not defined in "".
Firebug gives me the following:
POST https://odd-style.com/magento/index.php/checkout/onepage/saveOrder/ 200 OK
{"success":false,"error":true,"error_messages":"Method \"\" is not defined in \"\""}
My magento exception log give me:
2012-06-06T01:20:46+00:00 ERR (3):
exception 'Mage_Core_Exception' with message 'Method "" is not defined in ""' in /home4/oddnycco/public_html/magento/app/Mage.php:550
Stack trace:
#0 /home4/oddnycco/public_html/magento/app/code/core/Mage/Core/Model/App.php(1274): Mage::throwException('Method "" is no...')
#1 /home4/oddnycco/public_html/magento/app/code/core/Mage/Core/Model/App.php(1253): Mage_Core_Model_App->_callObserverMethod(false, '', Object(Varien_Event_Observer))
#2 /home4/oddnycco/public_html/magento/app/Mage.php(416): Mage_Core_Model_App->dispatchEvent('checkout_type_o...', Array)
#3 /home4/oddnycco/public_html/magento/app/code/core/Mage/Sales/Model/Service/Quote.php(180): Mage::dispatchEvent('checkout_type_o...', Array)
#4 /home4/oddnycco/public_html/magento/app/code/core/Mage/Sales/Model/Service/Quote.php(238): Mage_Sales_Model_Service_Quote->submitOrder()
#5 /home4/oddnycco/public_html/magento/app/code/core/Mage/Checkout/Model/Type/Onepage.php(742): Mage_Sales_Model_Service_Quote->submitAll()
#6 /home4/oddnycco/public_html/magento/app/code/core/Mage/Checkout/controllers/OnepageController.php(499): Mage_Checkout_Model_Type_Onepage->saveOrder()
#7 /home4/oddnycco/public_html/magento/app/code/core/Mage/Core/Controller/Varien/Action.php(420): Mage_Checkout_OnepageController->saveOrderAction()
#8 /home4/oddnycco/public_html/magento/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(253): Mage_Core_Controller_Varien_Action->dispatch('saveOrder')
#9 /home4/oddnycco/public_html/magento/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#10 /home4/oddnycco/public_html/magento/app/code/core/Mage/Core/Model/App.php(340): Mage_Core_Controller_Varien_Front->dispatch()
#11 /home4/oddnycco/public_html/magento/app/Mage.php(627): Mage_Core_Model_App->run(Array)
#12 /home4/oddnycco/public_html/magento/index.php(80): Mage::run('', 'store')
#13 {main}
I have so far tried every type of cache clearing in the book. I've increased the size of my php memory limit to 256MB. I've looked at all the files referenced in the stack trace and all I can tell is that both $method and $object are because passed as "". I don't really understand why and I don't have any more ideas on how to fix it. :/
Thanks in advance for anyone's help!
Seems as if you have an event observer defined somewhere in your Magento installation (I suppose in one of the 3rd-party-modules).
From my point of view it looks like there is an empty method registered for the event.
Check the config.xml's of your modules for an observer that is listening on the event 'checkout_type_onepage_save_order' (you can easily grep your app/code/community and app/code/local folder for this string). Try disabling the module (via app/etc/modules/Module_Name.xml) and then try to checkout again.

Categories