I am new to use ubuntu, to install imagemagick I have run below command
sudo apt-get update
but it showing error
I have executed below commands as well but not able to install
sudo -i
cd
apt-get install build-essential checkinstall && apt-get build-dep imagemagick -y
wget http://www.imagemagick.org/download/ImageMagick-6.8.7-7.tar.gz
tar xzvf ImageMagick-6.8.9-1.tar.gz
cd ImageMagick-6.8.9-1/
./configure --prefix=/opt/imagemagick-6.8 && make
checkinstall
https://gist.github.com/rodleviton/74e22e952bd6e7e5bee1
Google has dropped the support for 32-bit version for chrome on Linux and that is the reason you are seeing that error.
Edit /etc/apt/sources.list.d/google-chrome.list - You would need sudo
Replace the existing line with deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
Run sudo apt-get update now.
And what is the error you are seeing when you are trying to install imagemagick?
Related
I'm having trouble with installing old php 5.3.29 on ubuntu 16.04
Recently I found this useful source on how to install old unsupported php versions which are available only in php museum
sudo apt-get install apache2
sudo apt-get install make
# php museum version installation
sudo apt-get update
sudo apt-get install gcc libmysqlclient-dev libxml2-dev
wget --trust-server-names http://museum.php.net/php5/php-5.3.29.tar.bz2
tar xjf php-5.3.29.tar.bz2
cd php-5.3.29
./configure --prefix=$PWD/installdir --enable-bcmath --with-mysql
sudo make install
Now I need to connect apache2 and php 5.3.29 but how ?? (how to configure Apache to use php from custom directory)
All the articles I found talk about how to switch php version use update-alternatives --config php. That command ignores my php5.3 installed in the custom folder by make command.
I even tried to symlink php executable file to /usr/bin
ln -s /home/ubuntu/php-5.3.29/installdir/bin/php /usr/bin/php5.3.29
and again no luck with update-alternatives command run
Hmm found another way (adding ppa repo) solution for this issue here:
https://everton.rocks/conteudo/multiple-php-versions-apache
# add this 2 lines to /etc/apt/sources.list
deb http://ppa.launchpad.net/sergey-dryabzhinsky/php53/ubuntu xenial main
deb-src http://ppa.launchpad.net/sergey-dryabzhinsky/php53/ubuntu xenial main
sudo apt update
sudo apt install php53-apache2
sudo a2dismod php7.0
sudo a2enmod php53
sudo service apache2 restart
I have a problem during Propel ORM configuration.
I prepared environment on my Vagrant with PHP 7.1 following this provision file:
# Install software
add-apt-repository ppa:ondrej/php
apt update
apt install python-software-properties
apt update
apt install -y apache2
apt install -y php
apt install -y php-mcrypt
apt install -y php-mysql
apt install -y php-curl
apt install -y php-cli
apt install -y php-xml
apt install -y libapache2-mod-php
apt install -y mc
# install composer, configure Apache and create database
service apache2 restart
/etc/init.d/mysql restart
Currently I want to install Propel ORM. I added Propel to composer, installed, and now I type (by SSH in Vagrant)
/var/www/application/Vendors/bin/propel init but unfortunately I get error:
/usr/bin/env: �php\r’: No such file or directory
What can I do to resolve it?
EDIT:
File that I run (not edited, installed via Composer):
#!/usr/bin/env sh
dir=$(d=${0%[/\\]*}; cd "$d"; cd "../propel/propel/bin" && pwd)
# See if we are running in Cygwin by checking for cygpath program
if command -v 'cygpath' >/dev/null 2>&1; then
# Cygwin paths start with /cygdrive/ which will break windows PHP,
# so we need to translate the dir path to windows format. However
# we could be using cygwin PHP which does not require this, so we
# test if the path to PHP starts with /cygdrive/ rather than /usr/bin
if [[ $(which php) == /cygdrive/* ]]; then
dir=$(cygpath -m "$dir");
fi
fi
dir=$(echo $dir | sed 's/ /\ /g')
"${dir}/propel" "$#"
I don't use propel but had the same problem with phpunit.
The problem is often that the vendor/propel/propel/bin/propel, or in my case the vendor/phpunit/phpunit/phpunit file you try to execute is Windows encoded and not Unix encoded. It happens when you do composer install/update on Windows but run your code in a vagrant box.
You have multiple ways of getting rid of the CRLF:
dos2unix command (sudo apt-get install dos2unix)
use your prefered text editor (Sublime, PHPStorm, they can both do that)
get rid of vendor and run composer install/update from your vagrant box
Remember that the problem is not the vendor/bin/propel file but the vendor/propel/propel/bin/propel file.
Hope this help!
Since Laravel4 requires mcrypt extension, and PHP7 doesn't seem to have mcrypt extension, is there any workaround for this to work?
Had the same issue - PHP7 missing mcrypt.
This worked for me. When asked, keep local PHP configuration files.
sudo apt-get update
sudo apt-get install mcrypt php7.0-mcrypt
sudo apt-get upgrade
Restart FPM (or Apache or NGINX etc.) after installation.
I'm on Mac and with laravel valet I've solved with this:
brew install php70-mcrypt
Even if you enable mcrypt in php.ini, this issue may occur.
Try the following steps.
sudo apt-get update
sudo apt-get install mcrypt php7.0-mcrypt
I am working in ubuntu 16.04 and the following commands also helped me.
whereis php -shows the files with this name
php -v -shows the php version
which php -shows current php version that is running on the server
On ubuntu: According to launchpad.net the package for mcrypt is called php7.0-mcrypt.
sudo apt-get install php7.0-mcrypt to install
Open terminal with Ctrl + Alt + T and run following commands for PHP7.0 on Ubuntu 16.4
sudo apt-get install mcrypt php7.0-mcrypt
sudo service apache2 restart
php7 have mcrypt, you can enable it in php.ini and then everything will work fine.
do like this:
wget http://jp2.php.net/distributions/php-7.0.3.tar.gz
tar zxf php-7.0.3.tar.gz
cd php-7.0.3/ext/mcrypt
/php7-path/bin/phpize (when error such as configure: error: mcrypt.h not found. Please reinstall libmcrypt run apt-get install libmcrypt-dev)
./configure --with-php-config=/php7-path/bin/php-config
(sudo) make && make install .this will install the mcrypt.so in php-7.0.3/ext/mcrypt/modules
cp to the /usr/lib/php/20151012/ what is the shared extensions dir
create a mcrypt.ini in /etc/php/mods-available/ write as extension=mcrypt.so
create link to this such as sudo ln -s /etc/php/mods-available/mcrypt.ini 20-mcrypt.ini in /etc/php/7.0/fpm/conf.d
create link to this such as sudo ln -s /etc/php/mods-available/mcrypt.ini 20-mcrypt.ini in /etc/php/7.0/cli/conf.d
sudo service nginx restart
sudo service php7.0-fpm restart
yes it is.
I use, Dotdeb, an extra repository providing up-to-date all kinds of cool toys for your Debian servers like Nginx, PHP, MySQL, Redis etc.
Update your sources.list
deb http://packages.dotdeb.org {distribution} all
deb-src http://packages.dotdeb.org {distribution} all
GnuPG keys
wget https://www.dotdeb.org/dotdeb.gpg
sudo apt-key add dotdeb.gpg
Update apt & build something amazing.
sudo apt-get update
PHP7 contains mcrypt extension internally (source-path/ext/mcrypt/).
But it depends on Libmcrypt soft.
Step 1.
Download libmcrypt-x.x.tar.gz from http://mcrypt.sourceforge.net/
and build it.
cd libmcrypt-x.x
./configure
make
make install
Step 2.
Rebuild PHP7 from source and add --with-mcrypt option.
./configure ... --with-mcrypt
Other way without rebuilding PHP7
cd php7-source-path/ext/mcrypt/
/php7-path/bin/phpize
./configure --with-php-config=/php7-path/bin/php-config
make && make install
echo "extension=mcrypt.so" >> /php7-path/ext/php.ini
Restart php
When I try to install php 5.3 stable from source on Ubuntu (downloading compressed installation file from http://www.php.net/downloads.php) and I run ./configure I get this error:
configure: error: xml2-config not found. Please check your libxml2 installation.
All you need to do instal install package libxml2-dev for example:
sudo apt-get install libxml2-dev
On CentOS/RHEL:
sudo yum install libxml2-devel
For the latest versions it is needed to install libxml++2.6-dev like that:
apt-get install libxml++2.6-dev
I had the same issue when I used a DockerFile.
My Docker is based on the php:5.5-apache image.
I got that error when executing the command RUN docker-php-ext-install soap
I have solved it by adding the following command to my Dockerfile:
RUN apt-get update && apt-get install -y libxml2-dev
Ubuntu, Debian:
sudo apt install libxml2-dev
Centos:
sudo yum install libxml2-devel
this solution it gonna be ok on Redhat 8.0
sudo yum install libxml2-devel
OpenSuse
"sudo zypper install libxml2-devel"
It will install any other dependencies or required packages/libraries
I'm attempting to install the PHP Zip extension.
My server does not have external internet access, so I downloaded it myself from PECL: http://pecl.php.net/package/zip. I chose 1.10.2, the latest "stable" release, and transferred it to my server.
I ran:
pear install zip-1.10.2.tgz
and added
extension=zip.so
to php.ini as instructed. I can see that zip.so was created and placed in the right extension_dir folder as well. I restarted apache and then checked to see if it was loaded by running:
php -m
Despite all of this, "zip" is still not in that list.
Am I missing a step or doing something wrong? I thought this should be really simple, and I'm starting to feel pretty dumb, haha.
Other probably important stuff:
CentOS
Apache 2.2.3
PHP 5.2.16
This is how I installed it on my machine (ubuntu):
php 7:
sudo apt-get install php7.0-zip
php 5:
sudo apt-get install php5-zip
Edit:Make sure to restart your server afterwards.
sudo /etc/init.d/apache2 restart or sudo service nginx restart
PS: If you are using centOS, please check above cweiske's answer
But if you are using a Debian derivated OS, this solution should help you installing php zip extension.
You may have several php.ini files, one for CLI and one for apache. Run php --ini to see where the CLI ini location is.
Simply use sudo yum install php-zip
for PHP 7.3 / Ubuntu
sudo apt install php7.3-zip
for PHP 7.4
sudo apt install php7.4-zip
1 Step - Install a required extension
sudo apt-get install libz-dev libzip-dev -y
2 Step - Install the PHP extension
pecl install zlib zip
3 Step - Restart your Apache
sudo /etc/init.d/apache2 restart
If does not work you can check if the zip.ini is called in your phpinfo, to check if the zip.so was included.
For php 7.3 on ubuntu 16.04
sudo apt-get install php7.3-zip
The best way to install the Zip extension in php7.2 on CentOS would be as below:
Find the available extention by searching with yum command
yum search zip
This will list all the zip packages. We need to look for the php7.2 zip package
Then if your php version is 7.2 then run the command
yum install ea-php72-php-zip
This will definetly resolve your issue.
Cheers !!
On Amazon Linux 2 and PHP 7.4 I finally got PHP-ZIP to install and I hope it helps someone else - by the following (note the yum install command has extra common modules also included you may not need them all):
sudo yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo yum -y install yum-utils
sudo yum-config-manager --enable remi-php74
sudo yum update
sudo yum install php php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mcrypt php-mbstring php-curl php-xml php-pear php-bcmath php-json
sudo pecl install zip
php --modules
sudo systemctl restart httpd
If you use php5.6 then execute this:
sudo apt-get install php5.6-zip
The PHP5 version do not support in Ubuntu 18.04+ versions, so you have to do that configure manually from the source files. If you are using php-5.3.29,
# cd /usr/local/src/php-5.3.29
# ./configure --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=MySQL_LOCATION/mysql --prefix=/usr/local/apache/php --with-config-file-path=/usr/local/apache/php --disable-cgi --with-zlib --with-gettext --with-gdbm --with-curl --enable-zip --with-xml --with-json --enable-shmop
# make
# make install
Restart the Apache server and check phpinfo function on the browser <?php echo phpinfo(); ?>
Note: Please change the MySQL_Location: --with-mysql=MySQL_LOCATION/mysql
I tried changing the repository list with:
http://security.ubuntu.com/ubuntu bionic-security main universe http://archive.ubuntu.com/ubuntu bionic main restricted universe
But none of them seem to work, but I finally found a repository that works running the following command
add-apt-repository ppa:ondrej/php
And then updating and installing normally the package using apt-get
As you can see it's installed at last.
I was trying to install it on CentOS 7 for php 7.1. In my case yum package php-zip was unavailable in remi repo, but I could install it using different name
yum install php-pecl-zip
So if you can't find it by query php-zip, try searching for php-pecl-zip.
For those who need to install the zip extension in a Docker image being built.
Dockerfile:
FROM php:8.1-apache
RUN apt-get update \
&& apt-get install -y libzip-dev \
&& docker-php-ext-install zip