Question

I'm trying to deploy on a 1&1 shared linux hosting the Zend Skeleton Application that I obtained from github (https://github.com/zendframework/ZendSkeletonApplication) via a SSH connection.

I have those files already in the server, but when doing the installation's last step that's explained in github (php composer.phar install) I get the following error:

X-Powered-By: PHP/4.4.9
Content-type: text/html

<br />
<b>Parse error</b>:  syntax error, unexpected '<' in <b>/homepages/45/d*******/htdocs/zend_test/ZendSkeletonApplication/composer.phar</b> on line <b>75</b><br />

I can see that the PHP version that shows there is 4.4.9, but I've set up the server to have php 5 (phpinfo() shows 5.4.7). I've also included an .htaccess file in the root of the installation's folder with the AddType x-mapp-php5 .php instruction, as explained here, but that doesn't seem to do anything.

EDIT: Files structure as requested below:

[root]
    [vendor]
      [ZF2]
         [bin]
         [demos]
         [library]
         [resources]
         [vendor]
         composer.json
         LICENSE.txt
         README.md
      .gitignore
      README.md`
Was it helpful?

Solution 2

So instead of following the directions in github I downloaded the skeleton app from there and manually added the ZF2 library in the vendors folder and all worked fine

OTHER TIPS

Try /usr/local/bin/php5 composer.phar install

Otherwise 1&1 would be the best people to contact for gaining access to PHP5 on the command line.

The default PHP executable is PHP4 (4.4.9) for whatever reasons. You have to manually select the right PHP executable to get Composer running. There's a php5 executable at /usr/bin/php5 but it is 5.2.17 at the day of writing this, which is not sufficient to run composer, minimum is 5.3.2.

They also have a newer PHP 5 executable comically called php6 located at /usr/bin/php6 which is currently version 5.4.19. This one will do the job.

To install composer use this:

curl -sS https://getcomposer.org/installer | php6

To use composer use this:

php6 composer.phar
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top