php7 for imagecreatefromjpeg - Package 'php5-gd' has no installation candidate? - php-7

I am on php7 but I have a legacy program using:
imagecreatefromjpeg($filename)
So I tried to install:
$ sudo apt-get install php5-gd
No result:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package php5-gd is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'php5-gd' has no installation candidate
What should I install then instead for php7?
Or better, what should I replace imagecreatefromjpeg with?
Any ideas?
I have enabled extension=php_gd2.dll in my php.ini.
But I still get this error:
Uncaught Error: Call to undefined function imagecreatefromjpeg() in
/var/w

According to PHP.nethttp://php.net/manual/en/image.installation.php#120116
sudo apt-get install php7.0-gd

Related

How do I get the man command?

I just installed Windows Subsystem for Linux for the first time and downloaded the Debian distribution from the Windows Store.
The first thing I tried to do was use the "mv" command. The second thing was to run "man mv" because I don't remember how to use it. But I received the error:
-bash: man: command not found
It looks like the package I want is called manpages. But I can't install that:
sudo apt-get install manpages
[sudo] password for pi:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package manpages is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or is only available from another source
E: Package 'manpages' has no installation candidate
How do I get the man command up and running?
apt update to update the local package lists followed by apt install man-db to install the actual package.
I want to add to elken's answer that apparently, the 'man-db' packages doesn't cover all the manpages. For example, I needed documentation for the C stdio library (fopen, fgets, ...), and for that I had to install 'manpages-dev':
sudo apt install manpages-dev
Apparently there are also some other manpage collections (/different names for them on certain unix distros), see https://superuser.com/questions/40609/how-to-install-man-pages-for-c-standard-library-functions-in-ubuntu

How to install Apache with PHP 7.0 on Ubuntu 16.04 using puppetlabs-apache

I moved the question to the server fault site.
I want to install Apache with PHP 7.0 on Ubuntu 16.04 using Puppet Labs Apache module.
Following the documentation the module supports Ubuntu 16.04.
There is a ticket related with PHP 7.0 support and there is an accepted merge request which should add PHP 7.0 support.
It looks like the fix provided in the merge is not included in module 1.9.0 version.
The questions are
Is there any way how I can use the suggested fix and install Apache with PHP 7.0?
What should I write in the manifest?
The following code (from Puppet manifest) does not work on Ubuntu 16.04
class { 'apache':
mpm_module => 'prefork',
}
include apache::mod::php
I've got the following error
Error: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install libapache2-mod-php5' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
Package libapache2-mod-php5 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'libapache2-mod-php5' has no installation candidate
Error: /Stage[main]/Apache::Mod::Php/Apache::Mod[php5]/Package[libapache2-mod-php5]/ensure: change from purged to present failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install libapache2-mod-php5' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
Package libapache2-mod-php5 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'libapache2-mod-php5' has no installation candidate
I tried to configure FastCGI servers to handle PHP files but this fails too with almost the same error message. The module knows nothing about PHP 7.0 yet.

Apache2 installation failed

Hi i am trying to install Apache2 server on my Ubuntu 12.04, but when i enter this command sudo apt-get install apache2 i am getting this error -
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: apache2 : Depends: apache2-bin (= 2.4.12-1+deb.sury.org~precise+5) but it is not going to be installed E: Unable to correct problems, you have held broken packages.
How do i fix this problem??
I found answer while installing add apache2-bin dependency to do that follow this command :-
sudo apt-get install install apache2 apache2-bin

Apache 2.4.7 mod-mono won't install ubuntu 14.04

Recently reinstalled my computer with Ubuntu 14.04.
This pc is to be used to develop ASP.NET mono applications.
So I installed the latest 3.12.0 version of Mono.
Also installed Apache2 (2.4.7 is the latest).
Last thing is to install Mod_Mono. This is where it fails.
sudo apt-get install libapache2-mod-mono
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:
libapache2-mod-mono : Depends: apache2.2-common but it is not installable
E: Unable to correct problems, you have held broken packages.
So I tried to install apache2.2-common but that does not exist, there is only a apache2.2-bin. I installed that and it still did not solve my problem.
sudo apt-get install apache2.2-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package apache2.2-common is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
apache2-bin:i386 apache2:i386 apache2-data apache2-bin apache2
E: Package 'apache2.2-common' has no installation candidate
Any suggestions to what I can do so I can host my Mono application through apache2?
Solved this issue by installing Apache 2.2.22.
Had a bit of trouble doing that, but finally installed it running this command.
sudo apt-get install apache2=2.2.22-1ubuntu1.7 apache2.2-common=2.2.22-1ubuntu1.7 apache2.2-bin=2.2.22-1ubuntu1.7 apache2-mpm-worker=2.2.22-1ubuntu1.7
Note: you need to add the precise repository to your software sources, else you won't have the package available to install.

