WebFaction
Community site: login faq
1
2

I've recently started using Composer for package management locally, but when I tried to use it on Webfaction I received the following errors:

[inligh@web344 faq]$ curl -s http://getcomposer.org/installer | php54
#!/usr/bin/env php

Some settings on your machine make Composer unable to work properly.
Make sure that you fix the issues listed below and run this script again:

The ionCube Loader extension is incompatible with Phar files.
Remove this line (path may be different) from your `php.ini`:
    zend_extension = /usr/lib/php5/20090626+lfs/ioncube_loader_lin_5.3.so

Understanding that I cannot edit our the ioncube loader from the php.ini file (as per Webfaction Docs on php.ini) and that Composer will not work with the ionCube loader, are there any thoughts on a work around to get composer to install?

asked 19 Jul '12, 16:34

Krasch
11112
accept rate: 0%


Here's a handy script from matthewspencer on gist: https://gist.github.com/matthewspencer/8969473 Installs composer so it can be used from anywhere on your account by putting the composer.phar file in the home directory and then creating a bash alias for it.

Repost of his script (install-composer.sh):

cd $HOME
ln -s `which php54` ~/bin/php
export PATH=$HOME/bin:$PATH
curl -sS https://getcomposer.org/installer | php54
echo -e "\n# Composer\nalias composer=\"php54 \$HOME/composer.phar\"" >> $HOME/.bash_profile
source $HOME/.bash_profile
permanent link

answered 21 Apr '14, 01:21

whweiskopf
313
accept rate: 0%

edited 21 Apr '14, 01:23

You can install composer with PHP 5.4 via the Installation from Source method, and then modifying the installed scripts to use "php54" instead of "php" e.g.:

[xxxxx@web300 ~]$ git clone https://github.com/composer/composer.git
Cloning into composer...
remote: Counting objects: 15644, done.
remote: Compressing objects: 100% (4914/4914), done.
remote: Total 15644 (delta 9684), reused 15147 (delta 9262)
Receiving objects: 100% (15644/15644), 1.96 MiB, done.
Resolving deltas: 100% (9684/9684), done.
[xxxxx@web300 ~]$ wget http://getcomposer.org/composer.phar
--2012-08-24 09:55:30--  http://getcomposer.org/composer.phar
Resolving getcomposer.org... 37.59.4.156
Connecting to getcomposer.org|37.59.4.156|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/plain]
Saving to: “composer.phar”

    [      <=>                                        ] 559,081      480K/s   in 1.1s

2012-08-24 09:55:31 (480 KB/s) - “composer.phar” saved [559081]

[xxxxx@web300 ~]$ cd composer
[xxxxx@web300 composer]$ php54 ../composer.phar install
Loading composer repositories with package information
Installing dependencies from lock file
  - Installing justinrainbow/json-schema (1.1.0)
    Downloading: 100%

  - Installing seld/jsonlint (1.0.0)
    Downloading: 100%

  - Installing symfony/console (v2.1.0-RC1)
    Downloading: 100%

  - Installing symfony/finder (v2.1.0-RC1)
    Downloading: 100%

  - Installing symfony/process (v2.1.0-RC1)
    Downloading: 100%

Generating autoload files
[xxxxx@web300 composer]$ find ./bin -type f -executable | xargs sed -i 's/env php$/env php54/g'

Hope that helps!

permanent link

answered 20 Jul '12, 12:46

seanf
12.2k42136
accept rate: 37%

edited 24 Aug '12, 10:54

Updated answer with an easier solution :)

(24 Aug '12, 10:26) seanf

@seanf I'm getting a couple of errors when running the final command in your instructions:

find: invalid predicate `-executable' sed: no input file

Everything up to that point worked fine. Do these instructions need to be updated or did I miss something during the process?

(24 Mar '13, 22:55) Jonathan Head

Submit a support ticket and we can investigate, I do not get the same error when I run that part of find on web300, we can further investigate if we can test it in real-time.

(25 Mar '13, 01:28) johns

The "invalid predicate" error is caused because your server has an older version of 'find', which does not support "-executable". Use this instead:

find ./bin -type f -perm /111

(i.e. Replace "-executable" with "-perm /111".)

(25 Mar '13, 15:00) likebike

@likebike Thanks, that did it. :-)

(25 Mar '13, 17:52) Jonathan Head

Remember to modify the composer.json scripts :

    "pre-update-cmd": [
        "php54 artisan clear-compiled"
    ],
    "post-install-cmd": [
        "php54 artisan optimize"
    ],
    "post-update-cmd": [
        "php54 artisan optimize"
    ]

with php54, not php

permanent link

answered 07 Jun '13, 10:10

ramirors
324
accept rate: 0%

When i try get composer by http://getcomposer.org/composer.phar i get response: Resolving getcomposer.org... failed: Name or service not known. the same if i try: curl -sS https://getcomposer.org/installer | php55 curl: (6) Couldn't resolve host 'getcomposer.org'

It's look like domain "getcomposer.org" is blocked on firewall.. any ideas?

permanent link

answered 30 Apr '14, 08:40

maciejw
112
accept rate: 0%

edited 30 Apr '14, 08:41

Using the following I had no trouble installing for php55:

cd $HOME
ln -s `which php55` ~/bin/php
export PATH=$HOME/bin:$PATH
curl -sS https://getcomposer.org/installer | php55
echo -e "\n# Composer\nalias composer=\"php55 \$HOME/composer.phar\"" >> $HOME/.bash_profile
source $HOME/.bash_profile

If you are still having trouble, open a ticket at our support site, and we'll help you find the cause of the issue.

(30 Apr '14, 17:01) timg ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×5
×5
×3

question asked: 19 Jul '12, 16:34

question was seen: 13,908 times

last updated: 30 Apr '14, 17:01

                              
WEBFACTION
REACH US
SUPPORT
LEGAL
© COPYRIGHT 2003-2020 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM