Tutorial > "wrong php version" but php ok?

For programming and general questions on Zend Framework

Tutorial > "wrong php version" but php ok?

Postby falk8627 on Wed Jan 18, 2017 6:14 pm

Hello,
I'm confused and ask you here for assistance.
I'm a beginner in zend-framework... so have mery with me.

During learning I downloaded (git) the sample application "zf3buch-vote-my-pizza". (An exxample about middleware)

Downloading works fine, but the installation (composer instlall) dies with the following error:

Code: Select all
  Problem 1
    - zendframework/zend-component-installer 0.3.1 requires php ^5.6 || ^7.0 -> your PHP version (5.5.36) does not satisfy that requirement.
    - zendframework/zend-component-installer 0.3.0 requires php ^5.6 || ^7.0 -> your PHP version (5.5.36) does not satisfy that requirement.
    - Installation request for zendframework/zend-component-installer ^0.3.0 -> satisfiable by zendframework/zend-component-installer[0.3.0, 0.3.1].


If I ask for the php-verion, I get this:
Code: Select all
Falk-Gottschalks-iMac-neu:zf3buch.vote-my-pizza falkgottschalk$ php -version
PHP 7.1.0 (cli) (built: Dec 15 2016 18:04:29) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.1.0-dev, Copyright (c) 1998-2016 Zend Technologies
    with Xdebug v2.5.0, Copyright (c) 2002-2016, by Derick Rethans


And so I am confused.

I am using an iMac with 10.11.6 and MAMP (pro).

Any hints about that? My tries n google did not found any useful hint...

Tanks in advance!!
falk8627
 
Posts: 2
Joined: Wed Jan 18, 2017 6:08 pm

Re: Tutorial > "wrong php version" but php ok?

Postby mehm8471 on Sat Jan 21, 2017 1:31 am

You have two different PHP installed.
One which comes with Mac and the other one MAMP I guess (never used MAMP but that's how it looks).
MAMP is supposed to be using the version installed on Apache.
php -v is supposed to be using the OS version.

Perhaps related:
https://gist.github.com/irazasyed/5987693

Or at least you now might have an idea what's wrong.
mehm8471
 
Posts: 20
Joined: Sat Jun 21, 2014 11:39 pm

Re: Tutorial > "wrong php version" but php ok?

Postby falk8627 on Sat Jan 21, 2017 3:39 pm

Hello,
thanks for reply.

The MAMP-Tool you can configure by a checkbox to make the MAMP-php-version available in the shell. Normally it works, but not really with the ZEND-framework.

I upgraded the php-version of my OS X - which worked until i opened a new shell version.
The shell itself told me the current version, the composer/ installation not, same error as described above.

SOLUTION:
I had to add this line into my ~.bash_profile
Code: Select all
export PATH=/usr/local/php5/bin:$PATH


After this, the composer-installation worked.

(No really need to understand this...)

maybe another one finds this solution useful,that why I post it here.
falk8627
 
Posts: 2
Joined: Wed Jan 18, 2017 6:08 pm

Re: Tutorial > "wrong php version" but php ok?

Postby mehm8471 on Sat Jan 21, 2017 3:43 pm

Yes, it is good the link I sent has the same solution.

Glad to hear it helps.
mehm8471
 
Posts: 20
Joined: Sat Jun 21, 2014 11:39 pm


Return to Zend Framework

Who is online

Users browsing this forum: No registered users and 4 guests