How to install php5-gd in Wheezy Debian php 5.6 - php

2 of my sites are not working bcs I can't install php5-gd library to Debian Wheezy php5.6 ...
I tried
aptitude install php5-gd, and system said i miss 2 dependencies, which i can not find or install...
aptitude install php5-gd
sudo apt-get install php5-gd
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
php5-gd :
Depends: libt1-5 (>= 5.1.0) but it is not installable
Depends: libvpx1 (>= 1.0.0) but it is not installable
E: Unable to correct problems, you have held broken packages.

Have you updated your apt-get first?
First, run:
sudo apt-get update
Then if that is successful run;
sudo apt-get upgrade
if you run
df -lah
first, it may show your /boot is at 100%
Try;
sudo apt-get autoremove
then start from the start, and then try your php5-gd
When that fails
Try :
sudo apt-get install -f

Wheezy is really out of date. It was released in 2013 and its support ended in 2018.
Here's a table imported from the Debian Long Term Support page:
Your best bet is to upgrade to buster (Debian 10, released July 2019 and (probably) supported through 2024.
Another option is to upgrade to jessie (released April 2015, security support ended 2018, community support ends June 2020), which would buy you a few months to replace your system with a newer one.
The final option, if you really need to stay on Wheezy, is to use backports or a carefully-pinned newer release for just the packages in question.
Since Wheezy is so old, there aren't any repositories still being hosted (there's probably an archive of it somewhere, but you won't get updates). I'll walk you through upgrading to Jessie and using its backports instead.
These instructions should work for any release, so you could (should!) use buster in place of jessie, though upgrading across so many releases will almost certainly require quite a bit of work.
1. Update your sources:
$ find /etc/apt/sources.list* -name '*.list' |sudo xargs sed -i 's/wheezy/jessie/g'
2. Add Jessie backports to one of those files if it doesn't yet exist:
deb http://deb.debian.org/debian jessie-backports main
3. Update and upgrade, ideally from outside X11 (e.g. the console at Ctrl+Alt+F2):
$ sudo apt-get clean
$ sudo apt-get update
$ sudo apt-get dist-upgrade
$ sudo apt-get autoremove
$ sudo reboot
After that, you can then try to troubleshoot your system.

You should build it manually
From:
https://www.howtoforge.com/building-php-5.4-from-source-on-debian-squeeze

Related

How to install php module intl on ubunut 22.04 with two php versions active - php 8.1 and php 8.2

My worpdress website site health page dispalyas apossible improvement - php module intl missing.
My server has multiple versions of php (8.1 &8.2) active.
I use the following ssh command to install the missing intl module-
apt-get install -y php-intl
But get tis error message.
The following packages have unmet dependencies:
php8.1-intl : Depends: php8.1-common (= 8.1.2-1ubuntu2.10) but 8.1.14-1+ubuntu18.04.1+deb.sury.org+1 is to be installed
E: Unable to correct problems, you have held broken packages.
the php modules which are active om my server , like imagick, are installed for php8.1. but my active php version is 8.2.
The problem is with the dependencies of the "php8.1-intl" package. Specifically, it requires version 8.1.2-1ubuntu2.10 of the "php8.1-common" package, but the version that is currently available is 8.1.14-1+ubuntu18.04.1+deb.sury.org+1, which is causing a conflict.
try:
sudo apt update
sudo apt-get check
sudo apt-get install -f
sudo dpkg --configure -a
5.sudo apt-get install php8.1-common=8.1.2-1ubuntu2.10
6.sudo apt-get install php8.1-intl
You may need to remove the conflicting package(s) and installing the required packages again. But be careful when removing packages as it may cause other dependencies to break.

Cannot install php5-curl on Debian8

When trying to execute 'apt-get install php5-curl" following error accurs
The following packages have unmet dependencies:
php5-curl : Depends: php5-common (= 5.6.33+dfsg-0+deb8u1) but 5.6.40+dfsg-0+deb8u8 is to be installed
Any Idea how to fix this?
PHP 5 has been officially unsupported for over a year by now - I think you're going to struggle to resolve dependencies. Even Jessie (the only version still shipping PHP 5 by default, which you seem to be using) becomes unsupported within a few months of now.
Your best long-term plan is to plan your code's upgrade to compatibility with PHP 7.4
Because the security repository is missing / disabled on your `sources.list.
php5-curl is available on the security repository.
You should add the following line to your /etc/apt/sources.list :
deb http://security.debian.org/debian-security jessie/updates main
Then :
sudo apt update
sudo apt upgrade
sudo apt install php5-curl

`phpize' failed, while installing Imagick [duplicate]

I have been meaning to install ffmpeg as an extension to my PHP setup. So before I can install it, I need to phpize it. I installed php5-dev by sudo apt-get install php5-dev. But now when I run phpize I get the following error :
phpize
Cannot find config.m4.
Make sure that you run '/usr/bin/phpize' in the top level source directory of the module
The location of my php.ini is /usr/local/zend/etc/php.ini
From another online resource I tried this
sudo apt-get install autoconf automake libtool m4
But all of them are already installed.
Locate config.m4 didn't return anything.
Any pointers here how I can get phpize and thus, ffmpeg up and running?
For recent versions of Debian/Ubuntu (Debian 9+ or Ubuntu 16.04+) install the php-dev dependency package, which will automatically install the correct version of php{x}-dev for your distribution:
sudo apt install php-dev
Older versions of Debian/Ubuntu:
For PHP 5, it's in the php5-dev package.
sudo apt-get install php5-dev
For PHP 7.x (from rahilwazir comment):
sudo apt-get install php7.x-dev
RHEL/CentOS/yum
yum install php-devel # see comments
For PHP7 Users
7.1
sudo apt install php7.1-dev
7.2
sudo apt install php7.2-dev
7.3
sudo apt install php7.3-dev
7.4
sudo apt install php7.4-dev
If not sure about your PHP version, simply run command php -v
Ohk.. I got it running by typing /usr/bin/phpize instead of only phpize.
Under Redhat Enterprise / CentOS, use yum to install the php-devel module:
yum install php-devel
For PHP 7, you need:
yum install php70-php-devel
Step - 1: If you are unsure about the php version installed,
then first run the following command in terminal
php -v
Output: the above command will output the php version installed on your machine, mine is 7.2
PHP 7.2.3-1ubuntu1 (cli) (built: Mar 14 2018 22:03:58) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.3-1ubuntu1, Copyright (c) 1999-2018, by Zend Technologies
Step 2: Then to install phpize run the following command, Since my php version is 7.2.3. i will replace it with 7.2, so the command will be,
sudo apt-get install php7.2-dev
Step 3: Done!
Alternate method(Optional):
To automatically install the phpize version based on the php version installed on your machine run the following command.
sudo apt-get install php-dev
This command will automatically detect the appropriate version of php installed and will install the matching phpize for the same.
Hmm... actually i dont know how this solved it? But the following steps solved it for me:
find / -name 'config.m4'
Now look if the config.m4 is anywhere in a folder of that stuff you want to phpize. Go to that folder and run phpize directly in there.
For ubuntu 14.04LTS with php 7, issue:
sudo apt-get install php-dev
Then install:
pecl install memcache
In Ubuntu 16.04, you can install phpize with the command
aptitude install php7.1-dev // for php 7.1
which is equivalent to
apt-get install php7.1-dev // for php 7.1
If you're having problems with phpize not found on CentOS7.x after you have installed the relevant devel tools for your version/s of PHP, this path finally worked for me:
For PHP 7.2.x
/opt/cpanel/ea-php72/root/usr/bin/phpize
For PHP 7.3.x
/opt/cpanel/ea-php73/root/usr/bin/phpize
For PHP 7.4.x
/opt/cpanel/ea-php74/root/usr/bin/phpize
Run this in your folder containing the downloaded PHP extension, for example in line 3 below:
Example based on installing the PHP v7.3.x Brotli Extension from https://github.com/kjdev/php-ext-brotli
git clone --recursive --depth=1 https://github.com/kjdev/php-ext-brotli.git
cd /php-ext-brotli
/opt/cpanel/ea-php73/root/usr/bin/phpize
./configure --with-php-config=/opt/cpanel/ea-php73/root/usr/bin/php-config
make
make test
Install from linux terminal
sudo apt-get install <php_version>-dev
Example :
sudo apt-get install php5-dev #For `php` version 5
sudo apt-get install php7.0-dev #For `php` version 7.0
Of course in PHP7.2
sudo apt-get install php7.2-dev
This might help someone on ubuntu. No promises.
sudo apt-get install libcurl3 php5-dev libcurl4-gnutls-dev libmagic-dev
sudo apt-get install php-http make
sudo pecl install pecl_http
And adding "extension=http.so" to php.ini (Normally located at /etc/php5/apache2/php.ini)
Then restart Apache (sudo service apache2 restart).
If in doubt, check your apache logs:
sudo su --
cd /var/log/apache2
tail -25 error.log
Is http.so starting or failing?
For instance, if you wanted to use the "phpize" command for PHP 5.6, you would use the full path:
Code:
/opt/cpanel/ea-php56/root/usr/bin/phpize
For ubuntu with Plesk installed run apt-get install plesk-php56-dev, for other versions just change XX in phpXX (without the dot)
Go to the downloaded folder and there you find config.m4. Open the terminal and run phpsize.
I had this exact problem on macOS in 2018.
For me, first running brew install php before sudo pecl install mongodb did the trick.
You didn't specify what operating system you're using, and 90% of the answers assume Ubuntu/Debian Linux because of the apt-get install autoconf automake libtool m4 command that you posted (and over half expect you to be running CPanel), so I'm giving you a slightly more generic solution which ought to work on any Un*x clone (including Microsoft's WSL!).
You will need at least a few prerequisites:
A working C/C++ compiler — GCC or clang being the most popular options these days.
A 'developer edition' of PHP, which some package managers call 'development headers'. In the case of aptitude, as shown on the other answers, you ought to be fine with just sudo apt install php-dev. Beware of the mentioned caveats: you might end up with a slightly more unstable version of PHP which might not be updated correctly with future versions.
These days (that's late 2021 for me!), for those running Ubuntu, and wishing to seriously tinker with PHP, the recommendation is to use Ondřej Surý's personal package archive for PHP. Ondřej keeps his PPA always up to date, sometimes within a few hours after release; he keeps up with the latest four Ubuntu distributions and all the currently supported PHP versions that haven't reached end-of-life status yet (sorry, PHP5 is considered completely obsolete and plagued with unpatched bugs and security issues, so it's not supported — for very good reasons!); and he provides a lot of PHP extensions, too. Sadly, ffmpeg-php is not one of them...
There is a good reason for the overall lack of support of ffmpeg-php. Allegedly, the original repository for that was hosted at Sourceforge but has been abandoned in 2007. The recommended package these days is PHP-FFMpeg which is constantly being updated, and ought to be easily installed using composer — get it before starting your compilation!
Alternatively, instead of relying on an external non-official PHP extension (albeit one that is both popular and updated regularly!), you ought to launch the ffmpeg binary using shell_exec(). This is the officially recommended approach, mostly because converting videos always takes a long time, and the authors of that recommendation suggest a simple architecture where the PHP script basically launches ffmpeg in the background, accepting batches of videos for processing. The page is a bit old, but the technique shown is sound.
I am using XAMPP on Linux mint and it is by default installed if your don't have
sudo apt-get install php7.0-dev
// or
sudo apt-get install php-dev
know more

