GuzzleHttp\Exception\ConnectException: cURL error 28 when using Google Cloud Speech PHP API - guzzle

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!

Related

Tikiwiki 16.2 Error while registering new user

I did a fresh install of 16.2 and when I try to register a new user I get the error below. I've re-extracted the zip and reinstalled the database, but I get the same error.
Tikiwiki is in a public_html/tiki folder and I have made no adjustments to it.
Any help would be appreciated.
Here's the error:
Fatal error: Uncaught exception 'Zend\Math\Exception\RuntimeException' with message 'The RandomLib fallback pseudorandom generator is not installed. Please install it to support secure random numbers' in /home/ghsfhaco/public_html/tiki/vendor/zendframework/zend-math/src/Rand.php:75 Stack trace: #0 /home/ghsfhaco/public_html/tiki/vendor/zendframework/zend-math/src/Rand.php(60): Zend\Math\Rand
getAlternativeGenerator() #1 /home/ghsfhaco/public_html/tiki/vendor/zendframework/zend-captcha/src/AbstractWord.php(354): Zend\Math\Rand
getBytes(32) #2 /home/ghsfhaco/public_html/tiki/vendor/zendframework/zend-captcha/src/AbstractWord.php(340): Zend\Captcha\AbstractWord->generateRandomId() #3 /home/ghsfhaco/public_html/tiki/vendor/zendframework/zend-captcha/src/Image.php(447): Zend\Captcha\AbstractWord->generate() #4 /home/ghsfhaco/public_html/tiki/lib/captcha/captchalib.php(150): Zend\Captcha\Image->generate() #5 /home/ghsfhaco/public_html/tiki/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(171) : eval()'d c in /home/ghsfhaco/public_html/tiki/vendor/zendframework/zend-math/src/Rand.php on line 75
This also caught us out the other day and it's due to an older version of PHP 5 which hasn't got the mcrypt extension enabled, and we fixed it recently, so there are a few options for you I think:
Upgrade to php 7 (probably not an option unless it's your own server)
Enable php-mcrypt for you php (also probably not possible)
Try again with a recent "daily build" 16.x tarball from dev.tiki.org
Or enable one of the other CAPTCHA methods on Control panels->Security->Spam Protection, such as ReCaptcha or CAPTCHA Questions
HTH

Connecting to MongoDB using Lithium li3 Framework

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).

Zend Framework Migration to Live Server

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/

New Server: Zend_Session_Exception "session has already been started" http to https & vice versa

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.

Zend Framework ErrorController not working on live site?

My site is set up pretty much as per the Zend Quickstart guide. The default ErrorController works locally using MAMP. But now I've deployed it to my live site I get a blank page and a "500 Internal Server Error" according to FireBug when I go to an action that doesnt exist.
On my local server I get a 404 and a nicely formatted error page.
Any ideas anyone? I dont really know where to begin looking.
I'm confused :/
Thanks.
Gentlemen, we have a winner!
So for some reason my live server gives me this error:
[Sun Oct 18 10:56:53 2009] [error] [client 118.209.152.109] PHP Fatal error: Uncaught exception 'Zend_Loader_PluginLoader_Exception' with message 'Plugin by name 'Headtitle' was not found in the registry; used paths:\nZend_View_Helper_: Zend/View/Helper/:/var/www/vhosts/lindengardens.com.au/httpdocs/application/views/helpers/' in /var/www/vhosts/lindengardens.com.au/httpdocs/library/Zend/Loader/PluginLoader.php:406\nStack trace:\n#0 /var/www/vhosts/lindengardens.com.au/httpdocs/library/Zend/View/Abstract.php(1118): Zend_Loader_PluginLoader->load('Headtitle')\n#1 /var/www/vhosts/lindengardens.com.au/httpdocs/library/Zend/View/Abstract.php(569): Zend_View_Abstract->_getPlugin('helper', 'headtitle')\n#2 /var/www/vhosts/lindengardens.com.au/httpdocs/library/Zend/View/Abstract.php(336): Zend_View_Abstract->getHelper('headtitle')\n#3 [internal function]: Zend_View_Abstract->__call('headtitle', Array)\n#4 /var/www/vhosts/lindengardens.com.au/httpdocs/application/layouts/scripts/layout.phtml(32): Zend_View->headtitle()\n#5 /var/www/vhosts/lindengardens.com.au/httpdocs/library/Zend/View.php(108): incl in /var/www/vhosts/lindengardens.com.au/httpdocs/library/Zend/Loader/PluginLoader.php on line 406
I get the above error if I dont have something like
$this->view->headTitle("Linden Gardens Rainforest Retreat B&B Mt Dandenong - Error Page");
set in the controller.
Just setting the headTitle fixed the problem - I wonder why that works fine on my local server :/
thanks.