Symfony2 composer.phar - symfony

I would like to install Composer belonged to Symfony2 by instruction http://symfony.com/doc/current/book/installation.html. When I run the first command (curl -s https://getcomposer.org/installer | php), I get an error :
Your ionCube Loader extension (4.0) is incompatible with Phar files.
Upgrade to ionCube 4.0.9 or higher or remove this line (path may be different) from your php.ini to disable it:
zend_extension = /usr/lib/php5/20090626+lfs/ioncube_loader_lin_5.3.so
But my php.ini said:
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
with the ionCube PHP Loader v4.0.10, Copyright (c) 2002-2011, by ionCube Ltd.
What is the problem?

The installer script uses version_compare(ioncube_loader_version(), '4.0.9', '<') to figure out which version of ioncube you have. It seems like it reports 4.0 on your setup which is kind of wrong. Could you check on your machine what this outputs?
php -r "var_dump(ioncube_loader_version());"
As a workaround to force the installation of Composer for now you can use the following:
curl -s https://getcomposer.org/installer | php -- --force
That said, please give me feedback so we can fix the detection script and avoid issues for ionCube users in the future.

Related

Composer take too long tu update/install Symfony project (on Windows 10)

Why is 'composer update' running so slow when updating a Symfony project on Windows? If I run diagnose everything looks fine, but the update command takes like 25 min or something. Anyone knows whats is going on?
$ composer diagnose
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking composer version: OK
And here are my php module:
$ php -m
[PHP Modules]
apc
apcu
bcmath
bz2
calendar
Core
ctype
curl
date
dom
ereg
exif
filter
ftp
gd
gettext
hash
iconv
intl
json
libxml
mbstring
mcrypt
mhash
mysql
mysqli
mysqlnd
odbc
openssl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
sqlite3
standard
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
xsl
zip
zlib
[Zend Modules]
As you can see Xdebug is not ON. Anyone knows what cause composer to run so slow (while Internet speed is decent)? Are virtual machines (i.e. VirtualBox) with Ubuntu on it + Putty the only solution to this issue?
Ps. Symfony 2.4.10 is not supported by Symfony installer.
Composer is stoping at:
> post-update-cmd: Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile
A thing to improve the version resolve speed is by narrowing down the version constraints yourself. In general, I recommend applications to use pretty narrow version constraints (while packages should use the widest version constraints supported). This especially applies to the symfony/symfony version, as there are many versions.
For instance, assume your composer.json file contains something like this: ~2.3. This will simply resolve to the latest version in the 2.x series, which is 2.8. So you can bypass 100 versions (all 2.3-2.7 releases) by setting your version constraint to ~2.8. The result will be the same.
try
composer config --global repo.packagist composer https://packagist.org

Symfony Installation gives fatal error

I'm new to the symfony2 and I was following http://symfony.com/doc/current/book/installation.html for installation using Composer now
It gives me a Fatal Error after some time:
monolog/monolog suggests installing rollbar/rollbar (Allow sending log messages to Rollbar)
Writing lock file
Generating autoload files
Fatal error: Call to undefined method Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::defineDirectoryStructure() in /Users/app/SymfonyStandard/RootPackageInstallSubscriber.php on line 28
#hap absolutely right on Debian/Ubuntu
sudo apt-get install php5-curl
is solving this issue. I think on another platform php5-curl will help too.
RESOLVED:
Got the same problem. Deleted the file composer.phar, installed again via curl -s https://getcomposer.org/installer | php - problem persists
/path/to/webroot/project/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/ScriptHandler.php file does not have the method defineDirectoryStructure() in it
symfony/framework-standard-edition (v2.6.1)
PHP 5.5.9-1ubuntu4.5 (cli) (built: Oct 29 2014 11:59:10)
problem here
sensio/distribution-bundle (v3.0.11)
Thanks #hap, this helped
sudo apt-get install php5-curl
Just had this problem on Debian. For me the problem was that sensio/distribution-bundle in its last version (v3.0.12, the one introducing the defineDirectoryStructure function) requires the cURL PHP extension, which was not installed, so it installed v3.0.11 (which don't contain the required method).
After installing php5-curl, Composer finaly installed the last version of sensio/distribution-bundle and everything was fine.
Got the same problem too ... Works on a debian distrib, but doesn't work on my wamp on windows 7 !
So tried to update my wamp, to get PHP5.5, reconfigure composer to use this PHP, still didn't work ..
Then I tried to launch the Console in Administrator mode, and launch :
"composer create-project symfony/framework-standard-edition sfproject/"
And guess what .... That finally worked !! With administrator rights ... Just give it a try ;)
I have same problem. I just added in composer.json string "symfony/symfony": "2.3.*", And its working for me.
Also, i deleted my composer.phar and composer.lock files.
The problem, if you have in your project symfony 2.3 it installing dependencies for v 2.7 .
I got this error from a install into a new vagrant VM, it would appear that something done recently has broken this as I managed to install a 2.6.0 version last week whilst testing, now it doesn't work.
After a bit of trial and error, it appears that the 2.6x and 2.5x branches are both affected and will not install, but 2.3x and 2.4x do install without the error.
incase anyone doesn't know how to install a specific version, just add it onto the end of the composer command, i.e.
composer create-project symfony/framework-standard-edition . 2.4.x
VM: Ubuntu 14.01 / PHP 5.5.9
I had the same problem in an Ubuntu 14.04 VM set up with PuPHPet and Vagrant/VirtualBox.
I've noticed that when I had the same problem, the DistributionBundle was severely out of date. Trying to upgrade it manually from composer.json (changing the version to 3.0.12, which was the las one available at the time I had the problem) produced a more verbose error, stating I hadn't installed php5-curl.
After updating the PuPHPet config file to include the cURL module for PHP and reprovisioning my VM, Symfony installed just fine, having installed the last version of Sensio Distribution Bundle, which contained the defineDirectoryStructure() method.

