How do I configure Laravel for Elastic Beanstalk? - laravel

I've got the instance going and everything but my config doesn't work and I don't what to try to make it work.
All I get are 503 errors and no explanation.
Production mode config
return array(
'url' => 'http://patientdueling.com',
'asset_url' => '',
'profiler' => false,
'ssl' => false,
);

When I switched from a dedicated server I could control to Elastic Beanstalk server and RDS with AWS for some reason my environment of production vs development was no longer being detected.
I copied my production config into laravel's default config and it worked!
My error:
exception 'ErrorException' with message 'PDO::__construct(): [2002] No such file or directory (trying to connect via unix:///var/lib/mysql/mysql.sock)' in /var/www/html/laravel/database/connectors/mysql.php:33
Stack trace:
#0 /var/www/html/laravel/laravel.php(42): Laravel\Error::native(2, 'PDO::__construc...', '/var/www/html/l...', 33)
#1 [internal function]: Laravel\{closure}(2, 'PDO::__construc...', '/var/www/html/l...', 33, Array)
#2 /var/www/html/laravel/database/connectors/mysql.php(33): PDO->__construct('mysql:host=loca...', 'root', 'root', Array)
#3 /var/www/html/laravel/database.php(66): Laravel\Database\Connectors\MySQL->connect(Array)
#4 /var/www/html/laravel/database.php(52): Laravel\Database::connect(Array)
#5 /var/www/html/laravel/database/eloquent/query.php(255): Laravel\Database::connection(NULL)
#6 /var/www/html/laravel/database/eloquent/query.php(245): Laravel\Database\Eloquent\Query->connection()
#7 /var/www/html/laravel/database/eloquent/query.php(50): Laravel\Database\Eloquent\Query->table()
#8 /var/www/html/laravel/database/eloquent/model.php(473): Laravel\Database\Eloquent\Query->__construct(Object(System))
#9 /var/www/html/laravel/database/eloquent/model.php(789): Laravel\Database\Eloquent\Model->query()
#10 [internal function]: Laravel\Database\Eloquent\Model->__call('where_real_syst...', Array)
#11 [internal function]: System->where_real_system_id(0)
#12 /var/www/html/laravel/database/eloquent/model.php(804): call_user_func_array(Array, Array)
#13 /var/www/html/application/controllers/system.php(86): Laravel\Database\Eloquent\Model::__callStatic('where_real_syst...', Array)
#14 /var/www/html/application/controllers/system.php(86): System::where_real_system_id(0)
#15 [internal function]: System_Controller->get_list()
#16 /var/www/html/laravel/routing/controller.php(325): call_user_func_array(Array, Array)
#17 /var/www/html/laravel/routing/controller.php(285): Laravel\Routing\Controller->response('list', Array)
#18 /var/www/html/laravel/routing/controller.php(165): Laravel\Routing\Controller->execute('list', Array)
#19 /var/www/html/laravel/routing/route.php(153): Laravel\Routing\Controller::call('system#list', Array)
#20 /var/www/html/laravel/routing/route.php(124): Laravel\Routing\Route->response()
#21 /var/www/html/laravel/laravel.php(167): Laravel\Routing\Route->call()
#22 /var/www/html/public/index.php(34): require('/var/www/html/l...')
#23 {main}

Related

Laravel Multi-Tenancy - Installation Error

