installing php-imap on amazon ec2 linux 2 - amazon-web-services

I need to install php-imap on amazon ec2 linux 2 instance.
All the php stuff is inside amzn2extra-lamp-mariadb10.2-php7.2 but php-imap package is missing.
Any advice ?
Thanks

I installed it like this.
I downloaded the php source code of the currently installed version in my Amazon Linux 2
wget http://php.net/get/php-7.2.8.tar.bz2/from/a/mirror
Unpacked it and went into php-7.2.8/ext/imap/
Compiled extension:
phpize
./configure
I got some errors.
Some U8T_CANONICAL stuff so
sudo yum install libc-client-devel
Then libc-client.a not found so created a symlink for it:
cd /usr/lib
sudo ln -s /usr/lib64/libc-client.a
some other imap library error so:
sudo yum install uw-imap-static
I got some other errors so the working configure line was:
./configure --with-kerberos --with-imap-ssl
make
SUCCESS!
cd php-7.2.8/ext/imap/modules
sudo cp imap.so /usr/lib64/php/modules/
Created an ini file to load it:
sudo vi /etc/php.d/30-imap.ini
added to the file this content:
extension=imap
restarted php service (you might need to restart httpd depending on your php installation):
sudo systemctl restart php-fpm
PHPinfo now contains:
imap
IMAP c-Client Version 2007f
SSL Support enabled
Kerberos Support enabled

For those who are facing the U8T_CANONICAL error and can't being able to install the libc-client-devel on Amazon Linux 2 AMI need to do something extra to resolve the U8T_CANONICAL error.
The main problem is that libc-client-devel isn't available so we need to do it in another way.
I found this link while searching for my problem. The solution that is posted here is solid. The following link that i gave is for those who are not being able to install the libc-client-devel will be benifited from the link.
Or you could just copy paste the commands i'm giving below.
1 - sudo yum groupinstall "Development Tools"
2 - sudo amazon-linux-extras install epel
3 - yum install epel-release
4 - sudo yum install libc-client-devel uw-imap-static openssl-devel
5 - sudo ln -s /usr/lib64/libc-client.a /usr/lib
The rest can be followed from respondent.
Again thanks to the person who answered.

