Laravel Homestead new project error - homestead

On my Win8 machine I installed Laravel Homestead box using git. (OracleVM+Vagrant).
Homestead.yaml
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/Code
to: /home/vagrant/Code
sites:
- map: newProject.local
to: /home/vagrant/Code/newProject/public
databases:
- homestead
I start the VM using:
cd Homestead
vagrant up
vagrant ssh
And everything works.
If I understand correctly, I still need to create a newProject in my Code/ folder.
cd Code
composer create-project --prefer-dist laravel/laravel newProject
This would work if I where on a lamp server, but instead I get the following error:
You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
Installing laravel/laravel (v5.2.15)
- Installing laravel/laravel (v5.2.15)
Loading from cache
Created project in newProject
> php -r "copy('.env.example', '.env');"
> php artisan clear-compiled
PHP Warning: require(/home/vagrant/newProject/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /home/vagrant/newProject/bootstrap/autoload.php on line 17
PHP Stack trace:
PHP 1. {main}() /home/vagrant/newProject/artisan:0
PHP 2. require() /home/vagrant/newProject/artisan:16
Warning: require(/home/vagrant/newProject/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /home/vagrant/newProject/bootstrap/autoload.php on line 17
Call Stack:
0.0001 352008 1. {main}() /home/vagrant/newProject/artisan:0
0.0001 353760 2. require('/home/vagrant/newProject/bootstrap/autoload.php') /home/vagrant/newProject/artisan:16
PHP Fatal error: require(): Failed opening required '/home/vagrant/newProject/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/php:') in /home/vagrant/newProject/bootstrap/autoload.php on line 17
PHP Stack trace:
PHP 1. {main}() /home/vagrant/newProject/artisan:0
PHP 2. require() /home/vagrant/newProject/artisan:16
Fatal error: require(): Failed opening required '/home/vagrant/newProject/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/php:') in /home/vagrant/newProject/bootstrap/autoload.php on line 17
Call Stack:
0.0001 352008 1. {main}() /home/vagrant/newProject/artisan:0
0.0001 353760 2. require('/home/vagrant/newProject/bootstrap/autoload.php') /home/vagrant/newProject/artisan:16
Script php artisan clear-compiled handling the pre-update-cmd event returned with an error
[RuntimeException]
Error Output: PHP Warning: require(/home/vagrant/newProject/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /home/vagrant/newProject/bootstrap/autoload.php on line 17
PHP Stack trace:
PHP 1. {main}() /home/vagrant/newProject/artisan:0
PHP 2. require() /home/vagrant/newProject/artisan:16
PHP Fatal error: require(): Failed opening required '/home/vagrant/newProject/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/php:') in /home/vagrant/newProject/bootstrap/autoload.php on line
17
PHP Stack trace:
PHP 1. {main}() /home/vagrant/newProject/artisan:0
PHP 2. require() /home/vagrant/newProject/artisan:16
Any ideas why would that happen?
I tried to cp a working project and still get the required error.
I found similar errors that had something to do with missing dependencies, but shouldn't Homestead deal with that by himself?

Looks like this was a composer problem. I just tried again and it works. More about it on Laravel News: https://laravel-news.com/2016/03/may-need-update-composer-json-file/

Related

PHP Fatal error returned when creating a new Symfony3 Project [duplicate]

