Class Instantiation Failed Exception and Run time Exception - laravel

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

Related

laravel atymic/twitter is not running on linux server but working on macbook (homebrew)

I am facing a strange issue with Atymic Twitter
I have same version of php i.e. 7.4.22 on my local (macbook) and live server (ubuntu)
This is package running awesome on local but shows below error on server (ubuntu)
Details:
php 7.4.22
laravel :7.30.4
atymic/twitter 3.1.13
The apache process may still be using an other version of PHP. You can change that version using the following commands:
sudo a2dismod php7.2
sudo a2enmod php7.4
sudo service apache2 restart

Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR) Class 'MongoDB\Client' not found

I followed this commands.
$ sudo pecl install mongodb
$ composer require jenssegers/mongodb
use MongoDB\Client AS Mongo;
$mongo = new Mongo();
I am using NGNIX and ubuntu 20. In localhost it is working but in server it is not. In localhost I am using apache2 and in server there ngnix.
Kindly let me know what I am doing wrong. Thanks is advance!
On you're server, first check whether mongodb extension module is loaded by PHP or not
php -i | grep mongo
If there is no output, then check whether mongodb client is installed or not by this command
pecl list mongodb
If no output then installed mongodb client
pecl install mongodb
Once installed, add this line extension=mongodb.so in php.ini file.
Restart nginx webserver and If you're application is using php-fpm restart this service too
Once, everything is at its place, you can re-verify the module is loaded or not using php -i or php -m command

hInterface 'Throwable' not found

when querying the database with sql error laravel throws Throwable interface not found instead of the query exception.
i have a same trouble yestoday with 'laravel new demo', meybe the repository server has error before. i rebuild my laravel project with 'composer create-project laravel/laravel=5.4 demo --prefer-dist' this afternoon, it work! do like this.
In my last project, I got this error too. I used php 5.6.30 version. When i upgrade to 7.0.1 version, everything is fine. http://php.net/manual/en/class.throwable.php
I was using php5.6 and got this after I did composer update.
So I installed the php7.1 following this answer
Then I disabled php5.6 using
sudo a2dismod php5.6
and then I ran the following to enable 7.1
sudo a2enmod php7.1
and finally restarted apache2 using.
sudo service apache2 restart
and it worked.
I fixed mine when I did a netstat -tln and found out the mysql is running 0:0:0:0:3306, and on my .env file is set to DB_HOST= 127.0.0.1. I changed it to DB_HOST=localhost and is working fine right now.

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.

Errors while installing Magento on Cent OS with Nginx and PHP-FPM

I have been fighting this for hours now and finally found a resolution so I wanted to share it with anyone else who has trouble.
If you receive the following errors while installing Magento on Linux while running Nginx and PHP-FPM then try the answer below:
PHP extension "dom" must be loaded.
PHP extension "mcrypt" must be loaded.
PHP extension "gd" must be loaded.
Try running:
yum install php-xml php-gd php-mcrypt
I was wondering why this wasn't working and I was dumbfounded for hours.
The trick is to restart php-fpm once you have everything installed. I kept restarting Nginx.
Run the following:
service php-fpm restart
Hope this helps someone!

Resources