Installing PHP56 Mongo Driver in my ec2 (centos/linux) instance - php

I want to install mongo driver manager as given here http://php.net/manual/en/mongodb.installation.pecl.php
Mongo is already running. pecl is not there in my instance. you can find my phpinfo here
Please guide me through the necessary steps.
EDIT
I have installed pecl,, now I suppose I have to install php-devel but I am getting the following error
Error: httpd24-tools conflicts with httpd-tools-2.2.31-1.8.amzn1.x86_64
Error: php56-cli conflicts with php-cli-5.3.29-1.8.amzn1.x86_64
Error: httpd24 conflicts with httpd-2.2.31-1.8.amzn1.x86_64
Error: php56-common conflicts with php-common-5.3.29-1.8.amzn1.x86_64
Error: php56 conflicts with php-5.3.29-1.8.amzn1.x86_64

Was able to install pecl using the following list of commands in php-5.6 ec2
sudo yum install php-pear
sudo yum install php56-devel
sudo yum install gcc
sudo yum install openssl-devel
sudo pecl install mongodb

Related

Install pecl on Centos 7 PHP7.4

I want to install PECL on centos 7 with php7.4, I use this command on cPanel Terminal:
sudo yum install php-pear
but I got this error:
file /usr/bin/php from install of php-cli-5.4.16-48.el7.x86_64 conflicts with file from package ea-php-cli-1.0.0-9.10.1.cpanel.x86_64

How to add curl on php7.2 and ubuntu 14

I am trying to install curl on my ubunutu 14 server with php 7.2 installed. I run the following command:
sudo apt-get install php7.0-curl
but it gives error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.0-curl
E: Couldn't find any package by regex 'php7.0-curl'
I then tried to resolve this issue by running commands:
sudo apt-add-repository ppa:ondrej/php
sudo apt-get update
sudo apt install apache2 libapache2-mod-php7.0 php7.0
But that also end up with same "Couldn't find package" error.
Your Ubuntu distro trusty is too old and those packages aren't available. You will have to build the library from the source by yourself.
Here you can find solution your problem How do I install the ext-curl extension with PHP 7?
Shortly, try to execute
sudo apt-get install php-curl
Also you can use sudo apt-cache search curl which shows you available packages for installation.

How to install php-xml on Ubuntu 16.04?

I have php7.0 installed on Ubuntu 16.04 and I'm trying to install a forum software in apache2, but I get the following error:
In order to function correctly, the PHP XML/DOM extension needs to be available.
I tried to execute
sudo apt-get install php-xml
sudo apt-get install php7.0-xml
but these give me the following error:
php-xml: Depends: php7.1-xml but it is not going to be installed
When I try to install php7.1 from a PPA, I still get issues of dependencies from other PHP modules.
Any ideas how I can get php-xml installed without any dependency issues?
Can you try installing the .deb files manually from here https://launchpad.net/ubuntu/xenial/+package/php-xml

Error 1 ERROR: `make' failed when installing sqlsrv

I'm trying to install sqlsrv by using the commands from this page. However, when running
pecl install sqlsrv-4.2.0preview
I get the error: Error 1 ERROR: 'make' failed.
I tried :
apt-get update
apt-get install build-essential
apt-get install libpcre3-dev
apt-get install make
All of these are installed on the latest version.
I'm running a container using the php:7.0-apache image. Running apachectl -V returns Apache/2.4.10 (Debian).
Here is the full log output from the command I ran: https://pastebin.com/MYDY3xwU
I had this exact error.
/tmp/pear/temp/sqlsrv/shared/xplat.h:30:17: fatal error: sql.h: No such file or directory
#include <sql.h>
Apparently the header file its looking for is only in the package unixODBC-devel.
I installed that package and was able to successfully complete the build. yum install unixODBC-devel.
Possibly, a better explanation is here.
stackoverflow Question # 15447386
I had the following error on Ubuntu 18.04 when installing
/tmp/pear/temp/sqlsrv/shared/xplat.h:30:10: fatal error: sql.h: No such file or directory #include <sql.h>
Installing the package unixodbc-dev as Matthew Goheen proposed solved the issue
sudo apt-get install unixodbc-dev
try
sudo apt-get install unixodbc-dev

Cannot update to php 5.4 - AWS ec2

I was having php5.3 and httpd2.2 on my instance. Now I need to upgrade to php 5.4.
I am following these instructions :
http://codingsteps.com/install-apache-2-4-php-5-4-php-apc-on-amazon-ec2-with-amazon-linux/
I have sudo yum remove all the conflicts and now the remaining two are:
Error: httpd24-tools conflicts with httpd-tools-2.2.29-1.4.amzn1.x86_64
Error: httpd24 conflicts with httpd-2.2.29-1.4.amzn1.x86_64
But if I run for example :
[ec2-user#ip-172-31-44-86 ~]$ sudo yum install -y httpd24 php54
...
--> Finished Dependency Resolution
Error: httpd24-tools conflicts with httpd-tools-2.2.29-1.4.amzn1.x86_64
Error: httpd24 conflicts with httpd-2.2.29-1.4.amzn1.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
[ec2-user#ip-172-31-44-86 ~]$
EDIT :
I am trying to remove them :
sudo yum remove httpd-tools-2.2.29-1.4.amzn1.x86_64
But I get that :
Loaded plugins: priorities, update-motd, upgrade-helper
No Match for argument: httpd-tools-2.2.29-1.4.amzn1.x86_64
No Packages marked for removal
What should I do?
This might be a day late and a dollar short but this worked for me.
sudo yum remove httpd* php*
sudo yum install httpd24 php54
https://forums.aws.amazon.com/thread.jspa?messageID=465912
You have to remove your old version of httpd prior to installing the new version.
yum remove httpd-tools-2.2.29-1.4.amzn1.x86_64 httpd-2.2.29-1.4.amzn1.x86_64
I had the same problem installing PHP55 devel package.
I've solved uninstalling httpd and PHP again and installing with this command:
sudo yum install -y httpd24 php55 php55-common php55-devel
Note that if you try to install httpd and php, and later php-devel, you get
Error: httpd24-tools conflicts with httpd-tools-2.2.29-1.4.amzn1.x86_64
Error: php55-common conflicts with php-common-5.3.29-1.7.amzn1.x86_64
Error: php55-cli conflicts with php-cli-5.3.29-1.7.amzn1.x86_64
Error: httpd24 conflicts with httpd-2.2.29-1.4.amzn1.x86_64
Error: php55 conflicts with php-5.3.29-1.7.amzn1.x86_64
I hope this solution help you. I found my inspiration in: PHP install on clean Amazon Linux AMI
PD: Sorry about my english

Categories