I am trying to install Mangopay https://github.com/Mangopay/mangopay2-php-sdk, but the recommended solution of installing it without composer doesn't work. I used this line:
require_once "mango/mangopay2-php-sdk-2.11.0/MangoPay/Autoloader.php";
$api = new MangoPay\MangoPayApi();
The file get's loaded, but I get the following error:
Fatal error: Uncaught Error: Class 'Psr\Log\NullLogger' not found in
/usr/local/apache2/htdocs/MangoPay/MangoPayApi.php:223 Stack trace:
#0 /usr/local/apache2/htdocs/pay.php(5): MangoPay\MangoPayApi-
>__construct() #1 {main} thrown in
/usr/local/apache2/htdocs/MangoPay/MangoPayApi.php on line 223
The issue is with the logger, which I manually downloaded and copied into the directory but it still doesn't work. I am only asking here because I am not getting any response from the developers.
Any help with manually installing the logger and getting the namespace to work with mangopay is welcome.
Related
what's up?
I found this problem: I initiate a new project from 0, installing Laravel with composer:
composer create-project laravel/laravel --prefer-dist Blog
The following step was to add the Agent library https://github.com/jenssegers/agent.
composer require jenssegers/agent
This is the first library that I have ever used on Laravel and I'm not sure if I did it correctly. I added the line codes mentioned in the Agent's README.md at the config/app.php. After it, I went to public/index.php at my project and add the following lines to test it:
use Jenssegers\Agent\Facades\Agent;
$agent = new Agent();
Infortunally it didn't work and I had received the following error: Fatal error: Uncaught Error: Class "Jenssegers\Agent\Facades\Agent" not found in C:\xampp\htdocs\BlogBRU\public\index.php:7 Stack trace: #0 {main} thrown in C:\xampp\htdocs\BlogBRU\public\index.php on line 7. The line 7 correspond to $agent = new Agent();
I already tried to modify the use ... for:
use use Jenssegers\Agent\Facades;
use Jenssegers\Agent\Agent;
But it doesn't work.
I will appreciate it if you could help me. This is taking all my time!
I have installed magento2 in my linux centos7. After installing magento2 successfully while accessing the web page is getting following error with empty content.
{{menuState.title}}
PHP version:7.1.3
OS: centos7
And the PHP-fpm error log has following error.
PHP Fatal error: Uncaught TypeError: Argument 1 passed to Zend_Controller_Plugin_Abstract::setResponse() must be an instance of Zend_Controller_Response_Abstract, instance of Magento\Framework\HTTP\PhpEnvironment\Response given, called in /var/www/magento2/lib/internal/Magento/Framework/Profiler/Driver/Standard/Output/Firebug.php on line 61 and defined in /var/www/magento2/vendor/magento/zendframework1/library/Zend/Controller/Plugin/Abstract.php:70
Stack trace:
#0 /var/www/magento2/lib/internal/Magento/Framework/Profiler/Driver/Standard/Output/Firebug.php(61): Zend_Controller_Plugin_Abstract->setResponse(Object(Magento\Framework\HTTP\PhpEnvironment\Response))
#1 /var/www/magento2/lib/internal/Magento/Framework/Profiler/Driver/Standard.php(195): Magento\Framework\Profiler\Driver\Standard\Output\Firebug->display(Object(Magento\Framework\Profiler\Driver\Standard\Stat))
#2 [internal function]: Magento\Framework\Profiler\Driver\Standard->display()
#3 {main}
thrown in /var/www/magento2/vendor/magento/zendframework1/library/Zend/Controller/Plugin/Abstract.php on line 70
How can I resolve this error?
This was a Magento Bug reported ...
But it's already been ...
https://github.com/magento/magento2/issues/7068
So, come on ...
Did you update the magento? What is the current version?
I found this information at the base of Magento: https://devdocs.magento.com/guides/v2.3/config-guide/bootstrap/mage-profiler.html
You have this option ...
The temporary fix is install symfony / yaml from dev branch and then our module:
composer require symfony/yaml: dev-issue-814
composer require mirasvit/module-profiler
Try using / installing php7.2
See this Magento Project reference >>>
https://magento.stackexchange.com/questions/49000/magento-2-is-there-a-profiler
Be sure to back up before the above procedures ...
Since I don't know the correct version of your current Magento, I looked for alternatives to fix.
I hope it helps you ...
Good luck! Send news about your progress ...
Already installed library using composer
Я уже установил библиотеку через composer
composer require vkcom/vk-php-sdk
But cant initializate it by
однако не выходит её инициализировать через
$vk = new VKApiClient();
Recieve error
Получаю ошибку
Fatal error: Uncaught Error: Class 'VKApiClient' not found in E:\OSPanel\domains\localhost\albom.php:2 Stack trace: #0 {main} thrown in E:\OSPanel\domains\localhost\albom.php on line 2
Directory hierarchy image
Изображение иерархии директорий
I already tried method below:
Также я пробовал способ ниже:
$vk = new \vkapi\src\VK\Client\VKApiClient();
But receive error:
Но получаю ошибку:
Fatal error: Uncaught Error: Class 'vkapi\src\VK\Client\VKApiClient' not found in E:\OSPanel\domains\localhost\albom.php:2 Stack trace: #0 {main} thrown in E:\OSPanel\domains\localhost\albom.php on line 2
Tried use require for composer autoload file, but it still doesnt works well
Уже пробовал использовать require для автозагрузочного файла composer'a, но это всё равно не работает
require '.\vendor\autoload.php';
$vk = new VKApiClient();
Recieve error
Получаю ошибку
Fatal error: Uncaught Error: Class 'VKApiClient' not found in E:\OSPanel\domains\localhost\albom.php:3 Stack trace: #0 {main} thrown in E:\OSPanel\domains\localhost\albom.php on line 3
There are different points here.
First, VKApiClient's namespace is not \vkapi\src\VK\Client\. You can open a file and read the code. It doesn't contain src at all, it does contain namespace VK\Client, so you can initialize client this way
$vk = new \VK\Client\VKApiClient();
Second, you have to include source file. Composer does it via autoload.php. If is not actual somehow, try php composer dump-autoload to refresh autoload file.
Actually, you'd better use English only. Russian SO is here. Have you tried to ask your question there? Though audience is much greater here, I prefer English SO rather that Russian.
I am using an application that I downloaded using Composer.
The package has many classes that can be called and utilized.
However, when I run the below code, I am getting the following error.
<?php
error_reporting(E_ALL);
ini_set('display_errors', 'On');
include 'vendor/autoload.php';
$clarifai = new \DarrynTen\Clarifai\Clarifai('CLARIFAI_API_KEY');
$input = new Input();
$input->setImage('https://samples.clarifai.com/metro-north.jpg')->isUrl();
$inputResult = $clarifai->getInputRepository()->add($input);
echo json_encode($inputResult);
?>
Error:
Warning:
include(/var/www/html/vendor/darrynten/clarifai-php/src/Entity):
failed to open stream: Not a directory in /var/www/html/ctest.php on
line 7
Warning: include(): Failed opening
'/var/www/html/vendor/darrynten/clarifai-php/src/Entity' for inclusion
(include_path='.:/usr/share/php') in /var/www/html/ctest.php on line 7
Fatal error: Uncaught Error: Class 'Input' not found in
/var/www/html/ctest.php:11 Stack trace: #0 {main} thrown in
/var/www/html/ctest.php on line 11
The class Input is located at /var/www/html/vendor/darrynten/clarifai-php/src/Entity which I am including using the include keyword in PHP right after the first include, of no avail.
include 'vendor/autoload.php';
include '/var/www/html/vendor/darrynten/clarifai-php/src/Entity';
Later, I used the following code
$concept = new \DarrynTen\Clarifai\Entity\Concept();
$concept->setId('boscoe')->setValue(true);
$input = new \DarrynTen\Clarifai\Entity\Input();
$input->setImage('https://samples.clarifai.com/puppy.jpeg')->isUrl()
->setConcepts([$concept]);
$inputResult = $clarifai->getInputRepository()->add($input);
on the last line, I am getting this error. (Guzzle related)
Fatal error: Uncaught GuzzleHttp\Exception\ClientException: Client
error: POST https://api.clarifai.com/v2/inputs resulted in a 400
Bad Request response:
{"status":{"code":10020,"description":"Failure"},"inputs":[{"id":"e25be6bf0a4a4090a774694c016202cb","data":{"image":{"ur
(truncated...) in
/var/www/html/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:111
Stack trace: #0
/var/www/html/vendor/guzzlehttp/guzzle/src/Middleware.php(65):
GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request),
Object(GuzzleHttp\Psr7\Response)) #1
Is this also name space related?
I have found a new PHP library that seems to be compatible with new apps in Clarifai created with the new api_key version: phpfanatic/clarifai
You can easily try to install it via composer:
composer require phpfanatic/clarifai
As dependencies you need to have:
PHP - 5.6, 7.0 - May work with ealier version, untested at this time.
cURL - *
Clarifai API Key - clarifai
PHPUnit - to run tests (optional).
Here you can find the full documentation with quick tutorial or step by step explanation.
Eddie from Clarifai here. Sorry you ran into an issue.
I see that you are using an API key. This community library currently only supports our old auth mechanism. All new "apps" in Clarifai are only created with an api_key as opposed to client_id and client_secret.
There's currently a PR open to add support for API keys.
We're hoping to have first class PHP support by the end of the year.
I'm trying to implement the google analytics API on localhost site using xampp on Mac OS.
but Im getting this error:
Fatal error: Uncaught Exception: This library must be installed via composer or by downloading the full package. See the instructions at https://github.com/google/google-api-php-client#installation. in /Applications/XAMPP/xamppfiles/htdocs/ga-api/google-api-php-client/autoload.php:14 Stack trace: #0 /Applications/XAMPP/xamppfiles/htdocs/ga-api/index.php(4): require_once() #1 {main} thrown in /Applications/XAMPP/xamppfiles/htdocs/ga-api/google-api-php-client/autoload.php on line 14
Can anyone help me with this?
Given that you installed the library using Composer, it will be installed to vendor and will be available in the autoload.php that Composer generates.
I will require_once DIR. '/vendor/autoload.php'; in index.php (preferred) or where I need to instantiate the GoogleClient class.
Ensure that the path to client credentials are rightly referenced when you set auth config like so:
Google_Client->setAuthConfig($pathToCredentials)
Reference:
Setting auth credentials:
https://github.com/google/google-api-php-client#authentication-with-oauth
Autoloading classes:
https://getcomposer.org/doc/01-basic-usage.md#autoloading