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
Related
Im trying to start a fresh project and am following this guide:
php version: 8.1.9
Composer version: 1.9.0
I'm able to create a project and have tried a few things like installing, updating, updating -- no script, clearing the dump, but it all turns out to me not being able to run php artisan serve
most errors point to the auto load on the fresh load but whenever i've composer dump-autoload and tried and updated and tried this does not solve anything. I've followed this source and cannot find any answers for my solution
Here are my reproduction steps:
visit the laravel install page.
create basic application using composer create-project laravel/laravel example-app
cd into the app
composer update
composer install
when running php artisan serve
error recieved:
PHP Warning:
require(/someapp/vendor/autoload.php): Failed to open stream: No such file or directory in /someapp/artisan on line 18
after running composer dump-autoload
PHP Fatal error: Uncaught Error: Class "Illuminate\Foundation\Application" not found in /Documents/someapp/bootstrap/app.php:14```
I haven't been building applications with laravel in a while, and I'm trying to recall by running the code
composer create-project --prefer-dist laravel/laravel:^7.0 apitestku
at the end of the installation there is an error:
73 package suggestions were added by new dependencies, use composer suggest to see details. Package fzaninotto/faker is abandoned, you
should avoid using it. No replacement was suggested. Package
phpunit/php-token-stream is abandoned, you should avoid using it. No
replacement was suggested.
Generating optimized autoload files
Illuminate\Foundation\ComposerScripts::postAutoloadDump
Fatal error: Interface
'Symfony\Component\HttpKernel\HttpKernelInterface' not found in C:\laravel\apitestku\vendor\laravel\framework\src\Illuminate\Foundation\Application.php on line 29
At first I ignored the problem and ran right away php artisan serve and i got the error
Fatal error: Interface
'Symfony\Component\HttpKernel\HttpKernelInterface' not found in C:\laravel\apitestku\vendor\laravel\framework\src\Illuminate\Foundation\Application.php on line 29
again.
what's causing 'Symfony\Component\HttpKernel\HttpKernelInterface' not found?
i try this solution but not working,
i try solution from Github it's same.
and how to fix it?
I try to setup a laravel project using composer with this command
composer create-project laravel/laravel blog "5.1.*"
But i got following error:
Script php artisan clear-compiled handling the pre-update-cmd event returned with an error
[RuntimeException]
Error Output: PHP Warning: require(/home/iwan/blog/bootstrap/../vendor/aut
oload.php): failed to open stream: No such file or directory in /home/iwan/
blog/bootstrap/autoload.php on line 17
PHP Fatal error: require(): Failed opening required '/home/iwan/blog/boots
trap/../vendor/autoload.php' (include_path='.:/usr/share/php:/usr/share/pea
r') in /home/iwan/blog/bootstrap/autoload.php on line 17
Does anybody know how to fix this ?
Thank you
Actually, the project is created but the dependencies are not installed so open your terminal/command prompt and run following commands:
cd blog
composer install
Also, if you want then, you may install the Laravel installer so you can create a new project using something like the following:
laravel new Blog
This is a little bit faster. So to install the installer you need to run the following command from the command prompt/terminal:
composer global require "laravel/installer=~1.1"
Once you install the installer you may then run laravel new someproject from the terminel to create a new project with all the dependencies (According to Documentation).
Note: Check this and this as well if needed.
After upgrading from Symfony 2.3 to 2.8 I get the following error:
Fatal error: Interface
'Symfony\Component\HttpKernel\HttpKernelInterface' not found in
app/bootstrap.php.cache on line 2629
Already tried removing the vendor folder and doing a composer install.
Any ideas?
Have you tried removing cached code? It seems like you've procompiled your application into one file bootstrap.php.cache. Have you tried removing it.
Otherwise it is always a good idea to do two of the following commands:
php composer.phar dump-autoload - update autolod file
php app/console cache:clear - removes cache
I had to add the following line to web/app.php and web/app_dev.php:
$loader = require __DIR__.'/../app/autoload.php';
And also update app/console.
Found this by comparing my files with a fresh install of Symfony 2.8
I've installed solarium with composer using below commands in ubuntu:
php composer.phar require solarium/solarium
I've also used silex micro framework. After installing solarium, when I tried to run sample php file in examples folder, I got error
"Fatal error: Class 'Solarium\Client' not found in
/api/vendor/solarium/solarium/examples/1.1-check-solarium-and-ping.php on line 7"
How to get this work as expected?
I want to use both silex and solarium in a project.