Error Creating New Symfony 2.7 Project Using Symfony Installer - php

I am trying to create a brand new Symfony 2.7 project and I'm following the installation instructions in the Symfony Book. I am running Mac OS 10.10.2. My php version is 5.4. When I try to create the new project with the following command:
$ symfony new myproject
I get the following error:
PHP Warning: require(phar:///usr/local/bin/symfony/symfony): failed to open stream: phar error: Cannot open temporary file for decompressing phar archive "/usr/local/bin/symfony" file "symfony" in /usr/local/bin/symfony on line 10
Warning: require(phar:///usr/local/bin/symfony/symfony): failed to open stream: phar error: Cannot open temporary file for decompressing phar archive "/usr/local/bin/symfony" file "symfony" in /usr/local/bin/symfony on line 10
PHP Fatal error: require(): Failed opening required 'phar:///usr/local/bin/symfony/symfony' (include_path='.:/usr/local/zend/share/ZendFramework/library:/usr/local/zend/share/pear') in /usr/local/bin/symfony on line 10
Fatal error: require(): Failed opening required 'phar:///usr/local/bin/symfony/symfony' (include_path='.:/usr/local/zend/share/ZendFramework/library:/usr/local/zend/share/pear') in /usr/local/bin/symfony on line 10
In the past I have created Symfony projects using composer and have had no issues. Any help is greatly appreciated.

I use these steps (under Linux) because I had the same errors:
in your public_html directory launch these commands to create a "local" symfony installer file (not /usr/local/bin/symfony like explain in https://github.com/symfony/symfony-installer)
curl -LsS http://symfony.com/installer -o symfony
chmod +x symfony
then launch the installer for symfony demo application with php
php symfony demo
or create a new symfony project
php symfony new project_name
then visit http://localhost/symfony_demo/web/config.php or http://localhost/project_name/web/config.php to configure the symfony project
PS: check the permission of file or directories

Related

Composer install Symfony 3.4 - bootstrap.php.cache

During the installation of my project, I had to install and update my composer. However I can't do it beacause composer tells me this :
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
Warning: require_once(C:\Projects\private\p1\../app/bootstrap.php.cache): failed to open stream: No such file or directory in C:\Projects\private\p1\bin\console on line 11
Fatal error: require_once(): Failed opening required 'C:\Projects\private\p1\bin/../app/bootstrap.php.cache' (include_path='.;C:\php\pear') in C:\Projects\private\p1\bin\console on line 11
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception
[RuntimeException]
An error occurred when executing the ""cache:clear --no-warmup"" command:
Warning: require_once(C:\Projects\private\p1\bin/../app/bootstrap.php.cache): failed to open stream
: No such file or directory in C:\Projects\private\p1\bin\console on line 11
Fatal error: require_once(): Failed opening required 'C:\Projects\private\p1\bin/../app/bootstrap.php.cache' (include_path='.;C:\php\pear') in C:\Projects\private\p1\bin\console on line 11
I've been searching an answer for 2 days and I've tried everything I coulded see on the internet...
I don't know if you need something else but please help me
If the bootstrap.php.cache file was not created for different reasons. Normally it should be generated after running composer install in your project directory.
If you need to generate it manually, just run the following command in your Symfony project folder:
php vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php
If you have the new Symfony 3 folder structure you need to add three arguments:
php vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php var app new
The file will then be generate in var/bootstrap.php.cache instead of app/bootstrap.php.cache.
Steps to solve your problem :
run this command : bin/console cache:clear --env=prod
run this chown www-data:www-data projectDirectory
run this command SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
run this command chown www-data:www-data projectDirectory

cant launch laravel site

Ive tried setting up a laravel instance many times now on Ubuntu 16.04 system. I have php5.6 and apache2 installed. Installed composer following the instructions on there site and than ran (composer global require "laravel/installer") to install laravel.
I've added (export PATH="~/.composer/vendor/bin:$PATH") to .bashrc and then create new laravel project with laravel new project. to test if it was working I cd into project and ran (php artisan serve) but keep coming up with
PHP Warning: require(/home/dave/project/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /home/dave/project/bootstrap/autoload.php on line 17
PHP Fatal error: require(): Failed opening required '/home/dave/project/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/php') in /home/dave/project/bootstrap/autoload.php on line 17
Can anyone help get me going.

Laravel - Can't run project

A friend send me a project but it is give me an error when i try run.
I go to project location and execute php artisan serve but i have this error:
Fatal error: require(): Failed opening required '/project1/bootstrap/../vendor/autoload.php' (include_path='.:') in /project1/bootstrap/autoload.php on line 17
When i run composer install i have this error:
[ErrorException]
file_put_contents(/project1/rev2/bootstrap/cache/ser
vices.php): failed to open stream: No such file or directory
What is the problem?
Thank you
Do you compose installed ? if not you can install it form here.
https://getcomposer.org/
Once composer is installed then you can run php artisan serve or you can place the project in the wamp/xampp project directory and run like this.
http://localhost/projectname/public
Make sure you have /project1/rev2/bootstrap/cache directory in your project location if not, you have to manually create it.

Why am I getting this error message after I obtained my Laravel project from my GIT repository?

I am new in Laravel and I have the following problem.
I developed a Laravel 5 project on an old computer, and I put the code on a GIT repository. I retrieved my source code on my new laptop from the repository.
But I am facing problems while running the Laravel project on Apache and I am obtaining this error message on my Laravel website instead:
Warning: require(C:\xampp\htdocs\HotelRegistration\bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in C:\xampp\htdocs\HotelRegistration\bootstrap\autoload.php on line 17
Fatal error: require(): Failed opening required 'C:\xampp\htdocs\HotelRegistration\bootstrap/../vendor/autoload.php' (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\HotelRegistration\bootstrap\autoload.php on line 17
The C:\xampp\htdocs\HotelRegistration\bootstrap\autoload.php is present in my project
Why am I facing this issue? What is the problem? What am I missing? How can I fix this issue? How can I try to solve this issue?
You need to run
composer install
command to install packages. By default vendor directory is ignored when committing to GIT (this is good) so if you pull data from repository you need to install all packages running above command.

cakephp 3 failed to open vendor/autoload.php after cloning a git repository

I have a git repository which is a simple cakephp3 application. (i cant share because that is private).
i forked the repository and cloned it to my local directory, but as i open the url it gives me this error:
Warning: require(C:\xampp\htdocs\cakephp\shopinator\sms\smsv3\vendor\autoload.php): failed to open stream: No such file or directory in C:\xampp\htdocs\cakephp\shopinator\sms\smsv3\config\bootstrap.php on line 23 Fatal error: require(): Failed opening
required 'C:\xampp\htdocs\cakephp\shopinator\sms\smsv3\vendor\autoload.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\cakephp\shopinator\sms\smsv3\config\bootstrap.php on line 23
I also have composer installed and is recognizable. I'm using git bash.
the same repository is running fine on another machine.
Any help would be appreciated.
Update:
I've tried it this way:
I'm installing cakephp 3 using composer, it still gives me the same error.
composer create-project cakephp/app
I've also tried this but no luck.
Update:
with this command
composer create-project --prefer-dist cakephp/app
the fresh installation worked.
I've solved the problem.
I downloaded the composer.phar file from packagist.org
and executed the following commands in my application root.
php composer.phar install
Now i don't have that autoload.php issues.

Categories