Home » , » Solved - Composer on PHP 7

Solved - Composer on PHP 7

Posted by E-Learning on Tuesday, January 26, 2016

I have error again,
before I using PHP version 5.x and uncomment extension of file phar.so in configuration /etc/php/php.ini

....
;extension=pgsql.so
extension=phar.so
;extension=posix.so
....

then i run command composer, i get this notice errors.
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/phar.so' - /usr/lib/php/modules/phar.so: cannot open shared object file: No such file or directory in Unknown on line 0
so, i comment again this extension. I have read that a phar had been there in the latest php.
this is true, i run command again but i get different errors.


PHP Warning: Phar::mapPhar(): open_basedir restriction in effect. File(/usr/bin/composer) is not within the allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/etc/webapps/:/usr/share/nginx/html:/etc/bin) in /usr/bin/composer on line 23

Warning: Phar::mapPhar(): open_basedir restriction in effect. File(/usr/bin/composer) is not within the allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/etc/webapps/:/usr/share/nginx/html:/etc/bin) in /usr/bin/composer on line 23
PHP Warning: require(phar://composer.phar/bin/composer): failed to open stream: phar error: invalid url or non-existent phar "phar://composer.phar/bin/composer" in /usr/bin/composer on line 24

Warning: require(phar://composer.phar/bin/composer): failed to open stream: phar error: invalid url or non-existent phar "phar://composer.phar/bin/composer" in /usr/bin/composer on line 24
PHP Fatal error: require(): Failed opening required 'phar://composer.phar/bin/composer' (include_path='.:/usr/share/pear') in /usr/bin/composer on line 24

Fatal error: require(): Failed opening required 'phar://composer.phar/bin/composer' (include_path='.:/usr/share/pear') in /usr/bin/composer on line 24
(pluma:13018): Gtk-WARNING **: Theme directory of theme oxygen has no size field


this error because directory of composer not include, so add directory composer to basedir
edit
sudo nano /etc/php/php.ini

before :
open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/etc/webapps/:/usr/share/nginx/html

after :
=open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/etc/webapps/:/usr/share/nginx/html:/usr/bin=

*my composer file on directory /usr/bin
if yours is different, change the directory address.

worked for me :
______
/ ____/___ ____ ___ ____ ____ ________ _____
/ / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
/_/
Composer version 1.0.0-alpha11 2015-11-14 16:21:07

Usage:
command [options] [arguments]




Hosting Unlimited Indonesia

0 comments:

Donate Bitcoin :
19QsXRcfUEKW9AVbGkJFB6WJPvn6uRboNr