libcouchbase on ubuntu 14 errors - libcouchbase

I cloned https://github.com/couchbase/libcouchbase and checkout to version 2.5.8. After that I compiled it as in the documentation from the git page
$ git clone git://github.com/couchbase/libcouchbase.git
$ cd libcouchbase && mkdir build && cd build
$ ../cmake/configure
$ make
$ sudo make install
Afterwords, I installed couchbase from pip:
sudo pip3 install couchbase
But when I do:
python3 -c 'import couchbase'
I've got
import couchbase._libcouchbase as C
ImportError: libcouchbase.so.2: cannot open shared object file: No such file or directory
I made a link in /usr/lib/libcouchbase.so.2 to /usr/local/lib/libcouchbase.so.2
sudo ln -s /usr/local/lib/libcouchbase.so.2 /usr/lib/libcouchbase.so.2
but now I get
import couchbase._libcouchbase as C
ImportError: /usr/local/lib/python3.4/dist-packages/couchbase/_libcouchbase.cpython-34m.so: undefined symbol: lcb_n1x_list
Linux version:
cat /etc/issue
Ubuntu 14.04.2 LTS \n \l
Any idea?

You're encountering this error because your version of libcouchbase is not recent enough to correspond to your version of the Couchbase Python SDK. The current version of the Couchbase Python SDK (2.0.9) requires libcouchbase>=2.6.0.
You have two options to handle this:
Use an older version of the Couchbase Python SDK
Update to the newer version of libcouchbase
Using an older version of the Python SDK is easily done with pip:
$ sudo pip3 install couchbase==2.0.8
Installing a newer version of libcouchbase would be similar to the procedure you've already taken, except you would of course need to checkout version 2.6.0.
That being said, it is generally recommended to use the official builds distributed on the Couchbase website. You can either download tars from the libcouchbase downloads page or add the official Couchbase repositories and apt-get install libcouchbase.

Related

Running into problems installing MongoDB on MacOS Terminal

I am trying to install mongoDB as a macOS service but I am running to some errors
I first put in the terminal
brew tap mongodb
Nothing really happens.
But, when I run:
brew install mongodb-community#5.0
I receive:
Warning: No available formula with the name "mongosh" (dependency of mongodb/brew/mongodb-community). Did you mean mongocli?
==> Searching for similarly named fo This similarly named formula was found: mongocli ✔
To install it, run: brew install mongocli ✔ It was migrated from mongodb/brew to homebrew/core.
Finally, when I run
brew services start mongodb-community#5.0
I receive
Error: Formula 'mongodb-community' is not installed.
Any advice?
I had the same happen, however my issue was actually with this error:
fatal: could not solve HEAD to a revision
solve it using:
git -C $(brew --repository homebrew/core) checkout master
you can also:
brew update
brew upgrade
brew upgrade --cask
brew cleanup
and then restart the mongodb community edition install process again! Worked for me!
I am experiencing the exact same problem (I am using MacOC version 11.5.1).
The reason why your brew tap mongodb does not seem to be doing anything may be because you have already tapped into mongodb. Try untapping with brew untap mongodband retapping with brew tap mongodb/brew.
After you have established the connection, try installing again with brew install mongodb-community#5.0. At this stage, I could not get the installation to work for version 5.0 so I installed version 4.4 instead (with brew install mongodb-community#4.4).
After that, try running mongo with brew services start mongodb-community#5.0 (or brew services start mongodb-community#4.4 if you have installed 4.4 version) and it should work just fine!
If you have installed version 4.4, be sure to run the command PATH="/usr/local/opt/mongodb-community#4.4/bin" mongo to start the mongo shell.
I was also having the same issue. This solved it for me:
git -C $(brew --repository homebrew/core) checkout master
brew update
brew upgrade
brew upgrade --cask
brew cleanup
Then install the latest version of Mongodb community using:
brew install mongodb-community#6.0
Note: version might be outdated at the time you're reading this
Check with brew list | grep mongo that mongodb-community, mongodb-database-tools, mongosh exist at your PC. If they do not exist, install them with brew.
Recently also installed mongodb V4.4.5 and can not start it with brew services start mongodb-community. For me works starting it manually as a background process as admin sudo mongod --config /usr/local/etc/mongod.conf --fork
And last call mongo to work with mongoDB shell.
Reason: directory/file access issue. Not sure.

