Elasticsearch-PHP requires cURL, or a custom HTTP handler - laravel-5

[RuntimeException] Elasticsearch-PHP requires cURL, or a custom HTTP handler.
How to solve this problem in laravel 5.

Do you have php curl installed on your machine? installing php5-curl might fix it.
Quote from the elastic search website: 'ext-curl: the Libcurl extension for PHP is required'

Related

Class Instantiation Failed Exception and Run time Exception

I downloaded and install the omnipay package on my localhost from (omnipay-nabtransact). It is working fine on localhost but when I installed it on the live server, I am having errors.
The errors are:-
(2/2) ClassInstantiationFailedException Unexpected exception when
instantiating class.
and
(1/2) RuntimeException GuzzleHttp requires cURL, the allow_url_fopen
ini setting, or a custom HTTP handler.
I am not able to understand what are these errors. When I did the installation on my localhost Laravel FW, it work smoothly. But when I installed it on the live server, I am having trouple fixing it.
Install curl as per your version of php
sudo apt-get install php-curl
Then restart apache
sudo service apache2 restart

Using Laravel on php 7.0

I have installed Laravel 5.5 and I'm getting the same error, documentation says this:
PHP >= 7.0.0
OpenSSL PHP Extension
PDO PHP Extension
Mbstring PHP Extension
Tokenizer PHP Extension
XML PHP Extension
I ran:
$ php artisan --version`
$ Laravel Framework 5.5.42
and I'm getting this error:
Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_PARSE)
Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE)
Is the documentation wrong? I'm using: https://laravel.com/docs/5.5/installation#installing-laravel
My server can only use PHP 7.0. Not 7.1. Is there no way to run Laravel on 7 anymore?
I'm installing via composer.
Is there a way to download a compatible version with 7.0?
If you have PHP 5.5 (actually 5.5.9 or greater) you should use Laravel 5.2.
If you have PHP 7.0 you can use Laravel 5.5.
The error you mentioned is because you are using PHP 5.5 which does not support PHP 7 Null coalescing operator (??) and it is being used somewhere in Laravel code.
As you said your server supports PHP 7.0, you might have more than one PHP versions installed on your system. Check PHP version running php --version.
The issue could be that the command line version of PHP differs to the Apache version of PHP. Run php --version and verify that you're using PHP 7.0.0 or greater.
Laravel 5.5.* has no issues running on PHP 7.0.*. I currently have a project running Laravel 5.5.43 on PHP 7.0.15 and this issue does not occur.
If the command line version of PHP is not up to date or if you have access to multiple versions of PHP, you should contact your hosting provider for help. You may also be able to run a command similar to the following to see if you can access a different version of PHP:
locate bin/php
The above may give you an idea of the installation location. For example, I see three different versions of PHP installed, but the default version (/usr/bin/php) is 7.0.15:
/opt/cpanel/ea-php56/root/usr/bin/php
/opt/cpanel/ea-php70/root/usr/bin/php
/opt/cpanel/ea-php71/root/usr/bin/php
/usr/bin/php
It was an issue with the Symfony Translation stack, i had to disable for the moment, also i have downgraded the carbon package to make it work, not sure why. It has some php7.1 code.

Using Sagepay PHP Integration Toolkit

When I go to sagepay/demo/index.php it gives error:
Ooops!!!
Setup error: curl not loaded.
I follow instructions to install php5 etc but my server is running php7. Is this an issue?
It could be an issue with your Apache configuration with the curl module not being enabled as this is a required module for the SagePay toolkit.
You should downgrade to PHP 5.6 anyway for SagePay as their toolkit makes use of mcrypt, found in their requirements section (VspPHPKit/demo/readme.html#2) obtained from here, which according to http://php.net/manual/en/migration71.deprecated.php is deprecated in PHP 7+.
The mcrypt extension has been abandonware for nearly a decade now, and was also fairly complex to use. It has therefore been deprecated in favour of OpenSSL, where it will be removed from the core and into PECL in PHP 7.2.
"I follow instructions to install php5 etc" - which instructions are these?
You might find the demo code runs better on a server running PHP5, some of the code is pretty ancient and not compatible with php7...

Call to undefined function Symfony\Polyfill\Mbstring\iconv_strpos() error laravel 5.4

I am uploading a laravel 5.4 project to cpanel server.
And i am serve with
PHP Fatal error: Call to undefined function Symfony\Polyfill\Mbstring\iconv_strpos()
on server.
I have done
composer require symfony/polyfill-iconv
However, it does not change the error message.
What thing i might miss out?
Be sure that you have php-iconv and php-mbstring installed on the server. Then check again. By default, mbstring is not installed on cPanel/WHM servers

Magento connect : Connection Error try again later

I am trying to install one extension using magento connect but the error I am getting :
Connection Error try again later.
I am using extension key
http://connect20.magentocommerce.com/community/Mageix_ExtensionManager
I was just hit with this error - turns out the live server I had just moved the site too didn't have DOMDocument support in PHP. A quick yum install php-xml and restart of Apache fixed it!
Check the compatibility of the extension
Flush the cache in magento connect and check
Installing yum install php-xml and restarting nginx worked for me.

Resources