Am new to symfony and from last month am continuously installing new symfony project using following command on ubuntu from the terminal
# Linux, Mac OS X
$ symfony new my_project_name
and it was working perfectly until today, but than just checked the new version release, but now it started giving me following error
Downloading Symfony...
4.93 MB/4.93 MB ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100%
Preparing project...
PHP Warning: require(/var/www/projectname/app/SymfonyRequirements.php): failed to open stream: No such file or directory in phar:///usr/local/bin/symfony/src/Symfony/Installer/DownloadCommand.php on line 265
PHP Stack trace:
PHP 1. {main}() /usr/local/bin/symfony:0
PHP 2. require() /usr/local/bin/symfony:10
PHP 3. Symfony\Component\Console\Application->run() phar:///usr/local/bin/symfony/symfony:35
PHP 4. Symfony\Component\Console\Application->doRun() phar:///usr/local/bin/symfony/vendor/symfony/console/Application.php:126
PHP 5. Symfony\Component\Console\Application->doRunCommand() phar:///usr/local/bin/symfony/vendor/symfony/console/Application.php:195
PHP 6. Symfony\Component\Console\Command\Command->run() phar:///usr/local/bin/symfony/vendor/symfony/console/Application.php:878
PHP 7. Symfony\Installer\NewCommand->execute() phar:///usr/local/bin/symfony/vendor/symfony/console/Command/Command.php:259
PHP 8. Symfony\Installer\DownloadCommand->checkSymfonyRequirements() phar:///usr/local/bin/symfony/src/Symfony/Installer/NewCommand.php:65
PHP Fatal error: require(): Failed opening required '/var/www/projectname/app/SymfonyRequirements.php' (include_path='.:/usr/share/php:/usr/share/pear') in phar:///usr/local/bin/symfony/src/Symfony/Installer/DownloadCommand.php on line 265
PHP Stack trace:
PHP 1. {main}() /usr/local/bin/symfony:0
PHP 2. require() /usr/local/bin/symfony:10
PHP 3. Symfony\Component\Console\Application->run() phar:///usr/local/bin/symfony/symfony:35
PHP 4. Symfony\Component\Console\Application->doRun() phar:///usr/local/bin/symfony/vendor/symfony/console/Application.php:126
PHP 5. Symfony\Component\Console\Application->doRunCommand() phar:///usr/local/bin/symfony/vendor/symfony/console/Application.php:195
PHP 6. Symfony\Component\Console\Command\Command->run() phar:///usr/local/bin/symfony/vendor/symfony/console/Application.php:878
PHP 7. Symfony\Installer\NewCommand->execute() phar:///usr/local/bin/symfony/vendor/symfony/console/Command/Command.php:259
PHP 8. Symfony\Installer\DownloadCommand->checkSymfonyRequirements() phar:///usr/local/bin/symfony/src/Symfony/Installer/NewCommand.php:65
I have even check the symfony at location usr/local/bin/symfony and it was there.
It is a resolved issue that you need to specify the version you want to install. As described here and here, you need to:
Update your installer
>symfony self-update
or with sudo, depending on how you install it:
>sudo symfony self-update
Specify the version:
>symfony new my_project_name 3.0
Hope this helps.
UPDATE
With the correct resolutions of the bug on the Symfony installer, now the 3.0 is the default version. In other case, you can specify the complete version (with minor and major) as follows:
>symfony new my_project_name 3.0.0

Symfony2 Bootstrap.php.cache

I'm developing in Ubuntu 14 and I get the following error when creating a databaes:
$ php app/console doctrine:database:create
This is the error output:
PHP Warning: require_once(/home/jesse/playground/www/symfony/htdocs/app/bootstrap.php.cache):
failed to open stream: No such file or directory in
/home/jesse/playground/www/symfony/htdocs/app/console on line 10
PHP Fatal error: require_once(): Failed opening required
'/home/jesse/playground/www/symfony/htdocs/app/bootstrap.php.cache'
(include_path='.:/usr/share/php:/usr/share/pear') in
/home/jesse/playground/www/symfony/htdocs/app/console on line 10
What Ive Tried
Running this in Vagrant
Running this Locally
This is one among several problem running Symfony2 under Ubuntu, the other forcing you to implement umask(0000) otherwise you have to get chmod +a permissions for log and cache folders, this seems like a bit of a hassle for something seemingly simple.
Does anyone know what to work around this error?
This should do the trick:
php /home/jesse/playground/www/symfony/htdocs/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php

PhpStorm 7.1.3, XDebug 2.2.3, Symfony 2.4 - WebTestCase not found

