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
Installation exits unexpectedly #85
Comments
Do you have suhosin installed? If so, does your config contain something like suhosin.executor.include.whitelist = phar Alternatively try running php -d error_reporting=E_ALL composer.phar to see if there are any hidden errors. |
I too am not able to install composer. Here is what Im doing/seeing: $ php composer.phar install PHP Fatal error: Uncaught exception 'RuntimeException' with message 'The composer.json file could not be found in the current directory' in phar:///Users/xxx/composer.phar/bin/composer:37 |
That is entirely unrelated. While that message isn't output nicely, it does tell you what the problem is. You have not created a composer.json file. Please see http://packagist.org for instructions on how to use composer. |
I'm not running Suhosin. I got the same result with E_ALL and no error message was provided. My configure looks like this:
|
Just for kicks, I tried to install with the default OS X PHP and received the same error as @evan108108 above. |
That means it works correctly on OS X. Without a composer.json file Composer cannot know what to do. You must create one for your project before it can do anything. |
Try the things mentioned here: http://silex.sensiolabs.org/doc/usage.html#pitfalls |
@saltybeagle can we do anything to detect this early in the phar bootstrap and warn the user? This is a really nasty error. |
@Seldaek Maybe adding check to
<?php
if (ini_get('detect_unicode')) {
throw new \RuntimeException('Check your config, bro! ;-)');
} |
@Seldaek The error happens so early, I don't think it's something we can detect in userland code at runtime. |
@Seldaek It seems we can't (as @saltybeagle mentioned) do this in userland. As I see you changed a bit error when About issue with It could look like:
#!/usr/bin/env php
<?php
$errors = array();
if (false !== $unicode = ini_get('detect_unicode')) {
$errors['unicode'] = 'On';
}
if (false !== $readonly = ini_get('phar.readonly')) {
$errors['readonly'] = 'On';
}
if (false !== $hash = ini_get('phar.require_hash')) {
$errors['require_hash'] = 'On';
}
if (false !== $suhosin = ini_get('suhosin.executor.include.whitelist')) {
if (false === strpos($suhosin, ',') && $suhosin != 'phar') {
$errors['suhosin'] = $suhosin;
} else if (false === in_array('phar', explode(',', $suhosin))) {
$errors['suhosin'] = $suhosin;
}
}
if (false === empty($errors)) {
echo 'Composer detected that you have enabled some settings in your';
echo '`php.ini` file that can make Composer unable to work properly.';
echo "\n\n";
echo 'Make sure that you have changed options listed below:';
echo "\n";
foreach ($errors as $error => $actual) {
switch ($error) {
case 'unicode':
echo "\rdetect_unicode = Off (actual: {$actual})\n";
break;
case 'readonly':
echo "\rphar.readonly = Off (actual: {$actual})\n";
break;
case 'require_hash':
echo "\rphar.require_hash = Off (actual: {$actual})\n";
break;
case 'suhosin':
echo "\rsuhosin.executor.include.whitelist = phar (actual: {$actual})\n";
break;
}
}
exit(1);
} |
@stloyd That's an interesting proposal. I wonder if it would be worthwhile to cook up a simple install shell script (sort of like go-pear), which runs those simple checks, grabs the latest phar and sets up a bin/composer executable for the end-user. |
@saltybeagle I was thinking exacly about something like @Seldaek, @naderman What do you think about such file ? I could make some work on php version if you would like this idea. |
@stloyd: Would be great I think, if you can just send it to the composer/getcomposer.org repo, it should probably be there. |
Closing in favor of #245 |
Trying to install from the instructions on http://packagist.org/ and got the following result after running
php composer.phar install
:PHP version:
PHP 5.3.6 (cli) (built: Jul 31 2011 13:05:04)
Phar section of my php info:
The text was updated successfully, but these errors were encountered: