Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Composer insallation methods fails #7082

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
a-lababsa opened this issue Feb 15, 2013 · 28 comments
Closed

Composer insallation methods fails #7082

a-lababsa opened this issue Feb 15, 2013 · 28 comments

Comments

@a-lababsa
Copy link

I'm trying to install the latest version of Symfony with the Composer methods, but when I type php composer.phar create-project symfony/framework-standard-edition Symfony 2.1.7, I get this :

Installing symfony/framework-standard-edition (v2.1.7)

    Installing symfony/framework-standard-edition (v2.1.7) Downloading: 100%

Created project in Symfony
Loading composer repositories with package information
Installing dependencies from lock file

    Installing jdorn/sql-formatter (v1.2.0)
    Loading from cache

   [...]

    Installing symfony/swiftmailer-bundle (v2.1.7)
    Loading from cache

    Installing twig/extensions (dev-master 5c2d515)
    Cloning 5c2d515d4624bdd588226d688173cf0399a4d8cf

kriswallsmith/assetic suggests installing leafo/lessphp (Assetic provides the in
tegration with the lessphp LESS compiler)
kriswallsmith/assetic suggests installing leafo/scssphp (Assetic provides the in
tegration with the scssphp SCSS compiler)
kriswallsmith/assetic suggests installing ptachoire/cssembed (Assetic provides t
he integration with phpcssembed to embed data uris)
kriswallsmith/assetic suggests installing leafo/scssphp-compass (Assetic provide
s the integration with the SCSS compass plugin)
monolog/monolog suggests installing mlehner/gelf-php (Allow sending log messages
to a GrayLog2 server)
monolog/monolog suggests installing ext-amqp (Allow sending log messages to an A
MQP server (1.0+ required))
monolog/monolog suggests installing ext-mongo (Allow sending log messages to a M
ongoDB server)
Generating autoload files
PHP Warning: require_once(app/autoload.php): failed to open stream: No such fil
e or directory in C:\wamp\www\Symfony\vendor\sensio\distribution-bundle\Sensio\B
undle\DistributionBundle\Resources\bin\build_bootstrap.php on line 24
PHP Stack trace:
PHP 1. {main}() C:\wamp\www\Symfony\vendor\sensio\distribution-bundle\Sensio\B
undle\DistributionBundle\Resources\bin\build_bootstrap.php:0
PHP Fatal error: require_once(): Failed opening required 'app/autoload.php' (in
clude_path='.;C:\php\pear') in C:\wamp\www\Symfony\vendor\sensio\distribution-bu
ndle\Sensio\Bundle\DistributionBundle\Resources\bin\build_bootstrap.php on line
24
PHP Stack trace:
PHP 1. {main}() C:\wamp\www\Symfony\vendor\sensio\distribution-bundle\Sensio\B
undle\DistributionBundle\Resources\bin\build_bootstrap.php:0

Warning: require_once(app/autoload.php): failed to open stream: No such file or
directory in C:\wamp\www\Symfony\vendor\sensio\distribution-bundle\Sensio\Bundle
\DistributionBundle\Resources\bin\build_bootstrap.php on line 24

Call Stack:
0.0010 632720 1. {main}() C:\wamp\www\Symfony\vendor\sensio\distributi
on-bundle\Sensio\Bundle\DistributionBundle\Resources\bin\build_bootstrap.php:0

Fatal error: require_once(): Failed opening required 'app/autoload.php' (include
_path='.;C:\php\pear') in C:\wamp\www\Symfony\vendor\sensio\distribution-bundle\
Sensio\Bundle\DistributionBundle\Resources\bin\build_bootstrap.php on line 24

Call Stack:
0.0010 632720 1. {main}() C:\wamp\www\Symfony\vendor\sensio\distributi
on-bundle\Sensio\Bundle\DistributionBundle\Resources\bin\build_bootstrap.php:0

Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap h
andling the post-install-cmd event terminated with an exception

[RuntimeException]
An error occurred when generating the bootstrap file.

create-project [-s|--stability="..."] [--prefer-source] [--prefer-dist] [--repos
itory-url="..."] [--dev] [--no-custom-installers] [--no-scripts] [--no-progress]
[--keep-vcs] package [directory] [version]

I don't know whether this has to do with Composer or Symfony standard edition...

@vicb
Copy link
Contributor

vicb commented Feb 15, 2013

I have shorten the log to display the more intertesting parts.