Installing Dropbox on Ubuntu 18 Server Failing

I am following this article to install and tried both methods.
Downloading the headless and the .deb methods I run the following commands:
$ ./dropboxd
And the DEB:
$ sudo dpkg -i dropbox_2020.03.04.deb
$ sudo apt -f install
$ dropbox start
For both I'm getting the error:
ImportError: libglapi.so.0:
I'm new to Linux server and I'm a little bit lost. Should I upgrade my server to Ubuntu 20?

How should one configure or install salt-cloud to use the Saltstack py3 repository to install the minion instead of the distribution (apt) repository?

I would like salt-cloud to install the salt-minion using the same sources.list.d/saltstack.list file that is on the saltmaster server, but it uses the Ubuntu APT repository instead.
What I get on a new minion in /etc/apt/sources.list.d/saltstack.list:
deb https://repo.saltstack.com/apt/ubuntu/18.04/amd64/latest bionic main
What I want:
deb https://repo.saltstack.com/py3/ubuntu/18.04/amd64/latest bionic main
I installed salt-master and salt-cloud from the Saltstack repository by doing the following on my saltmaster server:
wget -O - https://repo.saltstack.com/py3/ubuntu/18.04/amd64/latest/SALTSTACK-GPG-KEY.pub | sudo apt-key add -
echo "deb https://repo.saltstack.com/py3/ubuntu/18.04/amd64/latest bionic main" > etc/apt/sources.list.d/saltstack.list
apt update
apt install python3-pip salt-master salt-minion salt-cloud
I spin up a server using salt-cloud and the /etc/apt/sources.list.d/saltstack.list without fail uses the apt repository, not the py3 repository.
Is there an option I can set in the saltmaster configuration file that defines which repository salt-cloud should use? Is there a similar option in a salt-cloud profile that can be passed to the salt bootstrap script?
I see in the bootstrap script that salt-cloud runs (found at bootstrap.saltstack.com) a command line option called _CUSTOM_REPO_URL, but I don't know how to pass options to that script when creating a server with salt-cloud -p
Happy to ask elsewhere (please indicate where) if more appropriate.
I can provide applicable parts of my salt-cloud profile if needed.
I found https://docs.saltstack.com/en/latest/topics/cloud/deploy.html#deploy-script-arguments
That led me to add the following to my cloud server profile used with the salt-cloud -p command:
script: bootstrap-salt
script_args: -x python3
Then the correct repository was installed.

Google App Engine PHP SDK - How to install on Ubuntu (15.10)?

