Fatal error: Class 'FOS\Rest\Util\Codes' not found - php

I am trying to install the following project connect on osx lion.
cd /tmp
git clone git://github.com/dsyph3r/connect
cd connect
git submodule update --init
php bin/vendors install
When I run the following command php bin/vendors install I get the following messages:
[Symfony\Component\Config\Exception\FileLoaderLoadException]
Cannot import resource "parameters.ini" from "/private/tmp/connect/app/config/config.yml".
In order to fix the following error I did:
cp app/config/parameters.ini.dist app/config/parameters.ini
Then when I run the following command php bin/vendors install I get the following error:
PHP Fatal error: Class 'FOS\Rest\Util\Codes' not found in /private/tmp/connect/vendor/bundles/FOS/RestBundle/DependencyInjection/Configuration.php on line 115
Fatal error: Class 'FOS\Rest\Util\Codes' not found in /private/tmp/connect/vendor/bundles/FOS/RestBundle/DependencyInjection/Configuration.php on line 115
PHP Fatal error: Class 'FOS\Rest\Util\Codes' not found in /private/tmp/connect/vendor/bundles/FOS/RestBundle/DependencyInjection/Configuration.php on line 115
Fatal error: Class 'FOS\Rest\Util\Codes' not found in /private/tmp/connect/vendor/bundles/FOS/RestBundle/DependencyInjection/Configuration.php on line 115
What did I miss?
I suppose now the problem is in my app/config/parameters.ini.
How should it be?

There is an entry in the deps file for the FOSRestBundle, but not for the FOSRest library.
Look at the FOSRestBundle installation documentation, it shows how the deps file should look like. I guess this was one project 7 months ago, and it must have split after.

Related

(MAC) PHP Fatal error: Uncaught Error: Class 'Web3\Web3' not found

I'm new to PHP, and I was trying to run
$exampleBase.php from web3.php on mac
but it keeps showing error :
PHP Fatal error: Uncaught Error: Class 'Web3\Web3' not found in /Users/hsnl/Desktop/code/back-end-php/web3.php/examples/exampleBase.php:7
Stack trace:
#0 {main}
thrown in /Users/hsnl/Desktop/code/back-end-php/web3.php/examples/exampleBase.php on line 4
$exampleBase.php file is like this
<?php
require('vendor/autoload.php');
use Web3\Web3;
$web3 = new Web3('http://localhost:8545/');
any idea why or how should I fix this?
If you are trying to run sc0Vu, please try to follow this steps:
https://github.com/sc0Vu/web3.php#local-php-cli-installed
Clone the repo and install packages.
git clone https://github.com/sc0Vu/web3.php.git && cd web3.php && composer install
This means:
clone github project,
go to cloned directory,
run composer install
(will download and create all necessary files with classes)
Run test script.
vendor/bin/phpunit

Laravel: Call to a member function error() on a non-object in Exceptions/Handler.php

I am new to laravel framework. I downloaded sample project from github. when I try to use it in my localhost it shows
Fatal error: require() [function.require]: Failed opening required '.../vendor/autoload.php on Line 14'
so I update composer by composer update. Now new error is coming up when I execute php public/index.php
PHP Fatal error: Call to a member function error() on a non-object in /htdocs/project/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php on line 47
After you downloaded a blank Laravel project you have to run composer install before you start your work. It will install all dependences and this error should be gone.

PHP Fatal error: Class 'Doctrine\\DBAL\\Platforms\\MySqlPlatform' not found

I have a symfony 2 project. It was running just fine two different ubuntu systems. Now I have deployed it to an OpenShift instance and get this error:
PHP Fatal error: Class 'Doctrine\\DBAL\\Platforms\\MySqlPlatform' not found in /var/lib/openshift/552ba6ecfcf93371e600007a/app-root/runtime/repo/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php on line 80
I have no idea where to look for the error. Any ideas?
Please check the file permissions. Is it executable? Does it exist at all?
The solution was:
- remove folder "vendor"
- remove file composer.lock
php composer.phar self-update
php composer.phar install
All good now

Problems with installing Symfony 2?

I installed Composer successfully and now I'm trying to install Symfony 2 on a Macbook 10.5.8.
I downloaded Symfony Standard 2.5.0 (.tgz) on http://symfony.com/download and I tried to use the create-project command to generate a new Symfony application using
php composer.phar create-project symfony/framework-standard-edition path/to/install
but I get this error:
Fatal error: Class 'Phar' not found in /Users/jenisawesome/composer.phar on line 13
Maybe it's because I have an old php version? I'm not sure. I can't even run Composer when I type in this command:
php composer.phar
I get the same error:
Fatal error: Class 'Phar' not found in /Users/jenisawesome/composer.phar on line 13
Based on discussion in the comments, this error appears to be because you're using PHP 5.2. Composer required at least 5.3.2 to run.
Aside from that, this question appears to be a duplicate of PHP: Class 'Phar' not found

DNODE PHP Fatal error: Class 'React\EventLoop\StreamSelectLoop'

I am installing dnode-php from github repository.
I am running PHP 5.3.10 and Composer. I used the composer.json file included in the above repository to generate my autoload.php files.
When I go to run server.php I get the following message:
PHP Fatal error: Class 'React\EventLoop\StreamSelectLoop' not found in /home/chelsea/dnode-php-master/examples/simple/server.php on line 16
How do I fix this error?
You want to download the React library for this. And then your issue will be solved out.

Categories