PHP version, composer and ZF2

apps

#1

I want to try to get an application going with Zend Framework 2. So following the startup tutorial I can use composer to get a skeleton project up and running. However, composer does not work as is. So I try to grab it

curl -s https://getcomposer.org/installer | php

However, it responds as follows:

[quote]The phar extension is missing.
Install it or recompile php without --disable-phar

Your PHP (5.2.17) is too old, you must upgrade to PHP 5.3.2 or higher.
[/quote]

Fair enough. So I follow some instructions to add .phar to php 5.3. But then it strikes me, wait, that says im using 5.2.17, not 5.3. And php -v does the same.

Plus I check php version running on my current web pages, and although its 5.3 its 5.3.1* not 5.3.2 or higher.

So I say screw it, ill install php 5.4. With some minor difficulties, I accomplish this. If I run phpinfo() on my site, it says 5.4.8, but if I run php -v it still says 5.2.17, and so does the composer installer.

How can I get the most updated version of php to be the one seen by the server, so composer and php -v will recognize it?
[hr]

So it seems like its just I would need to set up the correct path. Because if I specify …/php5.4/bin/php -v it gives the correct version, and composer installs fine.


#2

Newer versions of PHP are installed on the server with their version number in the name. For your first command, for instance, try:

For historical reasons, the “php” command, without a version number, will always get you PHP 5.2.


#3

.bashrc

.bash_profile


#4

Didn’t realize you could actually install that kind of thing on DreamHost! Currently installing php5.4. :slight_smile:

I’m trying to get Zend up and running, too, and the tutorial is for 1.11.1, but the current version is 2.1.0…