I cannot install Composer on Ubuntu 14.04 with:
sudo curl -sS https://getcomposer.org/installer | php
I got error:
#!/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 json extension is missing.
Install it or recompile php without --disable-json
The openssl extension is missing, which means that secure HTTPS transfers are impossible.
If possible you should enable it or recompile php with --with-openssl
Current PHP version:
PHP 5.5.3 (cli) (built: Feb 9 2015 12:47:41)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
Related
I'm trying to install mongodb exentsion for php 8.0.13 on my MacOS Monterey.
I try sudo pecl install mongodb command: and then get below errror.
/opt/homebrew/Cellar/php#8.0/8.0.13/include/php/ext/spl/spl_iterators.h:151:4: error: unknown type name 'pcre_cache_entry'
pcre_cache_entry *pce;
^
1 error generated.
make: *** [php_phongo.lo] Error 1
ERROR: `make' failed
which php: /opt/homebrew/bin/php
php -v: PHP 8.0.13 (cli) (built: Nov 28 2021 13:11:14) ( NTS ) Copyright (c) The PHP Group Zend Engine v4.0.13, Copyright (c) Zend Technologies with Zend OPcache v8.0.13, Copyright (c), by Zend Technologies
Can anyone help me for fix this error?
Thanks for your attention!
To compile MongoDB using PECL you will have to copy the pcre2.h to php's include directory.
For php#8.0, you can do this, But you will have to do this after every PHP release or if you switch the PHP version.
pcre2_h="$(find "$(brew --cellar pcre2)" -name "pcre2.h")"
cp -f "$pcre2_h" "$(brew --cellar php#8.0)"/*/include/php/ext/pcre
To avoid this I would recommend using shivammathur/extensions brew tap for installing PHP extensions.
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.
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 trying to install composer on my Website. The Composer documentations suggests running this command:
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"`
but when I do, I get an error:
Error in argument 1, char 2: option not found r
I use PHP Version 7.0
What's going on here?
I suspect php in your case is referring to PHP's CGI-SAPI binary instead of the CLI that it should be. As documented in the PHP manual, the CGI-SAPI does not include the -r option:
Note:
-r is available in the CLI SAPI, but not in the CGI SAPI.
You can confirm that this is the case by checking "php's" version with the -v flag.
Proper setup should show that php is a CLI interupter:
C:\Users\HPierce>php -v
PHP 7.0.8 (cli) (built: Jun 21 2016 15:27:20) ( ZTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
Improper setup might show that it is the CGI SAPI:
C:\Users\HPierce>php-cgi -v
PHP 7.0.8 (cgi-fcgi) (built: Jun 21 2016 15:27:08)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
You can resolve this by referencing the CLI binary with an absolute path instead of the php shortcut that utilizies your OS's $PATH environment variable:
C:\php\php.exe -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
I had the same problem, and used curl and it worked:
curl -sS https://getcomposer.org/installer | /usr/bin/php7.1-cli
Additionally, to do specific commands to install a package, I needed to specify the php version Composer was installed on, and write "composer.phar" instead of only composer:
php7.1-cli composer.phar require exampleAppDirectory/exampleAppName