Hi I'm trying to install mailparse for my php7.4.21 on my linux centos7 server but the documentation is not great and I'm no sysadin.
https://www.php.net/manual/en/mailparse.installation.php states "In order to use these functions you must compile PHP with mailparse support by using the --enable-mailparse configure option". This is not very helpful but so far I've had to do the following:
// To install re2c:
> curl http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/r/re2c-0.14.3-2.el7.x86_64.rpm --output re2c-0.14.3-2.el7.x86_64.rpm
> rpm -Uvh re2c-0.14.3-2.el7.x86_64.rpm
// I then installed mailparse
> pecl install mailparse
// I then modified php.ini to add the following:
extension=mailparse
// I then restarted apache
> systemctl restart httpd
But looking at my phpinfo output I cannot see mailparse listed.
What do I need to do next?
NOTE: I'm not sure I've actually "compiled PHP with mailparse" and I'm not sure how to apply "using the --enable-mailparse configure option".
Thanks
Abe
so I ended up on https://github.com/php-mime-mail-parser/php-mime-mail-parser/blob/master/README.md that talks about using sudo apt install php-cli php-mailparse for Ubuntu systems, which after a little more effort I found that yum install php-cli php-mailparse was the equivalent for centos (and then restarting apache). This worked.
yum install php-cli php-mailparse
systemctl restart httpd
I have installed php7.4 via RHEL8's Default Stream using dnf.
I want to install the php's ssh2 module.
How do I install Pyrus (Pear2 Package Manager) on RHEL8 with php7.4?
When I tried: php pyrus.phar
I got the error message in command prompt: Could not open input file: pyrus.phar
I used:
updatedb
locate pyrus
Got nothing
So, what is the issue here?
Best Regards
Thayalan
I wanted to install php's ssh2 extension via Pyrus but I was having trouble with Pyrus. Therefore, I tried it without Pyrus. I preferred yum or dnf installation throughout. But, it was not possible for some. The following are how I have installed ssh2:
yum install make gcc php-devel php-pear
libssh2 package (ssh2 package needs it) installed by downloading the file https://libssh2.org/download/libssh2-1.10.0.tar.gz into an appropriate folder.
Then, I entered the following commands:
tar -zxvf libssh2-1.10.0.tar.gz
cd libssh2-1.10.0
./configure
make
make install
ssh2 package installed by downloading the file https://pecl.php.net/get/ssh2-1.3.1.tgz into an appropriate folder.
Then, I entered the following commands:
tar -zxvf ssh2-1.3.1.tgz
cd ssh2-1.3.1
phpize
./configure
make
make test
make install
Then I entered the following entry into /etc/php.ini: extension=ssh2.so
After that, I restarted php by: systemctl restart php-fpm
And now, php's ssh2 extension has been successfully installed.
I am trying to install xdebug with pecl install xdebug on PHP 5.5.27
According to PECL website https://pecl.php.net/package/xdebug latest stable version of xdebug is 2.3.3
However command above is trying to install xdebug 2.3.2
What is wrong with this?
When using pecl program to install a package, you can install a specific version, or upgrade to a specific version:
pecl install xdebug-2.3.3
Even if it's not the case here if one needs to downgrade a package, the force (-f) option may be required to make it work:
pecl install -f xdebug-2.3.3
You need to download it manually:
wget http://xdebug.org/files/xdebug-2.3.3.tgz
tar -xvzf xdebug-2.3.3.tgz
cd xdebug-2.3.3
phpize
./configure
make
If you are running a tool like homestead you won't need further steps and do not forget to take backup before steps below.
cp modules/xdebug.so /usr/lib/php5/20131226
Update /etc/php5/fpm/php.ini
zend_extension = /usr/lib/php5/20131226/xdebug.so
Restart the webserver
stack: PHP 5.4.23, php-fpm, nginx 1.4.x, centos 6.5
I was trying to install xdebug, had to run phpize command.
I have php5-devl already installed and pecl command works
When I ran the command, it gave me the following error output:
# phpize
Can't find PHP headers in /usr/include/php
The php-devel package is required for use of this command.
How to fix this error?
I think you have not installed php-pear . I am not seeing it in that link.
You can do it by yum install php-pear
Info
You can install xdebug also using these steps
1) Install PHP’s devel package for PHP commands execution
yum install php-devel
Make sure you also have php-pear package installed
yum install php-pear
2) Install GCC and GCC C++ compilers to compile Xdebug extension yourself.
yum install gcc gcc-c++ autoconf automake
3) Compile Xdebug
pecl install Xdebug
4) Find the php.ini file using
`locate php.ini`
And add the following line
[xdebug]
zend_extension="/usr/lib64/php/modules/xdebug.so"
xdebug.remote_enable = 1
5) Restart Apache
service httpd restart
6) Test if it works – create test.php with the following code
<?php phpinfo(); ?>
The problem got solved by the PHP version that is used in the system.
My PHP Version was 5.6
So by running the following command I solved the problem
yum install php56-devel
Where "56" is your version of PHP.
If you're on PHP 7 such as in my case just installing php-devel won't solve your problems, but you'll need to install some additional packages:
yum install php-devel pcre-devel gcc make
And then you'll be able to follow Harikrishnan steps to get xdebug working (if not yet configured).
My problem hasn't been solved using
yum install php-devel
But this helped me to solve the problem:
yum --enablerepo=remi,remi-php55 install php55-php-devel
I'm trying to install Facebook PHP SDK with Composer. This is what I get
$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for facebook/php-sdk dev-master -> satisfiable by facebook/php-sdk[dev-master].
- facebook/php-sdk dev-master requires ext-curl * -> the requested PHP extension curl is missing from your system.
Problem is, I have curl extension enabled (uncommented in php.ini). When I run phpinfo(), it says it's enabled.
Only clue I have is that when I run $ php -m, 'curl' line is missing but I don't know what to do about it.
I have wamp 2.4 on Win8 and I'm running composer in cmd.exe.
This is caused because you don't have a library php5-curl installed in your system,
On Ubuntu its just simple run the line code below, in your case on Xamp take a look in Xamp documentation
sudo apt-get install php5-curl
For anyone who uses php7.0
sudo apt-get install php7.0-curl
For those who uses php7.1
sudo apt-get install php7.1-curl
For those who use php7.2
sudo apt-get install php7.2-curl
For those who use php7.3
sudo apt-get install php7.3-curl
For those who use php7.4
sudo apt-get install php7.4-curl
For those who use php8.0
sudo apt-get install php8.0-curl
Or simply run below command to install by your version:
sudo apt-get install php-curl
This worked for me: http://ubuntuforums.org/showthread.php?t=1519176
After installing composer using the command curl -sS https://getcomposer.org/installer | php just run a sudo apt-get update then reinstall curl with sudo apt-get install php5-curl. Then composer's installation process should work so you can finally run php composer.phar install to get the dependencies listed in your composer.json file.
on php7 run for example:
> sudo apt-get install php-curl
> sudo apt-get install php-mbstring
for every missing extension. Then:
> sudo apt-get update
and finally (in the project's root folder):
> composer install
As Danack said in comments, there are 2 php.ini files. I uncommented the line with curl extension in the one in Apache folder, which is php.ini used by the web server.
Composer, on the other hand, uses php for console which is a whole different story. Php.ini file for that program is not the one in Apache folder but it's in the PHP folder and I had to uncomment the line in it too. Then I ran the installation again and it was OK.
I ran into the same issue trying to install Dropbox SDK.
CURL was indeed enabled on my system but this meant by the php.ini in the wamp\bin\apache folder.
I simply had to manually edit the php.ini situated in wamp\bin\php, uncomment the extension=php_curl.dll line, restart Wamp and it worked perfectly.
Why there are those 2 php.ini and only one is used is still a mystery for me...
Hope it's helpul to someone!
I had this problem after upgrading to PHP5.6. My answer is very similar to Adriano's, except I had to run:
sudo apt-get install php5.6-curl
Notice the "5.6". Installing php5-curl didn't work for me.
For anyone who encounters this issue on Windows i couldn't find my answer on google at all.
I just tried running composer require ext-curl and this worked.
Alternatively add the following in your composer.json file:
"require": {
"ext-curl": "^7.3"
}
According to https://github.com/composer/composer/issues/2119 you could extend your local composer.json to state that it provides the extension (which it doesn't really do - that's why you shouldn't publicly publish your package, only use it internally).
I ran into a similar issue when trying to get composer to install some dependencies.
It turns out the .dll my version of Wamp came with had a conflict, I am guessing, with 64 bit Windows.
This url has fixed curl dlls: http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/
Scroll down to the section that says: Fixed Curl Extensions.
I downloaded "php_curl-5.4.3-VC9-x64.zip". I just overwrote the dll inside the wamp/bin/php/php5.4.3/ext directory with the dll that was in the zip file and composer worked again.
I am running 64 bit Windows 8.
Hope this helps.
if use wamp go to:
wamp\bin\php\php.5.x.x\php.ini
find:
;extension=php_curl.dll
remove (;)
Enable in php 7 try below command
sudo apt-get install php7.0-curl
Not sure why an answer with Linux commands would get so many up votes for a Windows related question, but anyway...
If phpinfo() shows Curl as enabled, yet php -m does NOT, it means that you probably have a php-cli.ini too. run php -i and see which ini file loaded. If it's different, diff it and reflect and differences in the CLI ini file. Then you should be good to go.
Btw download and use Git Bash instead of cmd.exe!
I have Archlinux with php 7.2, which has Curl integrated, so no amount of configuration voodoo would make Composer see ext-curl, that PHP could see and work with happily. Work around is to use Composer with --ignore-platform-reqs.
eg composer update --ignore-platform-reqs
Reference = https://github.com/composer/composer/issues/1426
try install php5-curl by using below snippet.
sudo apt-get install php5-curl
if it won't work try below code i m sure it will work fine.
sudo apt-get install php-curl
for me it worked... all the best :)
In my case I moved from PHP5 to PHP7 and I ve got this error,
Simply go to your /bin/php/php7/php.ini , then uncomment extension=php_curl.dll and restart your server, re-run your composer install.
If you getting error like php7.2-curl doesn't have installable candidate or not locate any package or dependencies is php7.2-common Or libcurl3 Do this
You have to tackle in mature way. Install aptitude these ubuntu package manager will finds all dependencies, and will install one by one.
apt-get install aptitude
Now you have to check if aptitude can download it or not if download it follow instructions
sudo aptitude install php7.2-curl
If you have gotten any error like this
E: Unable to locate package php7.2-curl
E: Couldn't find any package by glob 'php7.2-curl'
Any type on error i'm not talking about proper these errors
Try to add php package again
sudo apt-add-repository ppa:ondrej/php
sudo apt-get update
Now try this command
sudo aptitude install php7.2-curl
Aptitude will ask you you want to keep current version of all dependencies
The following actions will resolve these dependencies:
Keep the following packages at their current version:
1) php7.2-curl [Not Installed]
Accept this solution? [Y/n/q/?]
Type n then Enter
Aptitude will find all dependencies and ask you to install all package type
y
Again
y
Then
systemctl restart apache2
For centos of rhel
systemctl restart httpd
It will Not enabling PHP 7.2 FPM by default.
NOTICE: To enable PHP 7.2 FPM in Apache2 do
a2enmod proxy_fcgi setenvif
a2enconf php7.2-fpm
This method is not only for this error you can find any of php apache2 or ubuntu system package solution using aptitude.
Upvote if you find your solution
If you are ubuntu, this will work for you.
composer update --ignore-platform-reqs