What procedure did you use to install sf (please list the all commands)

@stof
Copy link
Member

stof commented Feb 15, 2013

@vicb see the beginningof the description (I have added the markup to make the command look like a code snippet)

@vicb
Copy link
Contributor

vicb commented Feb 15, 2013

oops sorry.

I have no problem when executing this command. Could you please try again. If this still does not work what is the content of you app folder (is there an autoload.php there ?).

@vicb
Copy link
Contributor

vicb commented Feb 15, 2013

could be an issue with composer, try to update to the latest version php composer.phar self-update

@greg0ire
Copy link
Contributor

@vicb: the OP told me he had an autoload.php file before I directed him here.

@vicb
Copy link
Contributor

vicb commented Feb 15, 2013

Must be a pb with the path:

Fatal error: require_once(): Failed opening required 'app/autoload.php' (include _path='.;C:\php\pear') in C:\wamp\www\Symfony\vendor\sensio\distribution-bundle\ Sensio\Bundle\DistributionBundle\Resources\bin\build_bootstrap.php on line 24

Can anybody on windows try this command and report if it works or not ?

@darenc
Copy link

darenc commented Feb 16, 2013

I got here via Google, after running to the same problem. I've only just installed Composer, so that is up to date.

composer create-project symfony/framework-standard-edition c2ctc 2.1.7

Result:

H:\Projects\new.c2ctc.com>composer create-project symfony/framework-standard-edition c2ctc 2.1.7
Installing symfony/framework-standard-edition (v2.1.7)
  - Installing symfony/framework-standard-edition (v2.1.7)
    Loading from cache

Created project in c2ctc
Loading composer repositories with package information
...

Generating autoload files

Warning: require_once(app/autoload.php): failed to open stream: No such file or directory in H:\Projects\new.c2ctc.com\c2ctc\vendor\sensio\distribution-bundle\S
ensio\Bundle\DistributionBundle\Resources\bin\build_bootstrap.php on line 24

Fatal error: require_once(): Failed opening required 'app/autoload.php' (include_path='.;C:\xampp\php\PEAR') in H:\Projects\new.c2ctc.com\c2ctc\vendor\sensio\di
stribution-bundle\Sensio\Bundle\DistributionBundle\Resources\bin\build_bootstrap.php on line 24
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap handling the post-install-cmd event terminated with an exception

  [RuntimeException]
  An error occurred when generating the bootstrap file.

Versions:

H:\Projects\new.c2ctc.com>composer
   ______
  / ____/___  ____ ___  ____  ____  ________  _____
 / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
                    /_/
Composer version 940c2a079d7a8b145f025279227078a6bb0cded6

H:\Projects\new.c2ctc.com>php -v
PHP 5.4.7 (cli) (built: Sep 12 2012 23:48:31)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies

There is an app/autoload.php in the c2ctc directory:

H:\Projects\new.c2ctc.com>dir autoload.php /s
 Volume in drive H is Programs
 Volume Serial Number is B43D-532D

 Directory of H:\Projects\new.c2ctc.com\c2ctc\app

16/02/2013  18:04               474 autoload.php
               1 File(s)            474 bytes