I'm getting the following error when attempting to run my own Symfony unit tests in PhpStorm:
/usr/bin/php /home/kevin/www/src/Blah/MyBundle/Tests/Controller/HomeControllerTest.php
PHP Fatal error: Class 'Symfony\Bundle\FrameworkBundle\Test\WebTestCase' not found in /home/kevin/www/src/Blah/MyBundle/Tests/Controller/HomeControllerTest.php on line 8
PHP Stack trace:
PHP 1. {main}() /home/kevin/www/src/Blah/MyBundle/Tests/Controller/HomeControllerTest.php:0
Fatal error: Class 'Symfony\Bundle\FrameworkBundle\Test\WebTestCase' not found in /home/kevin/www/src/Blah/MyBundle/Tests/Controller/HomeControllerTest.php on line 8
Call Stack:
0.0002 234112 1. {main}() /home/kevin/www/src/Blah/MyBundle/Tests/Controller/HomeControllerTest.php:0
Process finished with exit code 255
Some research has informed me that I may have to point PhpStorm/Xdebug to Symfony's bootstrap and/or test suite XML file, but I'm not sure how to do that in PhpStorm. Nothing is jumping out at me in the various config screens. Please help.
Although I'm using IntelliJ IDEA, the configuration is the same, so:
Settings -> PHP -> PHPUnit - there are inputs for bootstrap and config

Fixtures installation error in sylius?

I want to install fixtures in sylius i used below command to install it that are as below
php app/console sylius:install --fixtures
when i ran above command i get error as
>PHP Fatal error: Class 'ResourceBundle' not found in C:\wamp\www\sylius\sylius\vendor\symfony\symfony\src\Symfony\Component\Locale\Locale.php on line 51
PHP Stack trace:
PHP 1. {main}() C:\wamp\www\sylius\sylius\app\console:0
PHP 2. Symfony\Component\Console\Application->run() C:\wamp\www\sylius\sylius\app\console:28
PHP 3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() C:\wamp\www\sylius\sylius\vendor\symfon
y\symfony\src\Symfony\Component\Console\Application.php:106
PHP 4. Symfony\Component\Console\Application->doRun() C:\wamp\www\sylius\sylius\vendor\symfony\symfony\src
\Symfony\Bundle\FrameworkBundle\Console\Application.php:78
PHP 5. Symfony\Component\Console\Command\Command->run() C:\wamp\www\sylius\sylius\vendor\symfony\symfony\s
rc\Symfony\Component\Console\Application.php:193
PHP 6. Sylius\Bundle\CoreBundle\Command\InstallCommand->execute() C:\wamp\www\sylius\sylius\vendor\symfony
\symfony\src\Symfony\Component\Console\Command\Command.php:242
PHP 7. Symfony\Component\Console\Command\Command->run() C:\wamp\www\sylius\sylius\src\Sylius\Bundle\CoreBu
ndle\Command\InstallCommand.php:80
PHP 8. Doctrine\Bundle\FixturesBundle\Command\LoadDataFixturesDoctrineCommand->execute() C:\wamp\www\syliu
s\sylius\vendor\symfony\symfony\src\Symfony\Component\Console\Command\Command.php:242
PHP 9. Doctrine\Common\DataFixtures\Executor\ORMExecutor->execute() C:\wamp\www\sylius\sylius\vendor\doctr
ine\doctrine-fixtures-bundle\Doctrine\Bundle\FixturesBundle\Command\LoadDataFixturesDoctrineCommand.php:106
PHP 10. Doctrine\ORM\EntityManager->transactional() C:\wamp\www\sylius\sylius\vendor\doctrine\data-fixtures
\lib\Doctrine\Common\DataFixtures\Executor\ORMExecutor.php:85
PHP 11. call_user_func() C:\wamp\www\sylius\sylius\vendor\doctrine\orm\lib\Doctrine\ORM\EntityManager.php:2
23
PHP 12. Doctrine\Common\DataFixtures\Executor\ORMExecutor->Doctrine\Common\DataFixtures\Executor\{closure}(
) C:\wamp\www\sylius\sylius\vendor\doctrine\orm\lib\Doctrine\ORM\EntityManager.php:223
PHP 13. Doctrine\Common\DataFixtures\Executor\AbstractExecutor->load() C:\wamp\www\sylius\sylius\vendor\doc
trine\data-fixtures\lib\Doctrine\Common\DataFixtures\Executor\ORMExecutor.php:83
PHP 14. Sylius\Bundle\CoreBundle\DataFixtures\ORM\LoadCountriesData->load() C:\wamp\www\sylius\sylius\vendo
r\doctrine\data-fixtures\lib\Doctrine\Common\DataFixtures\Executor\AbstractExecutor.php:120
PHP 15. Symfony\Component\Locale\Locale::getDisplayCountries() C:\wamp\www\sylius\sylius\src\Sylius\Bundle\
CoreBundle\DataFixtures\ORM\LoadCountriesData.php:31
I try to install resource bundle when i got the above error but it also failed to install.
Is there any other way is avilable to install fixtures in sylius?
Please share some knowledge..Thanks in advance.
You need to have intl installed on your environment. Symfony does not provide a stub class for "en" locale.

