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.
Related
I am struggling with linking the newly installed PHP version on macOS Mojave (10.14.6)
I've installed PHP 7.3 via MacPorts (I need that exact version right now, I might update it later). Installation went alright, no errors.
When I run php -v it gives me
PHP 7.1.33 (cli) (built: Jan 26 2020 22:52:32) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
which, I suppose, is the version shipped with the OS.
My .bash_profile looks like this
PATH=/usr/bin:/bin:/sbin:/opt/bin
PATH=/usr/local/sbin:"$PATH"
PATH=/usr/local/bin:/usr/sbin:"$PATH"
PATH=/opt/local/bin:/opt/local/sbin:"$PATH"
export PATH
export PATH=${PATH}:/Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin/
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
When I run php73 -v it logs
PHP 7.3.33 (cli) (built: Feb 16 2023 20:14:16) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.33, Copyright (c) 1998-2018 Zend Technologies
MacPorts has installed the PHP 7.3 into /opt/local/bin.
So obviously, the php version in use by the OS doesn't know about PHP 7.3
Oh, and using homebrew is not really an option. I've just lost hours trying it to install php 8.2 and it failed with one lib or another, constantly claiming that my XCode command line tools are outdated (duh! – and I am not upgrading those as it would require updating the OS to the latest version which would in turn strain my MBP even further).
Any help is greatly appreciated.
hi i install homebrew install some brew things and now i need install Xdebug but when i write to terminal on mac php --version there is only version of php not version php with xdebug only version of php
$ php --version
PHP 7.2.8 (cli) (built: Aug 28 2018 16:32:29) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
help me i doo all things what i should but it not work correctly help thx
With the migration to Homebrew-core the php formula has stopped taking over the role of PECL. Installing xdebug can (and should) be done through PECL (https://pecl.php.net/package/xdebug).
pecl update-channels
pecl list-all
pecl install xdebug
or upgrade it
pecl upgrade xdebug
After that you'd need to update your php.ini with a line to specify xdebug's location, as suggested on xdebug.org:
zend_extension="/usr/local/php/modules/xdebug.so"
Additionally, you may need to put in there some settings for xdebug, for example:
xdebug.collect_vars=1
xdebug.remote_autostart=1
xdebug.remote_enable=1
xdebug.remote_port=9005
Source: http://www.artemdwo.com/install-php72-and-xdebug-on-mac-os-x
I am using php 7.0 in Ubuntu 18.04 LTS.
I have to implement multi-threading in php with help of pthread.
Several method I tried but every time getting
configure: error: pthreads requires ZTS, please re-compile PHP with ZTS enabled
ERROR: `/tmp/pear/temp/pthreads/configure --with-php-config=/usr/bin/php-config' failed
Even I tried to install php from scratch but could not success.
I was follow following website steps :
https://www.rapidspike.com/blog/php7-pthreads/
Please help.
According to your comment:
php -v output is follow : PHP 7.0.31-1+ubuntu18.04.1+deb.sury.org+1
(cli) (built: Jul 25 2018 10:01:10) ( NTS ) Copyright (c) 1997-2017
The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend
Technologies with Zend OPcache v7.0.31-1+ubuntu18.04.1+deb.sury.org+1,
Copyright (c) 1999-2017, by Zend Technologies with Xdebug v2.6.0,
Copyright (c) 2002-2018, by Derick Rethans
You are trying to install a pecl package against the invalid version of PHP which is in your case ( NTS ) instead of ( ZTS ).
To get rid of this you will need one of this possible actions:-
1- Install pecl package for a specific PHP version.
pecl -d php_suffix=X.X-zts install pthreads
2- Update the default version for your environment.
sudo update-alternatives --set php /usr/bin/phpX.X-zts
Note & Warning: this means that all of your php terminal applications will be running under the ZTS version which may cause some unexpected behaviors.
However you can toggle your PHP versions back after installation.
3 - Compile phtread from source and define the target PHP version (complicated but preferred).
$ git clone https://github.com/krakjoe/pthreads.git
$ cd pthreads/
$ phpize
$ ./configure --with-php-config=/path/to/php-zts/bin/php-config
$ make
$ make install
You will may need to update alternatives also for phpize
update-alternatives --set phpize /usr/bin/phpize-zts
Note: All of PHP versions that had been mentioned in this answer may be different from setup to setup, So you may need to check your PHP version name&path using locate bin/php
I'm on Ubuntu 16.04 and I'm trying to install prestashop e-commerce CMS that requires php zip extension to unzip the main CMS folder.
I have installed php-zip and php7.2-zip and I also restarted the web server (apache2) but the CMS still displays the following message
An error has occured:
You must install PHP zip extension first
Here's the result of my installed php zip packages and my current php version:
eljaouhari#eljaouhari-HP-350-G1:/var/www/html$ php -v
PHP 7.2.5-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: May 5 2018 04:59:13) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.5-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
eljaouhari#eljaouhari-HP-350-G1:/var/www/html$ apt list --installed | grep php | grep zip
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
php-zip/xenial,xenial,now 1:7.2+60+ubuntu16.04.1+deb.sury.org+1 all [installé]
php7.2-zip/xenial,now 7.2.5-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installé]
I spent an hour and a half trying to figure out whether I need to activate the extestion on the php.ini file and also installing and reinstalling and restarting the web server but nothing seems to work.
I have tried a few solutions on the web that used to work for me but I can't seem to find a good solution.
Please help me with your experience!
I've found the solution after I printed the results of the phpinfo() function.
It seems that the version of php printed with the "php -v" command is not the version that actually apache is using. Apache ended up using the 7.0 version.
Thanks everyone.
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.