Issue with installing zendframework2 skeleton - php

i'm new to zendframework 2 , while trying to install it , using composer , it gets installed but an error message appears saying :
Your requirements could not be resolved to an installable set of packages.
Problem1
- Installation request for zendframework/zendframework 2.3.* -> satisfiable by zendframework/zendframework[2.3.0].
- zendframework/zendframework 2.3.0 requires php >=5.3.23 -> no matching package found
knowing that I have php 5.4.3.
Could someone please explain to me what's wrong ?
thanks in advance

Make sure the PHP version you are using for the CLI is using PHP 5.4.3 too. The CLI version can use a different PHP version than the host. You can get the php version used by the console by using the php --version command.

Related

Running 2 Symfony projects with different php versions

I'm working on a Symfony (4.4) project with PHP version(7.1.30) and now I want to start a new Symfony (5.0/5.1) project.
But I could not do it because it wants at least PHP 7.2.5. (Windows 10 machine).
I have installed PHP 7.3.6 and added it to the PATH environment. But when I try to create the new Symfony project I get this error:
Your requirements could not be resolved to an installable set of
packages.
Problem 1
- symfony/symfony v5.0.2 requires php ^7.2.5 -> your PHP version (7.1.30) does not satisfy that requirement.
- symfony/symfony v5.0.1 requires php ^7.2.5 -> your PHP version (7.1.30) does not satisfy that requirement.
- symfony/symfony v5.0.0 requires php ^7.2.5 -> your PHP version (7.1.30) does not satisfy that requirement.
- Installation request for symfony/symfony ^5.0 -> satisfiable by symfony/symfony[v5.0.0, v5.0.1, v5.0.2].
Can you please advise how can I use 2 different PHP versions for the different projects?
(I can't upgrade the 'old' project because some extensions cannot work with 7.2.5)
To run composer with an older php version, download an appropriate phar of composer for that version. The latest is probably compatible with all versions, but if it doesn't work download an earlier version until it starts working.
Then run the non default php with the following command in the composer.phar directory(replace C:\php7.2.5 with your actual path):
C:\php7.2.5\php.exe -c C:\php7.2.5\php.ini composer.phar update
If you use git bash(what I do)
/c/php7.2.5/php.exe -c /c/php7.2.5/php.ini composer.phar update
You can also make this into a batch or bat file pretty easy.
The -c flag is to point to the correct php.ini.
You can select the php version for the project with
echo 7.4.10 > .php-version
When you create the .php-version for each project you can run the server as you run it usually and everything works fine
Also, when I use 7.4.10 locally, I have to use my commands like this
symfony php bin/console make:migration
with symfony before php bin/console

How to fix magento 2 error while installing one module

I am have my magento 2 website and I want to install one module using below command
composer require eway/eway-rapid-magento2 3.0.1
but I am getting following error
magento/framework 100.1.15 requires php ~5.6.5|7.0.2|7.0.4|~7.0.6 -> your PHP version (7.1.27) does not satisfy that requirement.
Please let me know how to fix this issue.
Thanks
Ignore platform requirements (php & ext- packages).
composer require eway/eway-rapid-magento2 3.0.1 --ignore-platform-reqs
As stated already, php version is not correct for this module version, so either update php version or update the module version, which one is satisfying by the php version.

Laravel Composer require issue with Mac Sierra

I'm trying to include Laravel 5 Facade for Goutte in my application. However I am getting the following error:
Problem 1
- namshi/jose 5.0.2 requires lib-openssl * -> the requested linked library openssl has the wrong version installed or is missing from your system, make sure to have the extension providing it.
- namshi/jose 5.0.2 requires lib-openssl * -> the requested linked library openssl has the wrong version installed or is missing from your system, make sure to have the extension providing it.
- namshi/jose 5.0.2 requires lib-openssl * -> the requested linked library openssl has the wrong version installed or is missing from your system, make sure to have the extension providing it.
- Installation request for namshi/jose (locked at 5.0.2) -> satisfiable by namshi/jose[5.0.2].
I have searched online and it suggests installing a new version of PHP and try using that instead however I have installed php56 via homebrew and its still not working. When i run:
which php
it says the path is:
/usr/bin/php
However brew installed PHP to:
/usr/local/Cellar/php56/5.6.30_6/bin
I have updated my .bash_profile with the following line:
export PATH=$PATH:/usr/local/Cellar/php56/5.6.30_6/bin
However even after restarting the terminal which php still returns /usr/bin/php.
You can try to create a symlink for new php version this way :
sudo ln /usr/local/Cellar/php56/5.6.30_6/bin/php /usr/local/bin/php
Then run your composer command
php composer require weidner/goutte
or
php composer.phar require weidner/goutte
Hope this helps !

How to install zend framework on Ubuntu?

I want to install zend framework on the Ubuntu and i have followed the instruction of installation from
http://framework.zend.com/manual/2.2/en/user-guide/skeleton-application.html
link but failed to install.
I have downloaded the ZendSkeletonApplication from here
https://github.com/zendframework/ZendSkeletonApplication
After that run of this command
php composer.phar self-update // it's working
But after the first command the second Command
php composer.phar install // Not working
And showing this error
Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- zendframework/zendframework 2.3.1 requires php >=5.3.23 -> no matching package found.
- zendframework/zendframework 2.3.0 requires php >=5.3.23 -> no matching package found.
- Installation request for zendframework/zendframework 2.3.* -> satisfiable by zendframework/zendframework[2.3.0, 2.3.1].
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.
Update after some comments:
Now I've downloaded the ZendSkeletonApplication-master and move the
Library folder of ZendFramework-2.3.1
in the
ZendSkeletonApplication-master/vendor/ZF2/
But after that when i access this i'm getting this error on the page
ZendSkeletonApplication-master/public/index.php // in the browser it showing me this error
Fatal error: Declaration of Zend\Stdlib\ArrayObject::offsetGet() must be compatible with
that of ArrayAccess::offsetGet() in /var/www/html/demo/username/ZendSkeletonApplication
-master/vendor/ZF2/library/Zend/Stdlib/ArrayObject.php on line 22
Well two solutions are possible :
First upgrade php, However it could be possible that Ubuntu release on your system not having upgrades for php. So in that case search google to add APT repository for php 5.3.23 for your ubuntu-VERSION.
Second I personally experienced that, Checkout in folder you will found composer.json file, In that file you will get the settings something like
"require": {
"php": ">=5.3.23",
"zendframework/zendframework": "2.3.*"
}
Just change settings to get other version of ZF2
"require": {
"php": ">=5.3.3",
"zendframework/zendframework": "2.2.*"
}
It works for me. It should work for you.
Read the error, the main thing we need to focus on is this:
zendframework/zendframework 2.3.1 requires php >=5.3.23 -> no matching package found.
I'll break it down for you.
This states that the package you are attempting to install(zendframework/zendframework 2.3.1) REQUIRES a php version GREATER OR EQUAL TO 5.3.23. As your php -v output stated, you are running PHP 5.3.10. If you are running on a local server that you have access to updating the php version, then update php and run it again, you should see that it works fine. If you are on a remote server, contact your hosting company and see if they can upgrade you to a newer version of php and then run it again!
Hope this helps!
If you have more then one version of php installed and you have php environment variable linking to an old php executable then you may get this issue. Change your environment variable to the php you want to use.

Installing Zend Framework 2 skeleton application on Apache Web server

I've got this issue with installing ZF2 application on my Apache server. I am running PHP 5.3.5.
The composeer.phar self-update works fine then when I try to install dependencies it comes up with this:
C:\Apache2.2\htdocs\zf2-tutorial>phpcomposer.phar install
Loading composer repositories with package information
Installing dependences <including require-dev>
Your requirements could not be resolved to an installable set of packages.
Problem 1
- zendframework/zendframework 2.3.1 requires php >=5.3.23 -> no matching package found
Its saying my PHP isn't updated. But my phpinfo() shows i am running 5.3.5. Has anyone else had this problem?
Any advice would be appreciated.
Like the error says, ZF 2.3 requires PHP 5.3.23 or above. You have 5.3.5. You either need to be running a more recent version of PHP, or install ZF 2.2.x instead which will work with your version.

Categories