Problems with cap deploy a symfony2 project, can't find app/bootstrap.php.cache

I'm trying (for the first time) to use capifony to deploy my site from my github repo. It runs right through to the setup phase and has this error:
** [out :: example.me] PHP Warning: require_once(/var/www/example/prod/releases/20111208212344/app/bootstrap.php.cache): failed to open stream: No such file or directory in /var/www/example/prod/releases/20111208212344/app/console on line 4
** [out :: example.me] PHP Fatal error: require_once(): Failed opening required '/var/www/example/prod/releases/20111208212344/app/bootstrap.php.cache' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/example/prod/releases/20111208212344/app/console on line 4
** [out :: example.me] PHP Warning: require_once(/var/www/example/prod/releases/20111208212344/app/bootstrap.php.cache): failed to open stream: No such file or directory in /var/www/example/prod/releases/20111208212344/app/console on line 4
** [out :: example.me] PHP Fatal error: require_once(): Failed opening required '/var/www/example/prod/releases/20111208212344/app/bootstrap.php.cache' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/example/prod/releases/20111208212344/app/console on line 4
command finished in 106300ms
* executing `symfony:assets:install'
* executing "cd /var/www/example/prod/releases/20111208212344 && php app/console assets:install web --env=prod"
servers: ["example.me"]
[example.me] executing command
** [out :: example.me] PHP Warning: require_once(/var/www/example/prod/releases/20111208212344/app/bootstrap.php.cache): failed to open stream: No such file or directory in /var/www/example/prod/releases/20111208212344/app/console on line 4
** [out :: example.me] PHP Fatal error: require_once(): Failed opening required '/var/www/example/prod/releases/20111208212344/app/bootstrap.php.cache' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/example/prod/releases/20111208212344/app/console on line 4
command finished in 1294ms
*** [deploy:update_code] rolling back
* executing "rm -rf /var/www/example/prod/releases/20111208212344; true"
servers: ["example.me"]
[example.me] executing command
command finished in 1329ms
failed: "sh -c 'cd /var/www/example/prod/releases/20111208212344 && php app/console assets:install web --env=prod'" on example.me
Has anyone encoutered this? Any ideas what could be the cause?
It has to do with symlinks to the vendors directory. here is the solution with more detail:
https://github.com/symfony/symfony-standard/pull/215
I was stuck on this for a while, I'm not sure if it's exactly the same issue. When I deployed vi Capifony, the bootstrap.php.cache file was pointing to my FormBundle.php file, but in a previous release folder tha no longer existed. I took a look at the code in vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php and the path it uses is realpath(DIR.'/../../../../../../../../app') - hardcoded path, wtf? The problem with this is that my vendor folder is outside of mySymfony setup in a shared folder, so that realpath points to nothing useful.
It does however checking for an server variable ($_SERVER('argv')) a bit further up in the code, so I just set that in the vhosts adding this to the file:
SetEnv argv /var/www/njc-forms/current
Hope that helps someone out there.

Resources