Cannot install MakerBundle - symfony

I'm trying to install the MakerBundle for Symfony (3.4) as stated in the documentation.
The command I run is:
composer require symfony/maker-bundle --dev
But I got this:
[InvalidArgumentException]
Package symfony/maker-bundle at version has a PHP requirement
incompatible with your PHP version (5.6)
Checking my php version ( php -v ) gives :
PHP 7.0.27-0+deb9u1 (cli) (built: Jan 5 2018 13:51:52) ( NTS )
Copyright (c) 1997-2017 The PHP Group Zend Engine v3.0.0, Copyright
(c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.27-0+deb9u1, Copyright (c) 1999-2017, by Zend Technologies
with Xdebug v2.5.0, Copyright (c) 2002-2016, by Derick Rethans
Am I missing something?

You need to change the php version inside composer.json file.
"config": {
"platform": {
"php": "7.2"
},
"sort-packages": true
},
Find the above code in composer.json file in you symfony project root directory.
There will be 5.6 in your case just change it to 7.2
Then again run your command it'll work perfectly.

In order to install maker-bundle, it is required to use the new project structure.
There are two options :
create the project with the new template : composer create-project
symfony/skeleton my-project
follow the instructions as stated in https://symfony.com/doc/3.4/setup/flex.html to convert the project's structure and then be able to install flex and maker.

Related

How to correctly install Zend Framework 3 with Composer?

I'm trying to install Zend Framework 3, but I don't know why I get ZF 2.51.
I've followed the Zend docs https://framework.zend.com/downloads
and after I've launched the command to create the project if I go to the home of the project just created, I see "Welcome to Zend Framework 2"
Congratulations! You have successfully installed the ZF2 Skeleton Application. You are currently running Zend Framework version 2.5.1. This skeleton can serve as a simple starting point for you to begin building your application on ZF2.
What I have wrong?
composer create-project zendframework/skeleton-application path/to/install
I've update Composer to the latest version 1.8.3, but I still can't use Zend 3.
When I try to use:
composer create-project zendframework/skeleton-application projectname "3.0" I get this error:
[InvalidArgumentException]
Could not find package zendframework/skeleton-application with version ^3.0
.
Try specifying a version number:
composer create-project zendframework/skeleton-application /path/to/install ^3.0
Worked for me. Looks like it automatically pulls an older version.

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

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

Symfony2 composer.phar

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.

Why symfony 2 uses both, the 'deps' file and the 'composer.json' file?

Why symfony 2 uses both, the deps file and the composer.json file?
I can see some documents tell me to:
php bin/vendors install
Whilst the other tell me to:
php composer.phar install
The deps file and bin/vendors script are used in Symfony 2.0.x, while Symfony 2.1.x has switched to Composer. The bin/vendors script was just a stub because Composer was not ready for production when Symfony 2.0.0 was released.

Resources