I am trying to pull spatie/laravel-multitenancy into my Laravel application
Installing on Laravel 7 running PHP 7.4
php artisan --version
# Laravel Framework 7.30.4
php -v
# PHP 7.4.13 (cli)
The installation
composer update
composer require "spatie/laravel-multitenancy:^1.0"
Throws up this error at the end
In QueueManager.php line 156:
Trying to access array offset on value of type null
Error Log
[2021-09-01 11:54:41] production.ERROR: Trying to access array offset on value of type null {"exception":"[object] (ErrorException(code: 0): Trying to access array offset on value of type null at D:\\application\\vendor\\laravel\\framework\\src\\Illuminate\\Queue\\QueueManager.php:156)
[stacktrace]
#0 D:\\application\\vendor\\laravel\\framework\\src\\Illuminate\\Queue\\QueueManager.php(156): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError(8, 'Trying to acces...', 'D:\\application...', 156, Array)
#1 D:\\application\\vendor\\laravel\\framework\\src\\Illuminate\\Queue\\QueueManager.php(138): Illuminate\\Queue\\QueueManager->resolve('file')
#2 D:\\application\\vendor\\laravel\\framework\\src\\Illuminate\\Queue\\QueueManager.php(258): Illuminate\\Queue\\QueueManager->connection()
#3 D:\\application\\vendor\\spatie\\laravel-multitenancy\\src\\Actions\\MakeQueueTenantAwareAction.php(34): Illuminate\\Queue\\QueueManager->__call('createPayloadUs...', Array)
#4 D:\\application\\vendor\\spatie\\laravel-multitenancy\\src\\Actions\\MakeQueueTenantAwareAction.php(18): Spatie\\Multitenancy\\Actions\\MakeQueueTenantAwareAction->listenForJobsBeingQueued()
#5 D:\\application\\vendor\\spatie\\laravel-multitenancy\\src\\MultitenancyServiceProvider.php(72): Spatie\\Multitenancy\\Actions\\MakeQueueTenantAwareAction->execute()
#6 D:\\application\\vendor\\spatie\\laravel-multitenancy\\src\\MultitenancyServiceProvider.php(33): Spatie\\Multitenancy\\MultitenancyServiceProvider->configureQueue()
#7 [internal function]: Spatie\\Multitenancy\\MultitenancyServiceProvider->boot()
#8 D:\\application\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\BoundMethod.php(37): call_user_func_array(Array, Array)
#9 D:\\application\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Util.php(37): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#10 D:\\application\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\BoundMethod.php(95): Illuminate\\Container\\Util::unwrapIfClosure(Object(Closure))
#11 D:\\application\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\BoundMethod.php(39): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(Illuminate\\Foundation\\Application), Array, Object(Closure))
#12 D:\\application\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php(596): Illuminate\\Container\\BoundMethod::call(Object(Illuminate\\Foundation\\Application), Array, Array, NULL)
#13 D:\\application\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Application.php(867): Illuminate\\Container\\Container->call(Array)
#14 D:\\application\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Application.php(850): Illuminate\\Foundation\\Application->bootProvider(Object(Spatie\\Multitenancy\\MultitenancyServiceProvider))
#15 [internal function]: Illuminate\\Foundation\\Application->Illuminate\\Foundation\\{closure}(Object(Spatie\\Multitenancy\\MultitenancyServiceProvider), 23)
#16 D:\\application\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Application.php(851): array_walk(Array, Object(Closure))
#17 D:\\application\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Bootstrap\\BootProviders.php(17): Illuminate\\Foundation\\Application->boot()
#18 D:\\application\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Application.php(230): Illuminate\\Foundation\\Bootstrap\\BootProviders->bootstrap(Object(Illuminate\\Foundation\\Application))
#19 D:\\application\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Console\\Kernel.php(310): Illuminate\\Foundation\\Application->bootstrapWith(Array)
#20 D:\\application\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Console\\Kernel.php(127): Illuminate\\Foundation\\Console\\Kernel->bootstrap()
#21 D:\\application\\artisan(37): Illuminate\\Foundation\\Console\\Kernel->handle(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#22 {main}
"}
Any ideas why this is happening?

magento checkout page error with exception log

the magento checkout page give an error saying
There was an error processing your order
I am getting this error. It was working fine from six months. I haven't changed anything.
Troubleshoot:
I have changed to Magento default theme.
I have changed the domain
Change checkout method
Still not working.
my exception.log
2017-04-17T17:28:18+00:00 ERR (3):
exception 'Mage_Core_Exception' with message 'Invalid block type: Cmsmart_Onestepcheckout_Block_Links' in /home/zprz/public_html/app/Mage.php:595
Stack trace:
#0 /home/zprz/public_html/app/code/core/Mage/Core/Model/Layout.php(495): Mage::throwException('Invalid block t...')
#1 /home/zprz/public_html/app/code/core/Mage/Core/Model/Layout.php(437): Mage_Core_Model_Layout->_getBlockInstance('onestepcheckout...', Array)
#2 /home/zprz/public_html/app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('onestepcheckout...', 'checkout_cart_l...')
#3 /home/zprz/public_html/app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('onestepcheckout...', 'checkout_cart_l...')
#4 /home/zprz/public_html/app/code/core/Mage/Core/Model/Layout.php(205): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
#5 /home/zprz/public_html/app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#6 /home/zprz/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()
#7 /home/zprz/public_html/app/code/core/Mage/Cms/Helper/Page.php(113): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#8 /home/zprz/public_html/app/code/core/Mage/Cms/Helper/Page.php(52): Mage_Cms_Helper_Page->_renderPage(Object(Mage_Cms_IndexController), 'no-route')
#9 /home/zprz/public_html/app/code/core/Mage/Cms/controllers/IndexController.php(75): Mage_Cms_Helper_Page->renderPage(Object(Mage_Cms_IndexController), 'no-route')
#10 /home/zprz/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Cms_IndexController->noRouteAction()
#11 /home/zprz/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('noRoute')
#12 /home/zprz/public_html/app/code/local/Elegento/Royal/Controller/Standard.php(82): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#13 /home/zprz/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Elegento_Royal_Controller_Standard->match(Object(Mage_Core_Controller_Request_Http))
#14 /home/zprz/public_html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#15 /home/zprz/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#16 /home/zprz/public_html/index.php(83): Mage::run('', 'store')
#17 {main}
2017-04-17T17:28:18+00:00 ERR (3):
exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`zprz_mag`.`erp_inventory_warehouse_product`, CONSTRAINT `erp_inventory_warehouse_product_ibfk_1` FOREIGN KEY (`warehouse_id`) REFERENCES `erp_inventory_warehouse` (`warehouse_id`) ON DELETE C)' in /home/zprz/public_html/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /home/zprz/public_html/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /home/zprz/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 /home/zprz/public_html/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /home/zprz/public_html/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#4 /home/zprz/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `er...', Array)
#5 /home/zprz/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `er...', Array)
#6 /home/zprz/public_html/lib/Zend/Db/Adapter/Abstract.php(576): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `er...', Array)
#7 /home/zprz/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(453): Zend_Db_Adapter_Abstract->insert('erp_inventory_w...', Array)
#8 /home/zprz/public_html/app/code/core/Mage/Core/Model/Abstract.php(318): Mage_Core_Model_Resource_Db_Abstract->save(Object(Magestore_Inventory_Model_Warehouseproduct))
#9 /home/zprz/public_html/app/code/local/Magestore/Inventory/Model/Observer.php(1405): Mage_Core_Model_Abstract->save()
#10 /home/zprz/public_html/app/code/core/Mage/Core/Model/App.php(1357): Magestore_Inventory_Model_Observer->salesOrderPlaceAfter(Object(Varien_Event_Observer))
#11 /home/zprz/public_html/app/code/core/Mage/Core/Model/App.php(1336): Mage_Core_Model_App->_callObserverMethod(Object(Magestore_Inventory_Model_Observer), 'salesOrderPlace...', Object(Varien_Event_Observer))
#12 /home/zprz/public_html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('sales_order_pla...', Array)
#13 /home/zprz/public_html/app/code/core/Mage/Sales/Model/Order.php(1117): Mage::dispatchEvent('sales_order_pla...', Array)
#14 [internal function]: Mage_Sales_Model_Order->place()
#15 /home/zprz/public_html/app/code/core/Mage/Core/Model/Resource/Transaction.php(105): call_user_func(Array)
#16 /home/zprz/public_html/app/code/core/Mage/Core/Model/Resource/Transaction.php(159): Mage_Core_Model_Resource_Transaction->_runCallbacks()
#17 /home/zprz/public_html/app/code/core/Mage/Sales/Model/Service/Quote.php(189): Mage_Core_Model_Resource_Transaction->save()
#18 /home/zprz/public_html/app/code/core/Mage/Sales/Model/Service/Quote.php(249): Mage_Sales_Model_Service_Quote->submitOrder()
#19 /home/zprz/public_html/app/code/core/Mage/Checkout/Model/Type/Onepage.php(812): Mage_Sales_Model_Service_Quote->submitAll()
#20 /home/zprz/public_html/app/code/core/Mage/Checkout/controllers/OnepageController.php(579): Mage_Checkout_Model_Type_Onepage->saveOrder()
#21 /home/zprz/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Checkout_OnepageController->saveOrderAction()
#22 /home/zprz/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('saveOrder')
#23 /home/zprz/public_html/app/code/local/Elegento/Royal/Controller/Standard.php(82): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#24 /home/zprz/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Elegento_Royal_Controller_Standard->match(Object(Mage_Core_Controller_Request_Http))
#25 /home/zprz/public_html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#26 /home/zprz/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#27 /home/zprz/public_html/index.php(83): Mage::run('', 'store')
#28 {main}
You have problem with the warehouse plugin (most probably magestore inventory). During the insert in the database there is something wrong that happens. Not knowing so much about the module or the environment, I just can tell you that the request tries to create or update a dependent table but does not succeed. The reasons are multiple but most probably the row alread exists.

