I've got a simple script which should:
1. Get all customers from Magento (into an array)
2. Get their full addresses (iterate through the array with a foreach)
2a. sleep for 3 sec
3. Get their order history (same foreach)
3a. sleep once more for 3 sec
I'm doing this from the command line with PHP CLI.
The script runs for a couple of minutes - sometimes even half an hour but most often the script sees an error and can't fully iterate through all data:
PHP Fatal error: Uncaught SoapFault exception: [HTTP] Could not connect to host in /var/www/soap/mag_crm.php:162
Stack trace:
#0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'http://myurl...', 'urn:Mage_Api_Mo...', 1, 0)
#1 /var/www/soap/mag_crm.php(162): SoapClient->__call('salesOrderList', Array)
#2 /var/www/soap/mag_crm.php(162): SoapClient->salesOrderList('fd66fc18e4b8...', Array)
#3 /var/www/soap/mag_crm.php(85): fetchAllOrders(259)
#4 {main}
thrown in /var/www/soap/mag_crm.php on line 162
How could I improve this script or in case of an error like this - just retry or so?
The code itself is easy - just plain function calls like that for instance:
$aOrders = fetchAllOrders ( $oCustomer->customer_id );
(within the foreach)
you need to change your magento settings to :
System -> Index Management
Check All Items
Change Action to "Change Index Mode"
Select "Manual"
Save
The problem is that the site tries to refresh the picture all the time and kill the session.
Related
Following Google's instructions to the letter.
This is what I get:
Fatal error: Uncaught GuzzleHttp\Exception\ConnectException: cURL error 28: Connection timed out after 500 milliseconds (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) in C:\xampp\htdocs\ModernMT\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:207 Stack trace: #0 C:\xampp\htdocs\ModernMT\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(162): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array) #1 C:\xampp\htdocs\ModernMT\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(109): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory)) #2 C:\xampp\htdocs\ModernMT\vendor\guzzlehttp\guzzle\src\Handler\CurlHandler.php(45): GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory)) #3 C:\xampp\htdocs\ModernMT\vendor\guzzlehttp\guzzle\src\Handler\Proxy.php(30): GuzzleH in C:\xampp\htdocs\ModernMT\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php on line 207
This happens right after:
# Instantiates a client
$client = new SpeechClient();
Straight from the developers of Google Cloud:
After investigating a bit further, it looks like this is a bug in the google/auth dependency. We just merged a fix, and it should be tagged by the end of the day. You can wait for that (watch this page for v1.11.1), or you could require guzzlehttp/guzzle at ^6.5 to get it working right now. Sorry for the trouble, and thanks for bringing it to our attention!
I am writing a relatively simple app in the Lithium (li3) Framework. I am using MongoDB as the datastore. My MongoDB database is hosted in the cloud - at MongoHQ.
I am getting intermittent errors when trying to post data. At times it will work - but then I will get an error that says the following:
Fatal error: Uncaught exception 'MongoConnectionException' with
message 'connecting to mongodb://USERNAME:PASSWORD#flame.mongohq.com:27052/DATABASENAME failed:
Operation now in progress' in
/Applications/MAMP/htdocs/quizapp/libraries/lithium/data/source/MongoDb.php:257 Stack trace:
#0 /Applications/MAMP/htdocs/quizapp/libraries/lithium/data/source/MongoDb.php(257): Mongo-
>__construct('mongodb://mongo...', Array) #1
/Applications/MAMP/htdocs/quizapp/libraries/lithium/data/Source.php(90):
lithium\data\source\MongoDb->connect() #2
/Applications/MAMP/htdocs/quizapp/libraries/lithium/data/source/MongoDb.php(160):
lithium\data\Source->_init() #3
/Applications/MAMP/htdocs/quizapp/libraries/lithium/core/Object.php(93):
lithium\data\source\MongoDb->_init() #4
/Applications/MAMP/htdocs/quizapp/libraries/lithium/data/Source.php(73): lithium\core\Object-
>__construct(Array) #5
/Applications/MAMP/htdocs/quizapp/libraries/lithium/data/source/MongoDb.php(156):
lithium\data\Source->__construct(Array) #6 /Applications/MAMP/htdocs/quizapp/libra in
/Applications/MAMP/htdocs/quizapp/libraries/lithium/data/source/MongoDb.php on line 263
I am running this on MAMP on a Mac. I have tried to stop and restart Apache - but it does not seem to fix the problem. However, I do seem to connect to MongoDB 1 out of every 10 to 15 attempts. I cannot figure out any trends.
Any help will be greatly appreciated.
Thank you
Nino
I can see two possible issues here:
A firewall, and a description to turn that off is at: https://groups.google.com/forum/#!msg/mongodb-user/9-DYhQWEo0E/B4UsY53S1IwJ
Slow connections — in some cases a connection to a host is too slow. And since version 1.3.4 of the Mongo PHP driver (which li3 uses) there is great control over timeouts. Have a look at the timeout option at http://www.php.net/manual/en/mongoclient.construct.php — you will most likely want to increase that (but make sure you use 1.3.4 or later of the driver).
I'm trying to put a ZF website on the Internet which works well on my local machine (WAMP).
But on the Linux server, only the main page can be properly displayed. For the other pages, I've got a fatal error:
Fatal error: Uncaught exception
'Zend_Controller_Dispatcher_Exception' with message 'Invalid
controller specified (error)' in
/var/www/staging/library/Zend/Controller/Dispatcher/Standard.php:248
Stack trace: #0
/var/www/staging/library/Zend/Controller/Front.php(954):
Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http),
Object(Zend_Controller_Response_Http)) #1
/var/www/staging/library/Zend/Application/Bootstrap/Bootstrap.php(97):
Zend_Controller_Front->dispatch() #2
/var/www/staging/library/Zend/Application.php(366):
Zend_Application_Bootstrap_Bootstrap->run() #3
/var/www/staging/public/index.php(26): Zend_Application->run() #4
{main} Next exception 'Zend_Controller_Exception' with message
'Invalid controller specified (error)#0
/var/www/staging/library/Zend/Controller/Front.php(954):
Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http),
Object(Zend_Contr in
/var/www/staging/library/Zend/Controller/Plugin/Broker.php on line
336.
I activated the URL rewriting. I'm using modules. The index.php and application.ini are very basic, we didn't custumize it.
I suppose that there is something wrong with the configuration... Thanks.
When deploying application from windows platform to Linux, most typical type of error that can be encountered is due to the filename cases. Linux system are very strict about file name and cases.
The error you are encountering is also probably one of these cases. Check the name of ErrorContainer.php and try to match the name you specify in your route and file system.
In changing server Windows => Linux. The first main things to check is ignore case in Windows. Check filenames and class names if spelled with proper first capital letter etc.
Pardon me guys, I am new to ZF. I need to move my codes from MAMP production server to LAMP Live Server.
When I am working on localhost with the codes are all working fine. However when I upload it to live server, 60% of the modules reflect this error.
Fatal error: Uncaught exception 'Zend_View_Exception' with message
'script 'layout.phtml' not found in path
(/home/lifeoppc/public_html/application/layouts/:/home/lifeoppc/public_html/application/modules/default/views/scripts/:./views/scripts/)'
in /home/lifeoppc/public_html/public/Zend/View/Abstract.php:988 Stack
trace: #0
/home/lifeoppc/public_html/public/Zend/View/Abstract.php(884):
Zend_View_Abstract->_script('layout.phtml') #1
/home/lifeoppc/public_html/public/Zend/Layout.php(796):
Zend_View_Abstract->render('layout.phtml') #2
/home/lifeoppc/public_html/public/Zend/Layout/Controller/Plugin/Layout.php(143):
Zend_Layout->render() #3
/home/lifeoppc/public_html/public/Zend/Controller/Plugin/Broker.php(333):
Zend_Layout_Controller_Plugin_Layout->postDispatch(Object(Zend_Controller_Request_Http))
#4 /home/lifeoppc/public_html/public/Zend/Controller/Front.php(965): Zend_Controller_Plugin_Broker->postDispatch(Object(Zend_Controller_Request_Http))
#5 /home/lifeoppc/public_html/public/Zend/Application/Bootstrap/Bootstrap.php(9
in /home/lifeoppc/public_html/public/Zend/Controller/Plugin/Broker.php
on line 336
I really really need help! Site is going live on Monday and I am really desperate right now =(
Search for file layout.phtml inside your project and then copy paste it inside directory
/home/lifeoppc/public_html/application/layouts/
I'm trying to move a website to a new host (MediaTemple.)
When you stick to http, or https everything is fine. When going from http->https or https->http you get the error.
Fatal error: Uncaught exception 'Zend_Session_Exception' with message 'session has already been started by session.auto-start or session_start()'
in /var/www/vhosts/FakeSite.com/httpdocs/library/Zend/Session.php:462
Stack trace:
#0 /var/www/vhosts/FakeSite.com/httpdocs/library/Zend/Session/Namespace.php(143): Zend_Session::start(true)
#1 /var/www/vhosts/FakeSite.com/httpdocs/library/Zend/Auth/Storage/Session.php(87): Zend_Session_Namespace->__construct('Zend_Auth')
#2 /var/www/vhosts/FakeSite.com/httpdocs/library/Zend/Auth.php(91): Zend_Auth_Storage_Session->__construct()
#3 /var/www/vhosts/FakeSite.com/httpdocs/library/Zend/Auth.php(141): Zend_Auth->getStorage()
#4 /var/www/vhosts/FakeSite.com/httpdocs/application/layouts/layout.phtml(12): Zend_Auth->hasIdentity()
#5 /var/www/vhosts/FakeSite.com/httpdocs/library/Zend/View.php(108): include('/var/www/vhosts...')
#6 /var/www/vhosts/FakeSite.com/httpdocs/library/Zend/View/Abstract.php(831): Zend_View->_run('/var/www/vhosts...')
#7 /var/www/vh in /var/www/vhosts/FakeSite.com/httpdocs/library/Zend/Session.php on line 462
Session path is writable, and seems to work fine if you stick to one protocol. There are no session_start() calls, and session.auto-start is 0.
Code is running on 3 other servers fine. It must be a configuration issue, but I haven't been able to find it
Sure looks like the server is configured with session.auto_start = 1.
So, maybe add to configs/application.ini:
phpSettings.session.auto_start = 0
I think you have a plugin(or other library), which calls session_start() function
I had the same problem, when tried to create facebook resource
I figured finally it out.
Problem was that PHP on http was running as an Apache module, and PHP on https was running as a FastCGI module.
I assume those run as different users on MediaTemple or something. The session would get created by one, and not be able to be read by the other because another user owned the file.