Composer missing libraries in Ubuntu 18.04 - php

I have installed composer but when I try to run $ composer I get the following error:
php: error while loading shared libraries: libicui18n.so.55: cannot
open shared object file: No such file or directory
The php -v command returns:
PHP 7.1.23-2+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Oct 15 2018
11:37:26) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine
v3.1.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.1.23-2+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
I have tried to search for libicu in synaptic and I installed libicu60!
However, php composer.phar works fine

composer shouldn't need that dependency, but in case it really does, this should work:
wget http://security.ubuntu.com/ubuntu/pool/main/i/icu/libicu55_55.1-7_amd64.deb
sudo dpkg -i libicu55_55.1-7_amd64.deb
sudo apt-get -f install
However, I'd post that as a bug to composer maintainers (github repo), because the package should have this as a dependency and install it along the way with apt.
Composer.phar is really a standalone program, so it doesn't need other dependencies. much like a snap package.

Related

Uninstall Xdebug 3 and install v2.9.8

I've installed Xdebug in my system. Then in PhpStorm I've done all the configuration to debug the code using Xdebug.
But in Xdebug is not working properly with PhpStorm. So I would like to remove Xdebug from my local machine. But it's unable to uninstall it.
Using the following command I understood it was installed in my local machine:
php -v shows:
PHP 7.3.28-2+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Jun 4 2021 21:23:19) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.28, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.28-2+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
with Xdebug v3.0.4, Copyright (c) 2002-2021, by Derick Rethans
But while ran the uninstall command I am getting the following response in terminal:
sudo apt-get remove php-xdebug
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'php-xdebug' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 58 not upgraded.
Previously I was using Xdebug v2.9.8, it was working fine and I was able to debug the code. So I would like to install the same version.
So looking forward for your support to uninstall version 3 and proper command to install version 2.9.8 in my PHP 7.3 version.

Mojave 10.14.5 and homebrew PHP not working properly

I'm trying to install PHP 7.(2|3) with Homebrew on Mojave 10.14.5 and I can't get it to work.
Fresh install of Mojave with only :
Google Chrome
Iterm
Zsh
Oh My Zsh
Right after Mojave is installed I run the following in my terminal :
Install Homebrew (command line from the official website)
brew install composer
brew install php
composer global require laravel/installer (composer is in the path)
laravel new blog
It ends up with a segmentation fault :
[1] 9310 segmentation fault laravel new blog
I tried to reboot, uninstall and reinstall PHP/Homebrew/Mojave several times. I always ends up with the same error.
Also tried with php#7.2 and php#7.1 and other packages like wp-cli, it's the same.
I'm desperate, please help.
EDIT WITH MORE INFO :
composer --version:
Composer version 1.8.6 2019-06-11 15:03:05
php -v:
PHP 7.1.26 (cli) (built: Apr 23 2019 10:38:28) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.1.26, Copyright (c) 1999-2018, by Zend Technologies
php -i:
here

Laravel 5.4 with MongoDB MAC Mojave

Hello I having trouble to to install "jenssegers/mongodb": "^3.2" on my local environment.
i have this error:
I have added to my /etc/php.ini full path to extentions="/usr/lib/php/extensions/no-debug-non-zts-20160303/mongodb.so"
restart the php and apache
I have try to find mongodb.ini, fail on that.
I try all the tutorial is google... still no luck
Can any one help me please?
PHP 7.1.23 (cli) (built: Feb 22 2019 22:08:13) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
It seems that you forgot to install MongoDB PHP Driver itself.
To do that just install it with pecl:
sudo pecl install mongodb-1.5.3
1.5.3 is the last stable version, so I'd recommend to use it rather than the most recent 1.6.0alpha.
Then, don't forget to add it to your php.ini (run php --ini to see where it's located):
extension=mongodb.so
To test that it works just run:
php -m | grep mongo
If you see mongodb in output, then it works.

Configuring Xdebug debugger on PhpStorm w/ Laravel, Vagrant

Trying to configure my Vagrant server to use Xdebug. Read that it comes with Xdebug, but I checked this and doesn't seem to be true.
SSH into Vagrant machine,
$ php -v
reveals that machine is using
PHP 7.2.0-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Nov 30 2017 13:58:33) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.2.0-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2017, by Zend Technologies with blackfire v1.18.0~linux-x64-non_zts72, https://blackfire.io, by SensioLabs
No xdebug. So I tried installing xdebug with
$ brew install homebrew/php/php72-xdebug
Seemed to work. But then I tried finding the path to xdebug.so:
$ locate xdebug.so
/usr/lib/php/20131226/xdebug.so
/usr/lib/php/20151012/xdebug.so
/usr/lib/php/20160303/xdebug.so
Tried putting all of these into php.ini, and they all failed.
Tried installing via
$ sudo apt-get install php7.2-xdebug
E: Unable to locate package php7.2-xdebug
So, I searched, and found:
$ apt search xdebug
Sorting... Done
Full Text Search... Done
php-xdebug/xenial,now 2.5.5-3+ubuntu16.04.1+deb.sury.org+1 amd64 [installed] Xdebug Module for PHP
What am I doing wrong to get Xdebug and php configured on my remote machine?
I was testing with Postman using the mapped domain.. Using the actual server IP works.
So, instead of "restfulapi.dev", hit "128.153.123.21" or whatever it is.
Very silly.

Why is the php service missing after installing php on ubuntu?

Just installed a clean copy of ubuntu and php (to start a wordpress blog)
As recommended here, I installed php with
sudo apt-get install php libapache2-mod-php php-mcrypt php-mysql
Which worked great. I can even confirm that PHP v7.0.22 is installed -
> php --version
PHP 7.0.22-0ubuntu0.16.04.1 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.22-0ubuntu0.16.04.1, Copyright (c) 1999-2017, by Zend Technologies
I made some changes to Nginx in order to get it to read PHP files, and I'm trying to restart the php service -
> sudo service php7.0-fpm restart
Failed to restart php7.0-fpm.service: Unit php7.0-fpm.service not found.
- which it's claiming is not found.
In fact, it looks like there is no service at all with a name like "php" installed when I run sudo service --status-all to list everything.
Do I have to do something extra to install the PHP service?
Thanks!

Categories