Customer emails not sending any more in Magento 1.9.3.2 via cronjob

Magento customer e-mails are not sending any more after update. It shows following message in the cron_schedule table. Our hoster is mittwald and they use a special cron.sh which not uses "ps".
exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE (message_id='33')' at line 1' in /html/update_1.9.3/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /html/update_1.9.3/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /html/update_1.9.3/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 /html/update_1.9.3/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /html/update_1.9.3/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#4 /html/update_1.9.3/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('UPDATE `v1_core...', Array)
#5 /html/update_1.9.3/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('UPDATE `v1_core...', Array)
#6 /html/update_1.9.3/lib/Zend/Db/Adapter/Abstract.php(635): Varien_Db_Adapter_Pdo_Mysql->query('UPDATE `v1_core...', Array)
#7 /html/update_1.9.3/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(433): Zend_Db_Adapter_Abstract->update('v1_core_email_q...', Array, 'message_id='33'')
#8 /html/update_1.9.3/app/code/core/Mage/Core/Model/Abstract.php(318): Mage_Core_Model_Resource_Db_Abstract->save(Object(Mage_Core_Model_Email_Queue))
#9 /html/update_1.9.3/app/code/core/Mage/Core/Model/Email/Queue.php(246): Mage_Core_Model_Abstract->save()
#10 [internal function]: Mage_Core_Model_Email_Queue->send(Object(Mage_Cron_Model_Schedule))
#11 /html/update_1.9.3/app/code/core/Mage/Cron/Model/Observer.php(326): call_user_func_array(Array, Array)
#12 /html/update_1.9.3/app/code/core/Mage/Cron/Model/Observer.php(72): Mage_Cron_Model_Observer->_processJob(Object(Mage_Cron_Model_Schedule), Object(Mage_Core_Model_Config_Element))
#13 /html/update_1.9.3/app/code/core/Mage/Core/Model/App.php(1358): Mage_Cron_Model_Observer->dispatch(Object(Varien_Event_Observer))
#14 /html/update_1.9.3/app/code/core/Mage/Core/Model/App.php(1337): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Cron_Model_Observer), 'dispatch', Object(Varien_Event_Observer))
#15 /html/update_1.9.3/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('default', Array)
#16 /html/update_1.9.3/cron.php(78): Mage::dispatchEvent('default')
#17 {main}
Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE (message_id='33')' at line 1, query was: UPDATE `v1_core_email_queue` SET WHERE (message_id='33')' in /html/update_1.9.3/lib/Zend/Db/Statement/Pdo.php:235
Stack trace:
#0 /html/update_1.9.3/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /html/update_1.9.3/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /html/update_1.9.3/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 /html/update_1.9.3/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('UPDATE `v1_core...', Array)
#4 /html/update_1.9.3/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('UPDATE `v1_core...', Array)
#5 /html/update_1.9.3/lib/Zend/Db/Adapter/Abstract.php(635): Varien_Db_Adapter_Pdo_Mysql->query('UPDATE `v1_core...', Array)
#6 /html/update_1.9.3/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(433): Zend_Db_Adapter_Abstract->update('v1_core_email_q...', Array, 'message_id='33'')
#7 /html/update_1.9.3/app/code/core/Mage/Core/Model/Abstract.php(318): Mage_Core_Model_Resource_Db_Abstract->save(Object(Mage_Core_Model_Email_Queue))
#8 /html/update_1.9.3/app/code/core/Mage/Core/Model/Email/Queue.php(246): Mage_Core_Model_Abstract->save()
#9 [internal function]: Mage_Core_Model_Email_Queue->send(Object(Mage_Cron_Model_Schedule))
#10 /html/update_1.9.3/app/code/core/Mage/Cron/Model/Observer.php(326): call_user_func_array(Array, Array)
#11 /html/update_1.9.3/app/code/core/Mage/Cron/Model/Observer.php(72): Mage_Cron_Model_Observer->_processJob(Object(Mage_Cron_Model_Schedule), Object(Mage_Core_Model_Config_Element))
#12 /html/update_1.9.3/app/code/core/Mage/Core/Model/App.php(1358): Mage_Cron_Model_Observer->dispatch(Object(Varien_Event_Observer))
#13 /html/update_1.9.3/app/code/core/Mage/Core/Model/App.php(1337): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Cron_Model_Observer), 'dispatch', Object(Varien_Event_Observer))
#14 /html/update_1.9.3/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('default', Array)
#15 /html/update_1.9.3/cron.php(78): Mage::dispatchEvent('default')
#16 {main}
There was an error in v1_core_email_queue WHERE (message_id='33').
The order with the id 33 was already deleted. The solution was just to delete the entry with the id 33.

