I currently have php72 installed on amazon linux one.
[ehost ~]$ php -v
PHP 7.2.11 (cli) ( built: Oct 16 2018 23:50:44) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
When I attempt to install a custom rpm I get the following.
How do I let the rpm know that PHP 7.2 is already installed?
Error: Package: mct_console-3.40.1-
6624_f7150d48.noarch (/mct_console-
3.40.1-6624_f7150d48.noarch)
Requires: php >= 7.0.2
Available: php-5.3.29-
1.8.amzn1.x86_64 (amzn-main)
Another Error:
Error: Package: mct_console-3.40.1-
6624_f7150d48.noarch (/mct_console-
3.40.1-6624_f7150d48.noarch)
Requires: php-mysql >= 7.0.2
Available: php-mysql-5.3.29-
1.8.amzn1.x86_64 (amzn-main)
The packages php and php72 are two separate packages. You have one called php but it's only 5.3.29. If that's your only dependency that is missing, you can do rpm -i --nodeps to get around it.
However, whatever tool you are trying to install will need to have the PATH fixed in whatever you are currently doing it to change the default php executable to be the 7.2 one.
Related
I have recently upgraded my Mac to run PHP 8. I noticed Xdebug was no longer installed, so I tried to install it again but I get the following error:
% pecl install xdebug
/usr/local/bin/pecl: line 28: /usr/local/Cellar/php#8.0/8.0.15/bin/php: No such file or directory
/usr/local/bin/pecl: line 28: exec: /usr/local/Cellar/php#8.0/8.0.15/bin/php: cannot execute: No such file or directory
I tried the wizard at https://xdebug.org/wizard, but I can't get phpize installed.
My Mac is running Montery 12.0.1, any idea how I can fix this?
I had the same error message, I resolved it by reinstalling PHP 8.0 with homebrew as explained in this answer:
brew install php#8.0
Be careful that homebrew with also try to update all dependencies and other packages.
Then pecl worked again and I could install xdebug.
[22:39:40] coil#mac-mini.home:/Users/coil/Sites/strangebuzz.com$ php -v
PHP 8.0.19 (cli) (built: May 12 2022 09:09:32) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.19, Copyright (c) Zend Technologies
with Xdebug v3.1.4, Copyright (c) 2002-2022, by Derick Rethans
with Zend OPcache v8.0.19, Copyright (c), by Zend Technologies
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.
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
Why I am getting 2 different versions of php ?
When I am checking via a php file:
<?php
echo 'Current PHP version: ' . phpversion();
output:
Current PHP version: 7.0.18-1+deb.sury.org~xenial+1
When I am checking via a terminal command:
root#dev-Inspiron-N5110:~# php -v
PHP 7.1.4-1+deb.sury.org~xenial+1 (cli) (built: Apr 11 2017 22:12:32)
( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.1.4-1+deb.sury.org~xenial+1, Copyright (c) 1999-
2017, by Zend Technologies
php -v giving me PHP 7.1.4-1+deb.sury.org~xenial+1 and phpversion() giving me 7.0.18-1+deb.sury.org~xenial+1.
That is because you have two different versions installed for PHP. The PHP cli is picking up the latest one whereas Apache has been set up with php 7.0.
What you can do is remove both the PHP version from your system and then do a fresh install again:
sudo apt-get install ppa-purge
sudo ppa-purge ppa:ondrej/php-7.0
sudo apt-get purge php7.*
and then install latest PHP 7 from the official Ubuntu Repository like so:
sudo apt-get install php libapache2-mod-php php-mcrypt php-mysql
as you are using Ubuntu 16 the new PHP version will be >=7
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