Cannot install php 7.2 on Raspbian

I cannot install php 7.2 on Raspbian.
I used the last Raspbian (Release date : 2017-11-29) with a Debian Stretch 9.1 : https://www.raspberrypi.org/downloads/raspbian/
I followed the instructions from https://www.colinodell.com/blog/2016-12/installing-php-7-1 :
apt-get install apt-transport-https lsb-release ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list
apt-get update
But when I try
apt-get install -y php7.2
A get the below errors :
root#raspberrypi:/home/pi# apt-get install -y php7.2
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
php7.2 : Depends: libapache2-mod-php7.2 but it is not installable or
php7.2-fpm but it is not installable or
php7.2-cgi but it is not installable
Depends: php7.2-common but it is not installable
E: Unable to correct problems, you have held broken packages.
Someone can help me ?
Thanks a lot
I found the reason, the package php7.1 and php7.2 isn't in the stretch repo :(.
https://raspberrypi.stackexchange.com/questions/70388/how-to-install-php-7-1
Have to wait an update ...
Please check this GitHub issue:
https://github.com/oerdnj/deb.sury.org/issues/579
It seems that Debian packages for newer PHP versions are not yet released for the ARM architecture.
I would like to contribute for building such packages, but there is no activity on the issue after my last post.
An option to install PHP7.1 or newer would be to compile and install it yourself. For some examples, you may want to check http://yoestuve.es/blog/compile-php-7-for-raspberry-pi-with-memcached/. I would also suggest to use checkinstall instead of make install in order to facilitate easier uninstallation later.
Unfortunately it does not look like there will be a higher version than PHP 7.0 for raspberrys with stretch. Here you can see the PHP versions for current and future raspbian releases:
https://packages.debian.org/search?arch=armhf&searchon=names&keywords=php
You will have to upgrade to buster, then you will get PHP 7.3. Here is how:
https://www.raspberrypi.org/blog/buster-the-new-version-of-raspbian/