Magento Error: SQLSTATE[HY000] [1045] Access denied for user 'bn_magento'#'localhost'

a:4:{i:0;s:92:
"SQLSTATE[HY000] [1045] Access denied for user 'bn_magento'#'localhost' (using password: YES)";i:1;s:5974:"
#0 C:\xampp\apps\magento\htdocs\vendor\magento\zendframework1\library\Zend\Db\Adapter\Pdo\Mysql.php(111): Zend_Db_Adapter_Pdo_Abstract->_connect()
#1 C:\xampp\apps\magento\htdocs\lib\internal\Magento\Framework\DB\Adapter\Pdo\Mysql.php(328): Zend_Db_Adapter_Pdo_Mysql->_connect()
#2 C:\xampp\apps\magento\htdocs\vendor\magento\zendframework1\library\Zend\Db\Adapter\Abstract.php(460): Magento\Framework\DB\Adapter\Pdo\Mysql->_connect()
#3 C:\xampp\apps\magento\htdocs\vendor\magento\zendframework1\library\Zend\Db\Adapter\Pdo\Abstract.php(238): Zend_Db_Adapter_Abstract->query('SET NAMES utf8;', Array)
#4 C:\xampp\apps\magento\htdocs\lib\internal\Magento\Framework\DB\Adapter\Pdo\Mysql.php(433): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8;', Array)
#5 C:\xampp\apps\magento\htdocs\lib\internal\Magento\Framework\DB\Adapter\Pdo\Mysql.php(488): Magento\Framework\DB\Adapter\Pdo\Mysql->_query('SET NAMES utf8;', Array)
#6 C:\xampp\apps\magento\htdocs\lib\internal\Magento\Framework\Model\Resource\Type\Db\Pdo\Mysql.php(63): Magento\Framework\DB\Adapter\Pdo\Mysql->query('SET NAMES utf8;')
#7 C:\xampp\apps\magento\htdocs\lib\internal\Magento\Framework\Model\Resource\Type\Db\ConnectionFactory.php(43): Magento\Framework\Model\Resource\Type\Db\Pdo\Mysql->getConnection(Object(Magento\Framework\DB\Logger\Null))
#8 C:\xampp\apps\magento\htdocs\lib\internal\Magento\Framework\App\Resource\ConnectionFactory.php(24): Magento\Framework\Model\Resource\Type\Db\ConnectionFactory->create(Array)
#9 C:\xampp\apps\magento\htdocs\lib\internal\Magento\Framework\App\Resource.php(113): Magento\Framework\App\Resource\ConnectionFactory->create(Array)
#10 C:\xampp\apps\magento\htdocs\lib\internal\Magento\Framework\App\Resource.php(93): Magento\Framework\App\Resource->getConnectionByName('default')
#11 C:\xampp\apps\magento\htdocs\lib\internal\Magento\Framework\Model\Resource\Db\AbstractDb.php(305): Magento\Framework\App\Resource->getConnection('core_write')
#12 C:\xampp\apps\magento\htdocs\lib\internal\Magento\Framework\Model\Resource\Db\AbstractDb.php(335): Magento\Framework\Model\Resource\Db\AbstractDb->_getConnection('write')
#13 C:\xampp\apps\magento\htdocs\lib\internal\Magento\Framework\Model\Resource\Db\AbstractDb.php(320): Magento\Framework\Model\Resource\Db\AbstractDb->_getWriteAdapter()
#14 C:\xampp\apps\magento\htdocs\lib\internal\Magento\Framework\Model\Resource\Db\AbstractDb.php(345): Magento\Framework\Model\Resource\Db\AbstractDb->_getReadAdapter()
#15 C:\xampp\apps\magento\htdocs\var\generation\Magento\Store\Model\Resource\Website\Interceptor.php(89): Magento\Framework\Model\Resource\Db\AbstractDb->getReadConnection()
#16 C:\xampp\apps\magento\htdocs\lib\internal\Magento\Framework\Model\Resource\Db\Collection\AbstractCollection.php(123): Magento\Store\Model\Resource\Website\Interceptor->getReadConnection()
#17 C:\xampp\apps\magento\htdocs\lib\internal\Magento\Framework\ObjectManager\Factory\AbstractFactory.php(107): Magento\Framework\Model\Resource\Db\Collection\AbstractCollection->__construct(Object(Magento\Framework\Data\Collection\EntityFactory), Object(Magento\Framework\Logger\Monolog), Object(Magento\Framework\Data\Collection\Db\FetchStrategy\Cache), Object(Magento\Framework\Event\Manager\Proxy), NULL, NULL)
#18 C:\xampp\apps\magento\htdocs\lib\internal\Magento\Framework\ObjectManager\Factory\Dynamic\Developer.php(91): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Store\\M...', Array)
#19 C:\xampp\apps\magento\htdocs\lib\internal\Magento\Framework\ObjectManager\ObjectManager.php(57): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Store\\M...', Array)
#20 C:\xampp\apps\magento\htdocs\var\generation\Magento\Store\Model\Resource\Website\CollectionFactory.php(43): Magento\Framework\ObjectManager\ObjectManager->create('\\Magento\\Store\\...', Array)
#21 C:\xampp\apps\magento\htdocs\app\code\Magento\Store\Model\Storage\Db.php(198): Magento\Store\Model\Resource\Website\CollectionFactory->create()
#22 C:\xampp\apps\magento\htdocs\app\code\Magento\Store\Model\Storage\Db.php(468): Magento\Store\Model\Storage\Db->_initStores()
#23 C:\xampp\apps\magento\htdocs\app\code\Magento\Store\Model\StorageFactory.php(142): Magento\Store\Model\Storage\Db->reinitStores()
#24 C:\xampp\apps\magento\htdocs\app\code\Magento\Store\Model\StorageFactory.php(117): Magento\Store\Model\StorageFactory->_reinitStores(Object(Magento\Store\Model\Storage\Db), Array)
#25 C:\xampp\apps\magento\htdocs\app\code\Magento\Store\Model\StoreManager.php(121): Magento\Store\Model\StorageFactory->get(Array)
#26 C:\xampp\apps\magento\htdocs\app\code\Magento\Store\Model\StoreManager.php(187): Magento\Store\Model\StoreManager->_getStorage()
#27 C:\xampp\apps\magento\htdocs\app\code\Magento\Store\App\Request\PathInfoProcessor.php(35): Magento\Store\Model\StoreManager->getStores(false, true)
#28 C:\xampp\apps\magento\htdocs\var\generation\Magento\Store\App\Request\PathInfoProcessor\Proxy.php(95): Magento\Store\App\Request\PathInfoProcessor->process(Object(Magento\Framework\App\Request\Http), '/')
#29 C:\xampp\apps\magento\htdocs\lib\internal\Magento\Framework\App\Request\Http.php(146): Magento\Store\App\Request\PathInfoProcessor\Proxy->process(Object(Magento\Framework\App\Request\Http), '/')
#30 C:\xampp\apps\magento\htdocs\lib\internal\Magento\Framework\HTTP\PhpEnvironment\Request.php(185): Magento\Framework\App\Request\Http->setPathInfo()
#31 C:\xampp\apps\magento\htdocs\lib\internal\Magento\Framework\App\Request\Http.php(189): Magento\Framework\HTTP\PhpEnvironment\Request->getPathInfo()
#32 C:\xampp\apps\magento\htdocs\lib\internal\Magento\Framework\App\Http.php(110): Magento\Framework\App\Request\Http->getFrontName()
#33 C:\xampp\apps\magento\htdocs\lib\internal\Magento\Framework\App\Bootstrap.php(257): Magento\Framework\App\Http->launch()
#34 C:\xampp\apps\magento\htdocs\index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#35 {main}
";s:3:"url";s:9:"/magento/";s:11:"script_name";s:18:"/magento/index.php";}
I realized that this error occurred due to the change of the password in cPanel.
So I edited the local.xml file, changed the password to the correct one, and everything was back to normal.
Thanks to everyone that contributed.

Laravel Can't connect to local MySQL after Reboot?

Since then i've reboot my VPS server I get the Error in my logs message:
[2014-03-14 10:18:04] log.ERROR: exception 'PDOException' with message 'SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)' in /home/cap-store/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:47
Stack trace:
#0 /home/cap-store/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(47): PDO->__construct('mysql:host=loca...', 'root', 'Rincewind', Array)
#1 /home/cap-store/vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php(20): Illuminate\Database\Connectors\Connector->createConnection('mysql:host=loca...', Array, Array)
#2 /home/cap-store/bootstrap/compiled.php(6611): Illuminate\Database\Connectors\MySqlConnector->connect(Array)
#3 /home/cap-store/bootstrap/compiled.php(6538): Illuminate\Database\Connectors\ConnectionFactory->make(Array, 'mysql')
#4 /home/cap-store/bootstrap/compiled.php(6512): Illuminate\Database\DatabaseManager->makeConnection('mysql')
#5 /home/cap-store/bootstrap/compiled.php(6400): Illuminate\Database\DatabaseManager->connection(NULL)
#6 /home/cap-store/bootstrap/compiled.php(6387): Illuminate\Database\Eloquent\Model::resolveConnection(NULL)
#7 /home/cap-store/bootstrap/compiled.php(6025): Illuminate\Database\Eloquent\Model->getConnection()
#8 /home/cap-store/bootstrap/compiled.php(5998): Illuminate\Database\Eloquent\Model->newBaseQueryBuilder()
#9 /home/cap-store/bootstrap/compiled.php(5612): Illuminate\Database\Eloquent\Model->newQuery()
#10 /home/cap-store/app/controllers/HomeController.php(7): Illuminate\Database\Eloquent\Model::find(1)
#11 [internal function]: HomeController->getIndex()
#12 /home/cap-store/vendor/laravel/framework/src/Illuminate/Routing/Controllers/Controller.php(138): call_user_func_array(Array, Array)
#13 /home/cap-store/vendor/laravel/framework/src/Illuminate/Routing/Controllers/Controller.php(115): Illuminate\Routing\Controllers\Controller->callMethod('getIndex', Array)
#14 /home/cap-store/bootstrap/compiled.php(4927): Illuminate\Routing\Controllers\Controller->callAction(Object(Illuminate\Foundation\Application), Object(Illuminate\Routing\Router), 'getIndex', Array)
#15 [internal function]: Illuminate\Routing\Router->Illuminate\Routing\{closure}()
#16 /home/cap-store/bootstrap/compiled.php(8117): call_user_func_array(Object(Closure), Array)
#17 /home/cap-store/bootstrap/compiled.php(8104): Illuminate\Routing\Route->callCallable()
#18 /home/cap-store/bootstrap/compiled.php(4938): Illuminate\Routing\Route->run(Object(Illuminate\Http\Request))
#19 /home/cap-store/bootstrap/compiled.php(533): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#20 /home/cap-store/bootstrap/compiled.php(520): Illuminate\Foundation\Application->dispatch(Object(Illuminate\Http\Request))
#21 /home/cap-store.com/index.php(49): Illuminate\Foundation\Application->run()
#22 {main} [] []
Not understand where the fault lies. I have only reboot the server.
This is not an error of Laravel. Check your mysql instance on the VPS to make sure that your mysql service is running.
I think you did not set the mysql service to start automatically with your VPS.

Resources