Fatal error about JsonSerializable

While I have php 5.5.3 and Joomla 3.1.5, I get this error:
Fatal error: Interface 'JsonSerializable' not found in /var/www/joomla/libraries/joomla/registry/registry.php on line 22
This is the output of php --version:
PHP 5.5.3-1ubuntu2 (cli) (built: Oct 9 2013 14:49:24)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend Technologies
Are you using Ubuntu 13.10? If so, try installing the php5-json package. I guess it is perhaps new to 13.10 .
I have it and PHP v5.5.3 working fine so far. See this link for someone's blog (not mine) about installing Joomla with Ubuntu 13.10 (which has PHP v5.5.3).
If you have a look at the Technical requirements for Joomla 3.x, you will see that the minimum is PHP 5.3 and the recommended is 5.4.
So I would strongly recommend that you go back to PHP 5.4 as I believe there are a few known issues with PHP 5.5 and above.
This was an issue with Debian not including the interface in their PHP version due to some ridiculous legal arguments. This will be fixed in the next version of Joomla (3.3.1) see https://github.com/joomla/joomla-cms/commit/dac8a08d30ed7580b546544c4b9a1da19c3fd7de
apt-get install php5-json
enable or add json extension on the php.ini file
extension=json.so

Install Fixtures in Sylius - Symfony2

After having successfully installed and updated all vendors in my project folder for Sylius i tried running this code :
app/console sylius:install --fixtures
I get this error :
PHP Fatal error: Class 'ResourceBundle' not found in C:\wamp\www\sylius\vendor\
symfony\symfony\src\Symfony\Component\Locale\Locale.php on line 51
Then i tried all possible solutions given here
Installed intl extension in php (working successfully).Then ran this command
php build-data.php 'your ICU version'
On running the above command i get this:
'which' is not recognized as an internal or external command,
operable program or batch file.
The command "svn" is not installed
I want to know if there is another workaround to this issue.
Please help and thanks in advance.
P.S. - No SVN runs on my system. And i'm using icu*46.dll
Anyone came across this??
This error relates to be PHP intl-extension. Make sure it is enabled and you have the LATEST version.
quick test:
<?php
var_dump(extension_loaded('intl'));
Make sure your PHP folder is correctly registered in your %PATH% environment variable.
Control Panel - System - Advanced - ...
Without that, the ICU dlls are not loaded by PHP as Apache module - no error message is displayed, but the extension is not enabled.
Check aswell from phpinfo() ! not with ...
php -m
... or ( windows = findstr, linux/cygwin = grep )
php -i | findstr intl
check that the extension is enabled in your php.ini ( dont know WAMP's extenion path so adjust it please )
extension=php_intl.dll
As i can see you are on Windows and using WAMP you will have to get a precompiled version of the extension.
The packages on http://windows.php.net/download/ all contain the php_intl.dll in the ext folder.
Make sure that the ICU is compiled with the same version of MSVC that PHP is.
You run into problems if the ICU was compiled with VC10 and PHP was with VC9.
Although php -m and php -i detect the INTL it wouldn't show up in phpinfo().

Composer not working on AWS Ubuntu server, locally works fine

Composer install command works fine locally on my computer:
Loading composer repositories with package information
Installing dependencies from lock file
Nothing to install or update
Generating autoload files
When I connect via ssh to the ubuntu server, and run the same command I get this.
PHP Fatal error: Class 'Composer\Installers\Installer' not found in phar:///usr/local/bin/composer/src/Composer/Installer/InstallerInstaller.php on line 102
Fatal error: Class 'Composer\Installers\Installer' not found in phar:///usr/local/bin/composer/src/Composer/Installer/InstallerInstaller.php on line 102
I followed the instructions here for both machines:
https://github.com/composer/composer/blob/master/README.md
I am missing some dependencies here? I can't figure out why that error.
Edit: Here is the .json (project is symfony 1.4, adding tags as well)
{
"minimum-stability": "dev",
"require" : {
"snappy/sfSnappyPlugin": "*"
},
"repositories": [
{
"type": "git",
"url": "https://github.com/FloranBrutel/sfSnappyPlugin.git"
}
]
}
Edit2: The output of the php -v on the AWS server
PHP 5.3.10-1ubuntu3.4 with Suhosin-Patch (cli) (built: Sep 12 2012 18:59:41)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
On my machine I have:
PHP 5.3.6-13ubuntu3.9 with Suhosin-Patch (cli) (built: Sep 12 2012 19:00:27)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans
I have managed to replicate your problem. Within the directory you are running composer, you should have a path like so:
vendor/composer/installers/src/Composer/Installers
and within this directory there should exist an Installer.php file. I managed to get the same error you are getting by deleting that one file.
So I believe a solution would be to simply completely remove your vendor and plugins directories and try running composer install again, forcing the complete re-download of all the vendors in your composer.json. Hope this helps.
What are the exact commands you run?
What you should do:
run rm -rf vendor/* to erase all possible composer data (it use vendor/.composer as a cache)
run composer self-update to update Composer to it latest. Does this works?
try composer -V
make sure you have openSsl on the server (as you are requiring over https)
switch APC to false on the cli apc.enable_cli=0

Resources