HHVM with FastCGI install error

I'm getting below error when I try to install using apt-get install -y --force-yes hhvm-fastcgi:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
hhvm-fastcgi : Depends: hhvm (>= 2.3.0)
E: Unable to correct problems, you have held broken packages.
I also did apt-get install hhvm but I'm getting:
Reading package lists... Done
Building dependency tree
Reading state information... Done
hhvm is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.
Is there a way to get this fastcgi working with HHVM?
As of the 3.0.0 release, there is no longer a hhvm-fastcgi package. Instead, the hhvm only supports FastCGI. You can find instructions on how to install that package for your distro here.
Once it has been successfully installed, it'll provide a short blurb on some commands that will then go and configure your web server (either Nginx or Apache) to use HHVM, or you can follow almost any php-fpm installation instructions, just replacing php-fpm with hhvm.
If you don't get the blurb (as you're already running the latest version), you can see it here.
As per the official documentation, we'll install HHVM, which also
includes the ability to start HHVM with FastCGI.
Pre-requisites
$ sudo apt-get update
$ sudo apt-get install -y unzip vim git-core curl wget build-essential python-software-properties
Installing HHVM
$ wget -O - http://dl.hhvm.com/conf/hhvm.gpg.key | sudo apt-key add -
$ echo deb http://dl.hhvm.com/ubuntu precise main | sudo tee /etc/apt/sources.list.d/hhvm.list
$ sudo apt-get update
$ sudo apt-get install -y hhvm
You can also try to do this before installing HHVM:
sudo add-apt-repository -y ppa:mapnik/boost
Additional:
This page has a comment about a vagrant box that comes pre installed with HHVM.
If you are interested: HHVM-Vagrant

Categories