Google official documentation is available here:
https://cloud.google.com/appengine/downloads#Google_App_Engine_SDK_for_PHP
But it doesn't provide sufficient information about the following step:
"4 - Build and install the PHP interpreter and App Engine PHP extension. Specify the path to php-cgi and gae_runtime_module.so when running the development server."
I'm using a new Virtualbox machine with Ubuntu 15.10 and PhpStorm to test GAE.
Could someone please provide clear instructions about step 4? What do I need to do to install the php interpreter and the App Engine php extension?
P.s. I've already searched with google but I only found old/confusing tutorials
That GAE PHP extension seems like a quite new thing. Don't remember using it on the SDK in Ubuntu 14.04.
You need to build PHP and that extension from source. You should grab the latest PHP5.5 branch from their source repo (http://php.net/git.php) and build it. That linked page contains instructions on building PHP but the procedure is similar to the following:
$ git clone <php-src>
$ cd ./php-src/
$ git checkout PHP-5.5
$ ./buildconf
$ ./configure --prefix="/opt/php55"
$ sudo make && sudo make install
And remember to pick the modules and packages you want to compile with PHP5.5 to be used in the SDK. I think Google had an official list of modules and extensions they use inside GAE PHP and inside the SDK PHP. The prefix argument tells the compiler where to install the resulting application.
Then you need to get that source for the PHP extension and build it
$ git clone https://github.com/GoogleCloudPlatform/appengine-php-extension
$ cd appengine-php-extension
$ phpize # remember to use the phpize from the just built PHP5.5 binaries
$ ./configure
$ sudo make && sudo make install
(That Git repository contains detailed building instructions so you should probably refer to them when building.)
Enable the resulting .so for the PHP5.5 you just built using the PHP configuration files.
After that you need to install the PHP SDK and configure it to use the newly built PHP binary
$ dev_appserver.py <...> --php_executable_path=/opt/php55/bin/php-cgi
The SDK will let you know if the built PHP binaries are incompatible with the SDK version you use. I remember compiling the PHP from source around 5 times before it worked without any warnings.
But essentially they are telling you to compile PHP from source, then compile their extension from source and then use the built PHP+extension with the downloaded SDK. These instructions are from the top of my head so you may need to adjust the commands and procedures.
The process can be simplified by using Docker, here is an image you can use: https://hub.docker.com/r/mhariri/docker-google-appengine-php/
To run your app, you just need docker installed, and then run the following command in your app directory:
docker run -it -v $(pwd):/app --rm --net=host mhariri/docker-google-appengine-php

Can't install xdebug on Mac with Homebrew

I'm kind of new to using Homebrew, but I love it. It's so easy. I'm trying install Xdebug. Some of the posts on the web say to do this:
brew install xdebug
But it doesn't work. I get: Error, no available formula.
I did brew search xdebug and it returned:
josegonzalez/php/php53-xdebug josegonzalez/php/php54-xdebug
I tried several different iterations of brew install with this including brew install php53-xdebug, but still no luck. Can someone help me? I can't find anything on Xdebug's site about using Homebrew, but yet posts on the web seem to indicate it's possible.
// Working as of 2023
As homebrew removed the extra php repository containing a version with xdebug already installed, you have to install it manually.
Summary
brew install <php version> for php
update your path
pecl install xdebug for xdebug
Full step-by-step example
# update homebrew
brew update
# install a version of php, e.g. 7.0
brew install php#7.0
# now they tell you how to link it, in my case
echo 'export PATH="/usr/local/opt/php#7.0/bin:$PATH"' >> ~/.bash_profile
echo 'export PATH="/usr/local/opt/php#7.0/sbin:$PATH"' >> ~/.bash_profile
# reload the file with the updated path, so we can use pecl
source ~/.bash_profile
# check that the path is to the correct php executable,
# and pecl is available
which pecl
# returns: /usr/local/opt/php#7.0/bin/pecl
# install xdebug, see https://xdebug.org/docs/install#pecl
pecl install xdebug
# check that everything worked
php --version
# should show a xdebug version
# like: with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans
The pecl install xdebug step above ended with
Build process completed successfully
Installing '/usr/local/Cellar/php#7.0/7.0.30/pecl/20151012/xdebug.so'
install ok: channel://pecl.php.net/xdebug-2.6.0
Extension xdebug enabled in php.ini
So I didn't even need to enable the xdebug.so in php.ini.
If you need a special version of xdebug (e.g. your IDE doesn't like the 3.x.x versions), you can install a specific version xdebug-$VERSION, e.g. pecl install xdebug-2.9.8.
You can find them on the list of available versions (Thanks Bower)
Add this repository: https://github.com/josegonzalez/homebrew-php#readme
Then use brew install php54-xdebug for PHP 5.4
Or brew install php53-xdebug for PHP 5.3
Or brew install php55-xdebug for PHP 5.5
Forget about homebrew for a moment. I have tried doing with it and it is not a that good idea stability-wise. Instead stick to the default installation guide:
Installing XDebug on Mac OSX
Go to http://xdebug.org/wizard.php and paste your phpinfo() content
there.
Download xdebug-2.2.5.tgz (http://xdebug.org/files/xdebug-2.2.5.tgz)
Unpack the downloaded file with:
tar -xvzf xdebug-2.2.5.tgz
Run:
cd xdebug-2.2.5
Run phpize (install it via homebrew if you don't have it already)
phpize
As part of its output it should show (If it does not, you are using the wrong phpize):
Configuring for: ...
Zend Module Api No: 20100525
Zend Extension Api No: 220100525
Run:
./configure
Run:
make
Run:
cp modules/xdebug.so /usr/lib/php/extensions/no-debug-non-zts-20100525
Edit /etc/php.ini and add the line:
zend_extension =
/usr/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so
Restart the web server by typing in the terminal:
sudo apachectl restart
Updated: 09-10-2019
For PHP 5.6 & 7.0 (not anymore in brew core)
brew tap exolnet/homebrew-deprecated
Use brew bundled pecl (when php installed with brew)
PHP 5.6 example
brew install php#5.6
$(brew --prefix php#5.6)/bin/pecl install --force xdebug-2.5.5
PHP 7.0 example
brew install php#7.0
$(brew --prefix php#7.0)/bin/pecl install --force xdebug
PHP 7.1 example
brew install php#7.1
$(brew --prefix php#7.1)/bin/pecl install --force xdebug
PHP 7.2 example
brew install php#7.2
$(brew --prefix php#7.2)/bin/pecl install --force xdebug
PHP 7.3 example
brew install php#7.3
$(brew --prefix php#7.3)/bin/pecl install --force xdebug
or link with brew first
PHP 5.6 example
brew install php#5.6
brew link --force php#5.6
pecl install --force xdebug-2.5.5
brew unlink php#5.6
PHP 7.0 example
brew link --force php#7.0
pecl install --force xdebug
brew unlink php#7.0
PHP 7.1 example
brew link --force php#7.1
pecl install --force xdebug
brew unlink php#7.1
PHP 7.2 example
brew link --force php#7.2
pecl install --force xdebug
brew unlink php#7.2
PHP 7.3 example
brew link --force php#7.3
pecl install --force xdebug
brew unlink php#7.3
If php -v gives you an error stating xdebug.so could not be found (assuming the pecl install went well) then you could have "old" settings like php.ini Un-/reinstalling php with brew does not remove ini files. Upgrading php to the new format does not update ini files. Just reinstall php with brew after you removed the folder /usr/local/etc/php/5.6/ and xdebug should work.
The new brew php installation does not link. You could do that yourself if you would like to (brew link --force php#5.6) Als you could install brew-php-switcher to switch between versions.
brew install brew-php-switcher
brew-php-switcher 5.6 -s
php -v
brew-php-switcher 7.0 -s
php -v
Keep in mind if you loaded php as a service you have to restart the service.
brew services restart php#7.0
I'd found this page while googling how to install xdebug for php 7.1 on osx, and I've decided to leave here my solution:
brew install homebrew/php/php71-xdebug
Maybe it'll be helpful for someone else in future...
Xdebug on Big Sur for php8
php8 previously installed with brew.
~ % pecl install xdebug
ERROR: `phpize' failed
Ouch! Check xcrun. Thank you Louis Charette:
~ % xcrun --show-sdk-path
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Error. Update Xcode. I just installed, and retest:
~ % xcode-select --install
xcode-select: note: install requested for command line developer tools
~ % xcrun --show-sdk-path
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
That's better! Now go back and try pecl again:
~ % pecl install xdebug
...
Build process completed successfully
Installing '/usr/local/Cellar/php/8.0.0_1/pecl/20200930/xdebug.so'
install ok: channel://pecl.php.net/xdebug-3.0.2
Extension xdebug enabled in php.ini
And check it worked:
~ % php -v
PHP 8.0.0 (cli) (built: Nov 30 2020 13:51:52) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.0-dev, Copyright (c) Zend Technologies
with Xdebug v3.0.2, Copyright (c) 2002-2021, by Derick Rethans
with Zend OPcache v8.0.0, Copyright (c), by Zend Technologies
This is my solution! Try it! ;)
1 Install developer tools:
xcode-select --install
2 Instal Autoconf. This is a tool for producing shell scripts that automatically configure software
brew install autoconf
3 If you use PHP >5.6
sudo pecl install xdebug
Have fun ;)
Catalina
Starting with Catalina (Mac OS 10.15) PHP seems to be pre-installed (check with php -v) It could be installed along xcode or another software (I'm not sure) But I just installed Catalina yesterday and haven't installed Homebrew yet, Also xdebug is available too. I just had to rename /etc/php.ini.default and add this line
zend_extension = /usr/lib/php/extensions/no-debug-non-zts-20180731/xdebug.so
macOS 10.14 Mojave, Homebrew, PHP 7.3, April 2020
The description given in the following article was the only thing I could get to work on macOS 10.14 Mojave with Homebrew to install PHP 7.3 with working xdebug:
brew list | grep php | awk '{ print "brew uninstall --force "$1}' | bash # Remove any old version of php.
rm -rf /usr/local/Cellar/php # To be sure, manually remove the php cellar folder.
brew untap homebrew/php # Then clean any php tap (extra repo).
brew cleanup # Cleanup and Update your brew.
brew update
brew install php # Install the latest version of php.
pecl uninstall xdebug # Clean up old xdebug.
pecl install xdebug-beta # Install the latest version of xdebug-beta (The xdebug is not compatible with 7.3 so you need to use the xdebug-beta).
php -v # Should now say "with Xdebug v2.9.4, Copyright (c) 2002-2020, by Derick Rethans"
It looks like the repo moved, but it is available here, complete with instructions on how to access it from Homebrew.
If you get this error after adding the tap and installing:
$ brew install "josegonzalez/php/php55"
==> Installing php55 from josegonzalez/php
Error: Formulae found in multiple taps:
* homebrew/php/php53
* josegonzalez/php/php53
Please use the fully-qualified name e.g. homebrew/php/php53 to refer the formula.
it is because josegonzalez/php has been moved to homebrew-php/php recently, so you will face the previous error.
The idea is pretty simple, remove the old deprecated repo josegonzalez/php
brew untap josegonzalez/php
brew tap --repair
brew update
See the source of this solution to fix any other related bugs.
It helped me to solve zend version and xdebug
Xdebug requires Zend Engine API version 320160303.
The Zend Engine API version 320180731 which is installed, is newer.
https://xdebug.org/wizard.php
As at May 2021, after installing PHP via Homebrew just run this:
pecl install xdebug
You'll need XCode installed as above answers have indicated.
The other answers involving other brew repositories or php74-* package namespaces are based on the old way Homebrew worked with PHP.
Improved Answer for MacOS
If you have followed the instructions written on the official docs and cannot see XDebug info using php -v command and instead getting errors, the last step you should do is the following:
Go to the 99-xdebug.ini file you made in the described path and add this line:
zend_extension="/usr/lib/php/extensions/no-debug-non-zts-20180731/xdebug.so"
(still errors? check your xdebug.so path if it is valid)
After saving the changes, restart php using the command below:
brew services restart php#7.3 (change 7.3 with your php version)
Then check if you can now see XDebug info using php -v command.
NOTE: "Described path" for 99-xdebug.ini is something like:
/usr/local/etc/php/7.3/conf.d (change 7.3 with your php version)
To be sure, type php --ini command.

Resources