How to Install mcrypt PHP module - php

I am using Linux Mint 19.1. My PHP configuration is like below
I am getting below error while I am trying to install mcrypt.

Try out using these commands
To install the dependencies :
sudo apt-get -y install gcc make autoconf libc-dev pkg-config
sudo apt-get -y install php7.2-dev
sudo apt-get -y install libmcrypt-dev
Once the dependencies have been installed, you can install mcrypt with the command:
sudo pecl install mcrypt-1.0.1

Related

PHP Docker install php7-mysql

For a while now, I'm trying to install the php7-mysql driver into different PHP docker containers from php/docker with no luck.
My Dockerfile looks like this:
# Dockerfile
FROM php:7.3-rc-apache-stretch
RUN apt-get update && apt-get upgrade -y
When I attach to the container and try to run
apt-get install php7.0-mysql
Debian stretch says that it has no installation candidate.
E: Package 'php7.0-mysql' has no installation candidate
What can I do to be able to install php7.0 modules to Debian Stretch?
Thanks in advance, this really took me some pomodores now!
It appears you are missing the repository for php7.
Adding the php7 ppa:
sudo add-apt-repository ppa:ondrej/php
Then update:
sudo apt-get update
Now do a search to confirm php7 is there:
sudo apt search php7
Now install the php7 package:
sudo apt install php7.0-mysql
Did not work with ppa:ondrej/php but this works:
sudo apt-get update
sudo apt-get install apt-transport-https lsb-release ca-certificates
sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
sudo sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
sudo apt-get update
sudo apt-get install php7.0-mysql
You can also install php7.0 from there

How to install php-curl in Ubuntu 16.04

Upgraded to Ubuntu 16.04 and facing problem after installing PHP5.
Installed PHP-5 with following:
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install php5.5 # for PHP 5.5
Trying to install php-curl but its not working.
sudo apt-get install php5-curl
Error: E: Unable to locate package php5-curl
In Ubuntu 16.04 default PHP version is 7.0, if you want to use different version then you need to install PHP package according to PHP version:
PHP 7.4: sudo apt-get install php7.4-curl
PHP 7.3: sudo apt-get install php7.3-curl
PHP 7.2: sudo apt-get install php7.2-curl
PHP 7.1: sudo apt-get install php7.1-curl
PHP 7.0: sudo apt-get install php7.0-curl
PHP 5.6: sudo apt-get install php5.6-curl
PHP 5.5: sudo apt-get install php5.5-curl
This worked for me.
sudo apt-get install php-curl
This works for me:
sudo apt-get install php5.6-curl
Do:
apt-get update
And then:
apt-get install php5-curl
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt install php8.0-curl
To Install cURL 7.49.0 on Ubuntu 16.04 and Derivatives
wget http://curl.haxx.se/download/curl-7.49.0.tar.gz
tar -xvf curl-7.49.0.tar.gz
cd curl-7.49.0/
./configure
make
sudo make install
For Ubuntu 18.04 or PHP 7.2 users you can do:
apt-get install php7.2-curl
You can check your PHP version by running php -v to verify your PHP version and get the right curl version.
sudo apt-get install php5.6-curl
and restart the web browser.
You can check the modules by running php -m | grep curl

phpbrew Bash init failure

I am at the initial stages of preparing for multiphp nginx following a complete install of Ubuntu and the git page
http://phpbrew.github.io/phpbrew/
I have duplicated steps followed here for clarity and re-installed Ubuntu and followed exactly what is below in case my error correction attempts were causing issues
https://docs.google.com/spreadsheets/d/1KbfqW5PqFejlCMV9yEUHgEr5FdCh5P6Ufv-HRQH3u9g/edit?usp=sharing
but fails with /usr/bin/env: php: No such file or directory.
Please check out our wiki and install the requirements
https://github.com/phpbrew/phpbrew/wiki/Requirement
apt-get build-dep php5
apt-get install -y php5 php5-dev php-pear autoconf automake curl libcurl3-openssl-dev build-essential libxslt1-dev re2c libxml2 libxml2-dev php5-cli bison libbz2-dev libreadline-dev
apt-get install -y libfreetype6 libfreetype6-dev libpng12-0 libpng12-dev libjpeg-dev libjpeg8-dev libjpeg8 libgd-dev libgd3 libxpm4 libltdl7 libltdl-dev
apt-get install -y libssl-dev openssl
apt-get install -y gettext libgettextpo-dev libgettextpo0
apt-get install -y libicu-dev
apt-get install -y libmhash-dev libmhash2
apt-get install -y libmcrypt-dev libmcrypt4
I did not post this without much effort trying to resolve first - about a day and many visited links.
Anyway the issue lay with thinking php was installed with Ubuntu +/ updates.
Note that phpbrew has php as one of its dependencies.
I guess a fresh OS install went against me on this occasion.
sudo apt-get install php5

install php70-gd on ubuntu

Recently the new php7 has been released. However, when I am trying to install the gd package, the library can not be found.
I have tried through
sudo apt-get install php70-gd
and
sudo apt-get install php70-php-gd
Does anybody have an idea if gd is available for php 7?
PHP7 packages for Ubuntu including php7.0-gd can be installed via PPA for PHP by Ondřej Surý:
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
Next, install the desired version:
sudo apt-get install php7.0-gd
# or
sudo apt-get install php7.1-gd
# or
sudo apt-get install php7.2-gd
# or
sudo apt-get install php7.3-gd
# or
sudo apt-get install php7.4-gd
EDIT:
As MacroMan stated, under Ubuntu 16.04 you don't need to add the repository any more. Simply issuing sudo apt-get install php7.0-gd works.
just try
sudo apt-get install php7.0-gd
i got it working that way.
Greetings.
In 2018, there is an alias package for this:
sudo apt-get install php-gd
Use this to retrieve the last version.
my php version is 7.1
sudo apt-get install php7.1-gd
this command is work for me
For
Ubuntu 16.04.4 LTS
this is the command:
sudo apt-get install php7.0-gd
check php verison first using
php -v
It will give version number suppose your version is 7.0.1 then use this command to install GD Library
sudo yum install php70-gd
OR use this command depending upon server specification
sudo apt-get install php7.0-gd

Installing pecl on debian

I'm trying to instal pecl_http on my server according to manual manual is for ubuntu, but apt-cache search pecl_http returned php5-pecl-http as pecl http packadge:
sudo apt-get update
sudo apt-get install php-pear php5-dev
sudo apt-get install php5-pecl-http
sudo apt-get install libcurl3-openssl-dev
in the end of php.ini added extension=http.so.
http_get() and func that I need http_parse_headers() says that func is undefined. What's the problem?
It's probably too late but for others a solution is explained here : http://www.mkfoster.com/2009/01/04/how-to-install-a-php-pecl-extensionmodule-on-ubuntu/
sudo apt-get update
sudo apt-get install php-pear php5-dev
sudo apt-get install libcurl3-openssl-dev
Then,
sudo pecl install pecl_http

Categories