Same problem here.
I came from debian/ubuntu and i miss a lot of php packages on aws linux2.
I know it's still a candidate and not a final LTS release. Only worked for a month with this distro and saw a lot of changes and updates. Some php dependencies can be solved with pear or pecl, but I couldn't get nothing working on php-imap.
php-imap depends on libc-client (maybe that's a problem?)
Here is my solution.
Search for the libc-client rpm that correspond to your version and
install manually.
Search for the rpm that corresponds to your php installed version. In my case it was 7.2.5**-2** about 2 weeks ago. (today is
7.2.5**-3** ) and isntall manually
CODE
wget https://dl.iuscommunity.org/pub/ius/stable/CentOS/7/x86_64//php72u-imap-7.2.5-2.ius.centos7.x86_64.rpm -P /tmp
wget http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/l/libc-client-2007f-16.el7.x86_64.rpm -P /tmp
rpm -i /tmp/libc-client-2007f-16.el7.x86_64.rpm
rpm -i /tmp/php72u-imap-7.2.5-2.ius.centos7.x86_64.rpm
If it fails because Failed dependencies:
rpm -ivh /tmp/php72u-imap-7.2.5-2.ius.centos7.x86_64.rpm --nodeps
I dont like this solution, but can't find for now any other solution more stable and easy. It will be a pain with updates....

Related

How to install PHP 8.1 on Amazon Linux 2 (ARM64)

I'm trying to install php 8.1 on a Graviton 2 (ARM64) EC2 instance thats running Amazon Linux 2.
All of the guides I've followed use remi-release-7.rpm. When I use this repository, yum updates are flooded with 404 errors like
http://rpms.remirepo.net/enterprise/7/safe/aarch64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Is there a relatively easy way to install PHP 8.1 on this type of instance?
You can build it from source. I was able to install it on Amazon Linux 2 on Graviton (aarch64, 5.10 kernel) using the steps below. Be sure to update the url in the wget command to the latest available version or what ever you want to build.
sudo yum -y groupinstall "Development Tools" "Development Libraries"
sudo yum -y install libxml2-devel sqlite-devel
wget https://www.php.net/distributions/php-8.1.5.tar.xz
tar -xf php-8.1.5.tar.xz
cd php-8.1.5/
./configure
make -j$(nproc)
sudo make -j$(nproc) install
Alternatively, you could just use a container. You can get one from Amazon ECR here: https://gallery.ecr.aws/docker/library/php
docker pull public.ecr.aws/docker/library/php:8.1-rc-apache-bullseye
Amazon Linux 2 now has built-in support for PHP 8.1 including ARM!
https://repost.aws/questions/QUsfhDbww4SAy8i5Jmd4vcMg/amazon-linux-2-amazon-linux-extras-php-8-1-support

RHEL: This system is currently not set up to build kernel modules

I am trying to install virtualbox5.2 on a RHEL 7 VM When I try to rebuild kernels modules I get the following error:
[root#myserver~]# /usr/lib/virtualbox/vboxdrv.sh setup
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
kernel-devel kernel-devel-3.10.0-693.11.1.el7.x86_64
I tried install kernet-devel and got success message
Installed:
kernel-devel.x86_64 0:3.10.0-693.21.1.el7
Complete!
But still the setup fails.
Any idea what is missing here?
sudo yum install -y "kernel-devel-$(uname -r)"
Substitute dnf on Fedora. I didn't need to do a reboot, but ymmv.
Edit for 2020:
Centos/RHEL 8 now also use dnf instead of yum. I haven't had occasion to test this on those distros, so the same YMMV disclaimer still applies.
First run in terminal: uname -r then you will get name and information about current kernel (CURRENT_KERNEL).
Now you can install with command: yum install kernel-devel-CURRENT_KERNEL
Note: replace CURRENT_KERNEL with string you get from uname -r.
The same message happened when I tried to upgrade VirtualBox 5.2.12 Guest Additions on my Kali Linux (GNU/Linux Rolling version). I fixed it by following steps:
Do apt update/upgrade to keep your system up-to-date. Do not forget to reboot the system.
Run "apt-get install linux-headers-$(uname -r)".
Run VBoxLinuxAdditions.run from terminal, error message gone and Guest Additions will be installed successfully.
Reboot system, Guest Additions works fine.
I got here looking for the same answer for CentOS 6, and the above answers worked with slight modification (so, for anyone else that lands here too)...
yum install -y kernel-devel kernel-devel-$(uname -r)
So, "yum" instead of "apt-get"
Also, some Linux use "linux-headers" instead of "kernel-devel" but the principle seems to be the same.
The kernel your were using was kernel-devel-3.10.0-693.11.1.el7.x86_64 is slightly different with the one that you installed kernel-devel.x86_64 0:3.10.0-693.21.1.el7 . In my case, there are several different version installed on my OS, and "sudo yum install kernel-devel" always install the newest one for me. Then I work it out by setting my default kernel version as same as yum installed for me. You can check the kernel you have installed on your OS by following command:
sudo awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
Then just set the kernel version you choose to use as same as yum choose for you,by following command:(notice that the number at last is pick up from preceding command result),
sudo grub2-set-default 0
generate the grub2 config with 'gurb2-mkconfig' command, and then reboot the server.
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
sudo reboot
Milan Rakos is right. Your installed kernel-devel must have suffix string exactly the same as the uname -r output. Besides, the logs during the vboxdrv.sh setup also shows the wanted version of the kernel-devel.
So to your case, You will run the command:sudo yum install kernel-devel-3.10.0-693.11.1.el7.x86_64
to solve this problem I ran yum update -y. I think this is the fastest way to solve it. Another solution is to configure the repos with the installation DVD, so you can install the kernel-headers of your current version of CentOS.
My History:
yum install epel-release
yum install perl gcc dkms kernel-devel kernel-headers make bzip2
yum groupinstall "Development tools"
yum update -y
reboot
After that, I mount de VBoxGuestAdditions and I ran the process
yum install kernel-devel-3.10.0-693.11.1.el7.x86_64 fixed the issue.
A little late to the party but I just ran into this problem myself and here's what I did to resolve the issue.
yum update -y
yum install -y redhat-lsb-core net-tools kernel-headers kernel-devel epel-release
yum groupinstall -y "Development Tools"
reboot
Ensure your system has been fully updated when you ran yum update -y before continuing!
Cheers

need help to install php 7.2 yum packages on aws ec2

I haven't seen any yum packages for php 7.2 on AWS EC2 and the release has been out over a month.
I have tried yum list | grep php7 and only able see php70 and php71 packages.
Has anyone installed php72 on AWS EC2?
Is there another yum repo to connect to?
Does AWS have a delivery scheduled?
Although the #amzn-main repo doesn't have PHP 7.2 yet (as far as I know), you can use remi-php72. According to his release blog you can install the EPEL and Remi repositories via:
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
wget http://rpms.remirepo.net/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6.rpm
rpm -Uvh epel-release-latest-6.noarch.rpm
And then enable remi-php72 using yum-config-manager:
yum install yum-utils
yum-config-manager --enable remi-php72
After that, you can simply search and install php and all the needed extensions like normal:
sudo yum install --disablerepo="*" --enablerepo="remi,remi-php72" php php-fpm php-cli ...
As #Typel says in a comment on the other answer - if you're using Amazon Linux 2 AMI then
sudo amazon-linux-extras install -y php7.2
Beats installing multiple external repos and has most of th basics, including mariadb and vim (everything I need to feel happy!).
See the list: sudo amazon-linux-extras list

php56-common conflicts with php-common-5.3.29-1.8.amzn1.x86_64 when installing phpmyadmin

I have successfully installed php70 and mysql. But when i am trying to install phpmyadmin by
$ sudo yum-config-manager --enable epel
And Then
$ sudo yum install -y phpMyAdmin
It gives me
--> Finished Dependency Resolution
Error: php70-common conflicts with php-common-5.3.29-1.8.amzn1.x86_64
Error: php56-common conflicts with php-common-5.3.29-1.8.amzn1.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
Also after google sometimes i found a solution that try this
sudo yum install php70-mbstring
And i have tried this also, Still facing same error.
Any suggestion...?
I guess that you are following the Amazon tutorial to install phpMyAdmin ?
I had the same problem today and resolved it by uninstall PHP 7.0 with the yum command (the same given by Amazon with 'remove' instead of 'install' :
sudo yum remove httpd24 php70 mysql56-server php70-mysqlnd
and installed PHP 5.6 instead :
sudo yum install httpd24 php56 mysql56-server php56-mysqlnd
I don't know if this is a good solution, but it worked and I could install phpMyAdmin without dependencies problem. I hope it will help :)
In case you want to keep php7, I found a solution with AWS Amazon experts.
Just use :
sudo yum install -y php70-mbstring
I was having the same issue today. I had some success downloading phpmyadmin from phpmyadmin.net, and following their instructions. I did run into a different problem during the setup of phpmyadmin....
So, I punted on resolving this with the Amazon AMI for now, and chose to install the Bitnami LAMP AMI to get me going quicker. It comes with phpmyadmin configured.
NOTE: Bitnami's AMI is running PHP Version 5.6.29, so I would say it's valid to follow the previous post's advice and downgrade, unless your web application specifically needs PHP 7.0.

not able to install contextBroker via yum on CentOs7

HI everybody i am using CentOs7 and havae some troubles with the installation of the contextBroker. I followed the installation on the added the Fiware Repo in my yum repo.
Here is a list of my yum repo:
repo id repo name status
base/7/x86_64 CentOS-7 - Base 9,007
epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 10,368
extras/7/x86_64 CentOS-7 - Extras 356
fiware Fiware Repository 176
mongodb MongoDB repo 279
updates/7/x86_64 CentOS-7 - Updates 2,070
repolist: 22,256
I am always getting an error message that there are some failed dependencies
libboost_filesystem-mt.so.5()(64bit) is needed by contextBroker-0.15.0-1.x86_64
libboost_system-mt.so.5()(64bit) is needed by contextBroker-0.15.0-1.x86_64
libboost_thread-mt.so.5()(64bit) is needed by contextBroker-0.15.0-1.x86_64
Here is the output of my config file for the fiware.repo
[fiware]
name=Fiware Repository
#baseurl=http://repositories.lab.fiware.org/repo/rpm/$releasever
baseurl=http://repositories.lab.fiware.org/repo/rpm/x86_64/
gpgcheck=0
enabled=1
I found a possible solution under this link, but unfortunately this is not working. In the comment section there is an entry which says that there is a problem with CentOs7 but that doesn`t solve my problem
Btw: this is also not working Boost-Libboost is needed in Centos7 (ContexBroker)
So my question is, did someone installed the contextBroker on CentOs7 via yum and if he/she did how can i solve this problem ?
As you mention, there isn't official support for CentOS 7 at the present moment. However, you could do the following to get a running binary with contextBroker in your CentOS 7 system (actually, this a "quick and dirty" receipt based on the build from sources procedure documented in the Orion manual):
sudo yum install git wget
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo rpm -i epel-release-latest-7.noarch.rpm
sudo yum install make cmake gcc-c++ scons
sudo yum install boost-devel libcurl-devel gnutls-devel libgcrypt-devel libuuid-devel
# Install mongoDB driver as described in the documentation
# Install rapidjson as described in the documentation
# Install libmicrohttpd as described in the documentation
mkdir ~/src
cd ~/src
git clone https://github.com/telefonicaid/fiware-orion.git
cd fiware-orion
# optionally, you can set an specific version with a checkout command
# e.g. 'git checkout 1.2.1'. Otherwise, you will build the latest
# code from develop branch
make
BUILD_RELEASE/src/app/contextBroker/contextBroker --version
Moreover, you can use the following to generate a RPM file:
sudo yum install rpm-build
make rpm
# The RPM is generated in rpm/RPMS/x86_64/contextBroker-1.2.0_next-dev.x86_64.rpm
# (version number may vary)
That RPM file is supposed to work in other CentOS 7 systems and you can install just using sudo yum install /path/to/contextBroker-1.2.0_next-dev.x86_64.rpm.