But the include path only includes the current directory and PEAR, so rather than require_once app/autoload.php it seems the bootstrap file should be trying to require [directory]/app/autoload.php or something (I haven't spent much time checking how the bootstrap script is called or what it does, mind).

Running the file by itself from the original directory (one above the directory into which things were being installed) doesn't generate any errors, and checking the CWD seems to give the right result in that context:

H:\Projects\new.c2ctc.com>php c2ctc\vendor\sensio\distribution-bundle\Sensio\Bundle\DistributionBundle\Resources\bin\build_bootstrap.php

H:\Projects\new.c2ctc.com>
die("want to load: $appDir/autoload.php");
H:\Projects\new.c2ctc.com>php c2ctc\vendor\sensio\distribution-bundle\Sensio\Bundle\DistributionBundle\Resources\bin\build_bootstrap.php
want to load: H:\Projects\new.c2ctc.com\c2ctc\app/autoload.php

@vicb
Copy link
Contributor

vicb commented Feb 16, 2013

Ccing the pro @Seldaek

darenc [email protected] wrote:

I got here via Google, after running to the same problem. I've only
just installed Composer, so that is up to date.

composer create-project symfony/framework-standard-edition c2ctc 2.1.7

Result:

H:\Projects\new.c2ctc.com>composer create-project
symfony/framework-standard-edition c2ctc 2.1.7
Installing symfony/framework-standard-edition (v2.1.7)
 - Installing symfony/framework-standard-edition (v2.1.7)
   Loading from cache

Created project in c2ctc
Loading composer repositories with package information
...

Generating autoload files

Warning: require_once(app/autoload.php): failed to open stream: No such
file or directory in
H:\Projects\new.c2ctc.com\c2ctc\vendor\sensio\distribution-bundle\S
ensio\Bundle\DistributionBundle\Resources\bin\build_bootstrap.php on
line 24

Fatal error: require_once(): Failed opening required 'app/autoload.php'
(include_path='.;C:\xampp\php\PEAR') in
H:\Projects\new.c2ctc.com\c2ctc\vendor\sensio\di
stribution-bundle\Sensio\Bundle\DistributionBundle\Resources\bin\build_bootstrap.php
on line 24
Script
Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
handling the post-install-cmd event terminated with an exception

 [RuntimeException]
 An error occurred when generating the bootstrap file.

Versions:

H:\Projects\new.c2ctc.com>composer
  ______
 / ____/___  ____ ___  ____  ____  ________  _____
/ /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
                   /_/
Composer version 940c2a079d7a8b145f025279227078a6bb0cded6

H:\Projects\new.c2ctc.com>php -v
PHP 5.4.7 (cli) (built: Sep 12 2012 23:48:31)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies

There is an app/autoload.php in the c2ctc directory:

H:\Projects\new.c2ctc.com>dir autoload.php /s
Volume in drive H is Programs
Volume Serial Number is B43D-532D

Directory of H:\Projects\new.c2ctc.com\c2ctc\app

16/02/2013  18:04               474 autoload.php
              1 File(s)            474 bytes

But the include path only includes the current directory and PEAR, so
rather than require_once app/autoload.php it seems the bootstrap file
should be trying to require [directory]/app/autoload.php or something
(I haven't spent much time checking how the bootstrap script is called
or what it does, mind).


Reply to this email directly or view it on GitHub:
#7082 (comment)

@Seldaek
Copy link
Member

Seldaek commented Feb 17, 2013

Sent a PR with a fix (see above), as a workaround if you hit this problem you can just cd in the dir where you installed it, and run composer install manually to finalize the project setup.

fabpot added a commit that referenced this issue Feb 18, 2013
This PR was merged into the 2.0 branch.

Commits
-------

179cd58 [Process] Fix regression introduced in #6620 / 880da01, fixes #7082

Discussion
----------

[Process][2.0] getcwd failure fix

Fix regression introduced in #6620
Fixes #7082

For reference, here is the current behavior I saw:

PHP 5.4.11, windows:

```
5.4.11\php.exe -r "chdir('c:\\'); var_dump(getcwd()); $p = proc_open('pwd', [['pipe', 'r'], ['pipe', 'w'], ['pipe', 'w']], $pipes, null); var_dump(stream_get_contents($pipes[1]));"
string(3) "C:\\"
string(14) "/c/Users/seld\n"
```

(I use pwd which is a unix util so it dumps a funny path, but don't look at that)

PHP 5.5alpha4, windows (seems fixed):

```
5.5.0a4\php.exe  -r "chdir('c:\\'); var_dump(getcwd()); $p = proc_open('pwd', [['pipe', 'r'], ['pipe', 'w'], ['pipe', 'w']], $pipes, null); var_dump(stream_get_contents($pipes[1]));"
string(3) "C:\"
string(3) "/c\n"
```

PHP 5.3.10, ubuntu:

```
php -r "chdir('/'); var_dump(getcwd()); \$p = proc_open('pwd', array(array('pipe', 'r'), array('p
ipe', 'w'), array('pipe', 'w')), \$pipes, null); var_dump(stream_get_contents(\$pipes[1]));"
string(1) "/"
string(2) "/\n"
```

Since the permission issue that #6620 originally was fixing is most likely not gonna happen on windows, this seems like a safe enough compromise. Ideally a check for PHP<5.5 should be introduced, but I would like to be sure it's been fixed and is not just a lucky coincidence (/cc @pierrejoye)

I would recommend merging fast and maybe adding the version check later, since it breaks composer create-project on windows. The workaround being: cd in the dir and run `composer install` again to finalize the project setup.

---------------------------------------------------------------------------

by vicb at 2013-02-17T20:12:17Z

Thanks @Seldaek !

Would you mind creating an issue for the version check so that it doesn't get lost ?

---------------------------------------------------------------------------

by Seldaek at 2013-02-18T10:43:56Z

@vicb done.

---------------------------------------------------------------------------

by vicb at 2013-02-18T11:45:16Z

thanks !
fabpot added a commit that referenced this issue Feb 18, 2013
* 2.0:
  [Process] Fix regression introduced in #6620 / 880da01, fixes #7082
fabpot added a commit that referenced this issue Feb 18, 2013
* 2.1:
  [Process] Fix regression introduced in #6620 / 880da01, fixes #7082
fabpot added a commit that referenced this issue Feb 18, 2013
* 2.2: (22 commits)
  [Process] Fix regression introduced in #6620 / 880da01, fixes #7082
  [HttpKernel] added a unit for the previous commit (closes #7025)
  [HttpFoundation] fixed, overwritten CONTENT_TYPE
  [BrowserKit] fixed test added in the previous merge (refs #7059)
  [FrameworkBundle] tweaked reference dumper command (see #7093)
  Remove unnecessary comment and change test name
  [Config] tweaked dumper to indent multi-line info
  [HttpKernel] added some tests for previous merge
  Fix REMOTE_ADDR for cached subrequests
  [FrameworkBundle] CSRF should be on by default
  [WebProfilerBundle] removed dependency on FrameworkBundle (closes #6949)
  [HttpKernel] added error display suppression when using the ErrorHandler (if not, errors are displayed twice, refs #6254)
  [HttpFoundation] tweaked previous merge
  [HttpFoundation] Added getter for httpMethodParameterOverride state
  Create validators.lv.xlf
  [Process] Warn user with a useful message when tmpfile() failed
  [BrowserKit] added a test to make sure HTTP authentication is preserved when submitting a form
  Remove array type hint from GetResponseForControllerResultEvent::setControllerResult()
  bumped Symfony version to 2.2.0-DEV
  Revert "merged branch povilas/issue_6101 (PR #6708)"
  ...
@Seldaek
Copy link
Member

Seldaek commented Feb 18, 2013

OK the fix was merged and the latest composer now ships with it, so it should all be back to normal.

@vicb
Copy link
Contributor

vicb commented Feb 18, 2013

👍

Jordi Boggiano [email protected] wrote:

OK the fix was merged and the latest composer now ships with it, so it
should all be back to normal.


Reply to this email directly or view it on GitHub:
#7082 (comment)

@ireckon
Copy link

ireckon commented Mar 14, 2013

I have been having this issue this week using latest versions of symfony and composer.

Fatal error: require_once(): Failed opening required 'app/autoload.php' (include_path='.:') in /var/www/mypolitician/www/html/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php on line 24
PHP Fatal error: require_once(): Failed opening required 'app/autoload.php' (include_path='.:') in /var/www/mypolitician/www/html/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php on line 24
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap handling the post-update-cmd event terminated with an exception

So can't see it is fixed for current distributions.

I can manually run the build_bootstrap.php file in its directory but as soon as I run another bundle thsi issue appears again.

From debugging it is getting the wrong path

@vicb
Copy link
Contributor

vicb commented Mar 14, 2013

What are the exact "latest versions" (they change every day !) ?

@ireckon
Copy link

ireckon commented Mar 14, 2013

yesterday, day before and day before that.
deleted and downloaded "latest" (as depicted on download page) each time.

Not sure how to give you exact specific apart from the download which was
Symfony_Standard_2.2.0.tgz

Each version I ran is later than said fix in this thread.

Perhaps you can advise on a simple method for simpletons like me to give
you more exact specifics?

On 14 March 2013 18:24, Victor Berchet [email protected] wrote:

What are the exact "latest versions" (they change every day !) ?


Reply to this email directly or view it on GitHubhttps://github.com//issues/7082#issuecomment-14891149
.


Darryl King

CEO

Ireckon Pty Ltd

Phone: 07 3391 1488

Fax: 07 3391 1293

Web: http://www.ireckon.com http://www.blueglassinteractive.com.au/

Email: [email protected]

@vicb
Copy link
Contributor

vicb commented Mar 14, 2013

If you downloaded Sf2.2.0 then you have 2.2.0 (I was asking in case you use a git version). Your fine on this side.

You can get the composer version by using the --version switch. Use the selfupdate option beforhand.

What would be interesting is to also know your OS version.

Don't worry, you're (probably not) a simpleton :)

@ireckon
Copy link

ireckon commented Mar 14, 2013

Ah cool thanks.
No I do feel like a simpleton - branching in to the new tends to do that to
us :)

Composer version 7b549010d59a45fcdda1cd1e6b6aed9843b6ee4e

O/s = fedora

Thanks
D

On 14 March 2013 18:51, Victor Berchet [email protected] wrote:

If you downloaded Sf2.2.0 then you have 2.2.0 (I was asking in case you
use a git version). Your fine on this side.

You can get the composer version by using the --version switch. Use the
selfupdate option beforhand.

What you be interesting is to also know your OS version.

Don't worry, you're (probably not) a simpleton :)


Reply to this email directly or view it on GitHubhttps://github.com//issues/7082#issuecomment-14891953
.


Darryl King

CEO

Ireckon Pty Ltd

Phone: 07 3391 1488

Fax: 07 3391 1293

Web: http://www.ireckon.com http://www.blueglassinteractive.com.au/

Email: [email protected]

twitter: @ireckon

@vicb
Copy link
Contributor

vicb commented Mar 14, 2013

@ireckon What version of Fedora ? What version of PHP ?

This particular issue was related to windows, there might be a ~similar issue in Fedora.

@ireckon
Copy link

ireckon commented Mar 14, 2013

Ah ok that explains why the fix didn't help.

its php 5.3.21, compiled from sources, for litespeed

On 14 March 2013 19:25, Victor Berchet [email protected] wrote:

@ireckon https://github.com/ireckon What version of Fedora ? What
version of PHP ?

This particular issue was related to windows, there might be a ~similar
issue in Fedora.


Reply to this email directly or view it on GitHubhttps://github.com//issues/7082#issuecomment-14893000
.


Darryl King

CEO

Ireckon Pty Ltd

Phone: 07 3391 1488

Fax: 07 3391 1293

Web: http://www.ireckon.com http://www.blueglassinteractive.com.au/

Email: [email protected]

twitter: @ireckon

@vicb
Copy link
Contributor

vicb commented Mar 14, 2013

@ireckon could you try with a vanilla PHP to narrow down the issue. If a vanilla PHP also have the issue then it is worth creating a new issue in order for the pb to get fixed. If not, you will have to fix it ;)

You might then look at #7102 and try to set up a test case to see if you have a similar pb.

@ireckon
Copy link

ireckon commented Mar 14, 2013

Hi thanks. unfortunately can't do vanilla all our kit is on this spec. SO i
ight have to work out a fix.

But what i find out I will share.

Really appreciate the help.

Might try one vanilla on a local and see what I get

Darryl

On 14 March 2013 19:45, Victor Berchet [email protected] wrote:

@ireckon https://github.com/ireckon could you try with a vanilla PHP to
narrow down the issue. If a vanilla PHP also have the issue then it is
worth creating a new issue in order for the pb to get fixed. If not, you
will have to fix it ;)

You might then look at #7102https://github.com/symfony/symfony/issues/7102and try to set up a test case to see if you have a similar pb.


Reply to this email directly or view it on GitHubhttps://github.com//issues/7082#issuecomment-14893773
.


Darryl King

CEO

Ireckon Pty Ltd

Phone: 07 3391 1488

Fax: 07 3391 1293

Web: http://www.ireckon.com http://www.blueglassinteractive.com.au/

Email: [email protected]

twitter: @ireckon

@ireckon
Copy link

ireckon commented Mar 14, 2013

HI

We did resolve. It was directly related to how litespeed handles requests.
Thanks for your willingness to help. IF anyone ends up with the same issue
be glad to let them know what we had to do.

D

On 14 March 2013 19:45, Victor Berchet [email protected] wrote:

@ireckon https://github.com/ireckon could you try with a vanilla PHP to
narrow down the issue. If a vanilla PHP also have the issue then it is
worth creating a new issue in order for the pb to get fixed. If not, you
will have to fix it ;)

You might then look at #7102https://github.com/symfony/symfony/issues/7102and try to set up a test case to see if you have a similar pb.


Reply to this email directly or view it on GitHubhttps://github.com//issues/7082#issuecomment-14893773
.


Darryl King

CEO

Ireckon Pty Ltd

Phone: 07 3391 1488

Fax: 07 3391 1293

Web: http://www.ireckon.com http://www.blueglassinteractive.com.au/

Email: [email protected]

twitter: @ireckon

@heckfy-ai
Copy link

@ireckon

Hi

ireckon wrote:

We did resolve. It was directly related to how litespeed handles requests. Thanks for your willingness to help. IF anyone ends up with the same issue be glad to let them know what we had to do.

I have the same issue on sharing hosting (Linux 3.8.4-1gb-csm-rcu-exp x86_64). On Windows everything is fine.
Can you please tell how did you resolve the issue?

Very thanks
Ruslan

= = = end of my log = = =

Generating autoload files
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap handling the post-install-cmd event terminated with an exception

[RuntimeException]
An error occurred when generating the bootstrap file.

install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [-v|--verbose] [-o|--optimize-autoloader]

X-Powered-By: PHP/5.3.20
Content-type: text/html

X-Powered-By: PHP/5.3.20
Content-type: text/html

Warning: require_once(app/autoload.php): failed to open stream: No such file or directory in /home/virtwww/w_mindweb33e_2da99b40/http/Symfony/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php on line 23

Fatal error: require_once(): Failed opening required 'app/autoload.php' (include_path='.:') in /home/virtwww/w_mindweb33e_2da99b40/http/Symfony/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php on line 23

@heckfy-ai
Copy link

I have the same issue on sharing hosting (Linux 3.8.4-1gb-csm-rcu-exp x86_64). On Windows everything is fine.

Issue was due to cgi-version of php, that was preconfigured as default php-interpreter on shared hosting.
Switching to php-cli resolved issue.

@Seldaek
Copy link
Member

Seldaek commented Apr 9, 2013

@heckfy-ai thanks for letting us know. I added a check for that in composer so you get a proper warning instead of weird errors.

@atamashi
Copy link

Hello, help me please. I use Symfony 2.3 . Today this is my issue:

  1. Consola

/home4/atamashi/Ezkua$ /opt/php53/bin/php -v
PHP 5.3.27 (cli) (built: Dec 4 2013 12:37:58)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
with the ionCube PHP Loader v4.2.2, Copyright (c) 2002-2012, by ionCube Ltd., and
with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technologies
/home4/atamashi/Ezkua$ /opt/php53/bin/php app/check.php


  •                          *
    
  • Symfony requirements check *

  •                          *
    

  • Configuration file used by PHP: /opt/php53/lib/php.ini

** ATTENTION **

  • The PHP CLI can use a different php.ini file
  • than the one used with your web server.
  • To be on the safe side, please also launch the requirements check
  • from your web server using the web/config.php script.

** Mandatory requirements **

OK PHP version must be at least 5.3.3 (5.3.27 installed)
OK PHP version must not be 5.3.16 as Symfony won't work properly with it
OK Vendor libraries must be installed
OK app/cache/ directory must be writable
OK app/logs/ directory must be writable
OK date.timezone setting must be set
OK Configured default timezone "America/Chicago" must be supported by your installation of PHP
OK json_encode() must be available
OK session_start() must be available
OK ctype_alpha() must be available
OK token_get_all() must be available
OK simplexml_import_dom() must be available
OK detect_unicode must be disabled in php.ini
OK PCRE extension must be available

** Optional recommendations **

OK Requirements file should be up-to-date
OK You should use at least PHP 5.3.4 due to PHP bug #52083 in earlier versions
OK When using annotations you should have at least PHP 5.3.8 due to PHP bug #55156
OK You should not use PHP 5.4.0 due to the PHP bug #61453
WARNING When using the logout handler from the Symfony Security Component, you should have at least PHP 5.4.11 due to PHP bug #63379 (as a workaround, you can also set invalidate_session to false in the security logout handler configuration)
Install PHP 5.4.11 or newer if your project uses the logout handler from the Symfony Security Component.

OK You should use PHP 5.3.18+ or PHP 5.4.8+ to always get nice error messages for fatal errors in the development environment due to PHP bug #61767/#60909
OK PCRE extension should be at least version 8.0 (8.32 installed)
OK PHP-XML module should be installed
OK mb_strlen() should be available
OK iconv() should be available
OK utf8_decode() should be available
OK posix_isatty() should be available
OK intl extension should be available
OK intl extension should be correctly configured
OK intl ICU version should be at least 4+
WARNING a PHP accelerator should be installed
Install and enable a PHP accelerator like APC (highly recommended).

WARNING short_open_tag should be disabled in php.ini
Set short_open_tag to off in php.ini*.

OK magic_quotes_gpc should be disabled in php.ini
OK register_globals should be disabled in php.ini
OK session.auto_start should be disabled in php.ini
OK PDO should be installed
OK PDO should have some drivers installed (currently available: mysql, sqlite, sqlite2)
/home4/atamashi/Ezkua$ curl -s https://getcomposer.org/installer | /opt/php53/bin/php
#!/usr/bin/env php
All settings correct for using Composer
Downloading...

Composer successfully installed to: /home4/atamashi/Ezkua/composer.phar
Use it: php composer.phar
/home4/atamashi/Ezkua$ /opt/php53/bin/php composer.phar update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Generating autoload files
Updating the "app/config/parameters.yml" file

Warning: Unexpected character in input: '' (ASCII=92) state=1 in /home4/atamashi/Ezkua/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php on line 30

Warning: Unexpected character in input: '' (ASCII=92) state=1 in /home4/atamashi/Ezkua/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php on line 30

Parse error: syntax error, unexpected T_STRING in /home4/atamashi/Ezkua/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php on line 30
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap handling the post-update-cmd event terminated with an exception

[RuntimeException]
An error occurred when generating the bootstrap file.

update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [packages1] ... [packagesN]

  1. Answer of Hostgator:

Hello,

Thank you for contacting Hostgator. This error complains about an unexpected string in the file
~atamashi/Ezkua/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php on line 30. Here are the contents of that file:

#!/usr/bin/env php

@sstok
Copy link
Contributor

sstok commented Dec 18, 2013

@atamashi The php version provided by the /usr/bin/env (detected from the $PATH global shell variable) is older then the version shown above.

Executing this on the command line, and then running composer again should fix it.
export PATH="/opt/php53/bin/:$PATH"

@atamashi
Copy link

@sstok Is right! Thank you very much!

@saymouMb
Copy link

HI,
when I tried to install a new bundle using this command:
"php composer.phar require nameOfbundle", I had this :


php composer.phar require hwi/oauth-bundle
Please provide a version constraint for the hwi/oauth-bundle requirement: *
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
Compiling component files
Updating the "app/config/parameters.yml" file
PHP Fatal error: Call to a member function findFile() on a non-object in /path/to/myApp/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Composer/ScriptHandler.php on line 161
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap handling the post-update-cmd event terminated with an exception

[RuntimeException]
An error occurred when generating the bootstrap file.

require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-update] [packages1] ... [packagesN]