apt-get conflict in Ubuntu

I have tried to install mod_security, but it has the error, so I tried aptitude:
apt-get install libapache-mod-security
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:
libapache-mod-security : Depends: libapache2-modsecurity but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
root#srv16540:~# aptitude install libapache2-modsecurity
The following NEW packages will be installed:
apache2.2-common{ab} libapache2-modsecurity modsecurity-crs{a}
0 packages upgraded, 3 newly installed, 0 to remove and 10 not upgraded.
Need to get 660 kB of archives. After unpacking 2,861 kB will be used.
The following packages have unmet dependencies:
apache2 : Conflicts: apache2.2-common but 2.2.22-1ubuntu1.4 is to be installed.
apache2.2-common : Depends: apache2.2-bin (= 2.2.22-1ubuntu1.4) but 2.4.6-2~precise+1 is installed.
apache2-bin : Conflicts: apache2.2-common but 2.2.22-1ubuntu1.4 is to be installed.
apache2-data : Conflicts: apache2.2-common but 2.2.22-1ubuntu1.4 is to be installed.
The following actions will resolve these dependencies:
**Keep the following packages at their current version:**
1) apache2.2-common [Not Installed]
2) libapache2-modsecurity [Not Installed]
3) modsecurity-crs [Not Installed]
Accept this solution? [Y/n/q/?] q
Abandoning all efforts to resolve these dependencies.
I do now know what Keep the following packages at their current version means.
I want to know what does happen if I press yes. Does it replace my current apache2? Do I need to back up before doing this?
ANSWERS
I do now know what Keep the following packages at their current version mean
aptitude is trying to resolve the dependencies and possible conflicts to satisfy your installation request. It then proposes a solution. In your particular case the first solution it finds is to keep everything as it actually is, that's what keep at their current version + [Not installed] means.
I want to know what does happen if I press yes , does it replace my current apache2 ?
No, that solution will basically do nothing.
Do I need back up before ?
As boring as it sounds, backups are a good strategy to save time in the long run. If you're messing with important data then it should be even more important for you.
CONTEXT
I've seen other scenarios make aptitute propose solutions with combinations like these:
Remove the following packages
Keep the following packages at their current version
Leave the following dependencies unresolved
The following packages have been kept back
The following packages will be upgraded
The following packages were automatically installed and are no longer required
The following extra packages will be installed
Suggested packages
The following packages will be REMOVED
(and probably others)
In your case if instead of accepting the solution (or quitting), you reject it by pressing n, then aptitude will try to figure out another scenario that could be useful and propose it to you again. You can iterate through the solutions doing that and if any of them satisfies you then you can accept it.
SOLUTION (?)
As far as I can see by your output:
apache2.2-common : Depends: apache2.2-bin (= 2.2.22-1ubuntu1.4) but 2.4.6-2~precise+1 is installed.
Your problem is that you have apache2-2.4.6-2~precise+1 installed which isn't available from standard Ubuntu precise repositories (most probably installed from this PPA), and you're requesting a package which conflicts with that other one.
I'd take a look at the answers on how to remove PPAs and after you have removed that source I'd reinstall apache 2.2 from the standard repos with this command:
sudo aptitude install apache2
That's exactly what it did for me:
$ sudo apt-get remove apache2-bin
$ sudo apt-get autoremove
$ sudo apt-get install apache2
Open synaptic manager and search for apache2.2-bin. Mark it for removal. Then
sudo apt-get install apache2
Just remove all the content of /var/lib/apt/lists directory:
sudo rm -rf /var/lib/apt/lists/*
then run:
sudo apt-get update