F.Y.I:
Symfony version : 2.2.11
PHP version: 5.4.9
ubuntu 13.04.

Thanks for help

cordoval pushed a commit to cordoval/SensioDistributionBundle that referenced this issue Feb 28, 2014
This PR was submitted for the master branch but it was merged into the 2.1 branch instead (closes sensiolabs#79).

Discussion
----------

Add check for PHP_SAPI

See symfony/symfony#7082 (comment)

Commits
-------

e144e85 Add check for PHP_SAPI
ostrolucky pushed a commit to ostrolucky/symfony that referenced this issue Mar 25, 2018
* 2.2: (22 commits)
  [Process] Fix regression introduced in symfony#6620 / 880da01, fixes symfony#7082
  [HttpKernel] added a unit for the previous commit (closes symfony#7025)
  [HttpFoundation] fixed, overwritten CONTENT_TYPE
  [BrowserKit] fixed test added in the previous merge (refs symfony#7059)
  [FrameworkBundle] tweaked reference dumper command (see symfony#7093)
  Remove unnecessary comment and change test name
  [Config] tweaked dumper to indent multi-line info
  [HttpKernel] added some tests for previous merge
  Fix REMOTE_ADDR for cached subrequests
  [FrameworkBundle] CSRF should be on by default
  [WebProfilerBundle] removed dependency on FrameworkBundle (closes symfony#6949)
  [HttpKernel] added error display suppression when using the ErrorHandler (if not, errors are displayed twice, refs symfony#6254)
  [HttpFoundation] tweaked previous merge
  [HttpFoundation] Added getter for httpMethodParameterOverride state
  Create validators.lv.xlf
  [Process] Warn user with a useful message when tmpfile() failed
  [BrowserKit] added a test to make sure HTTP authentication is preserved when submitting a form
  Remove array type hint from GetResponseForControllerResultEvent::setControllerResult()
  bumped Symfony version to 2.2.0-DEV
  Revert "merged branch povilas/issue_6101 (PR symfony#6708)"
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests