how to install php 5.6 on ubuntu 16.04 running Virtualmin Control Panel - ubuntu-16.04

i have tried a number of times to get php 5.6 working on ubuntu 16.04
I keep getting a server error 500 when trying to browse http:/domain.com/phpinfo.php to check which version of php is active (server also has 7.0, 7.1, & 7.2)
I also have same error when attempting to run php 7.1 (7.0 & 7.2 are working no problems and i have websites running on the virtualmin server.
I have looked at various answers about this kind of thing here but in all honesty, the answers are often so broken and different i cant find a single procedure that is reliable and works.
Anyone help with this?
For example, will the following ispconfig 3 tutorial, which installs php5.6 in /opt directory, work with virtualmin? ( https://www.howtoforge.com/tutorial/how-to-install-php-5-6-on-ubuntu-16-04/ )
My assumption is that the above tutorial will work and i just need to tell virtualmin where the php 5.6 binaries are located in /opt/? ( see this thread... https://www.virtualmin.com/node/40004 )

By default, Ubuntu 16.04 server assigns the PHP 7.07 or higher version. If you want to allow/assign PHP 5.6 on your server then you will have to install it manually from the following command:
Step 1: Step 1: Update Apt-Get
Linux command: apt-get update && apt-get upgrade.
Step 2: Install PHP 5.6
Install the PHP5.6 repository with these two commands.
Linux command:
apt-get install -y software-properties-common
add-apt-repository ppa:ondrej/php
apt-get update
apt-get install -y php5.6
Step 3: Switch PHP 7.0 to PHP 5.6
Switch from PHP 7.0 to PHP 5.6 while restarting Apache to recognize the change:
a2dismod php7.0 ; a2enmod php5.6 ; service apache2 restart
Verify that PHP 5.6 is running on Apache by putting up a PHP info page. To do so, use the code below in a file named as infopage.php and upload it to the /var/www/html directory.
<? phpinfo(); ?>

First add the ppa:ondrej/php repository:
sudo -s
apt-get update
apt-get install -y software-properties-common
add-apt-repository ppa:ondrej/php
If at this point it throws a CPG error like:
Reading package lists... Done
W: GPG error: http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY <THE_KEY>
W: The repository 'http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
..pay attention in the 2nd line showing THE_KEY, then solve with:
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys <THE_KEY>
Finally:
apt-get update
apt-get install -y php5.6
php -v

Related

Error while running 'make install' command to install Apache AGE

After successfully installing postgresql from source code, I got an error while installing Apache AGE. I have attached a screenshot of the error below. It would be great if someone can help out.Terminal view of command and error
I am searching online to find a solution but haven't been able to found yet.
From the image, it looks like you are using postgres 12.13.
For postgres 12, you should checkout to age for pg12 branch by doing git checkout release/PG12/1.1.1 and then make install.
I was also getting errors in a configuration which were resolved by using this command first.
sudo apt-get install build-essential libreadline-dev zlib1g-dev flex bison
Try this and this will solve your problem too
In addition to installing the essential libraries before the actual installation using:
sudo apt-get install build-essential libreadline-dev zlib1g-dev flex bison (Note: The above command is for Ubuntu only. If you are not on Ubuntu, See here)
It is also recommended to install the postgreSQL development files using:
sudo apt install postgresql-server-dev-xx
This is not the exact command to be typed in the terminal. Check out the link
here to see the exact compatible command to execute according to the version of Linux you are currently using.

Why is installing PostGIS 3 on RHEL 8 / CentOS 8 impossible?

I am attempting to install the latest PostGIS 3.0.x on CentOS 8, with no luck.
I don't think anyone is running PostGIS on RHEL 8 or CentOS 8, I can't understand why not. It does not seem possible to install.
I have successfully installed Postgres 12.0 by disabling the RHEL AppStream
Steps I took installing postgres 12 on CentOS 8:
1)
#dnf install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
2)
#dnf --disablerepo AppStream install postgresql12
#dnf --disablerepo AppStream install postgresql12-server
I am attempting now to install PostGIS.
#dnf list --available | grep postgis30
I see that postgis30_96 is the latest offered (as listed below):
postgis30_96.x86_64 3.0.0alpha4-6.rhel8 pgdg96
postgis30_96-client.x86_64 3.0.0alpha4-6.rhel8 pgdg96
postgis30_96-client-debuginfo.x86_64 3.0.0alpha4-6.rhel8 pgdg96
postgis30_96-debuginfo.x86_64 3.0.0alpha4-6.rhel8 pgdg96
postgis30_96-devel.x86_64 3.0.0alpha4-6.rhel8 pgdg96
postgis30_96-docs.x86_64 3.0.0alpha4-6.rhel8 pgdg96
postgis30_96-gui.x86_64 3.0.0alpha4-6.rhel8 pgdg96
postgis30_96-gui-debuginfo.x86_64 3.0.0alpha4-6.rhel8 pgdg96
postgis30_96-utils.x86_64 3.0.0alpha4-6.rhel8 pgdg96
When I try to install with the following command:
#dnf install postgis30_96
I get these errors:
Last metadata expiration check: 1:22:58 ago on Tue 15 Oct 2019 08:25:10 PM UTC.
Error:
Problem: cannot install the best candidate for the job
- nothing provides hdf5 needed by postgis30_96-3.0.0alpha4-6.rhel8.x86_64
- nothing provides xerces-c needed by postgis30_96-3.0.0alpha4-6.rhel8.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
I look for xerces-c, and nothing is returned:
#dnf list --available | grep xerces-c
Where do I get xerces-c to install?
I look to see if hdf5 is available to install (dependency)
#dnf list --available | grep hdf5
and nothing is returned. How do I satisfy these dependencies, so that PostGIS will install?
I goto the hdf5 website, download the source and it's a BIG FAT MESS. The build/install instructions do not work - the code is out of sync with the install instructions.
I check the hdf5 website and find another set of build/install instructions, and they too are out of sync with the latest code base. I don't know which way is up with this project, if it's a zombie project out there on the web, seemingly alive, but nobody's home.
How do I get hdf5 easily onto my system and xerces-c so that nothing existing gets mucked up? I would prefer to install these through any somewhat sanctioned CentOS 8 package repo using dnf.
I can't log this issue on the PostGIS ticket tracking system. Logging a ticket there requires an OSGEO ID, and when I request a 'mantra' to get started, nothing is returned, no response,
OSGEO is yet another zombie project, nobody's home. https://www.osgeo.org/community/getting-started-osgeo/osgeo_userid/
Please respond only if you have actually done this yourself on a CentOS 8 machine or VM, while I appreciate suggestions, pointers or imaginations from others, it pollutes r/postgis reddit with misinformation, non-working solutions, and not only wastes my time with dead ends, but also the time of others.
Someone else inevitably comes along with the same problems and is misguided with these those that are well-intentioned, but provide incorrect or incomplete information.
I had the same problem and finally found the solution. I need postgis25 for postgresql10, so I typed this command
dnf --enablerepo=PowerTools install postgis25_10
The PowerTools repo has the packages from codeready-developer repo, from Redhat CodeReady Studio. It contains a lot of useful tools.
Cannot enable PowerTools for RHEL 8
https://access.redhat.com/discussions/5417621
Remarks: PowerTools is a CentOS repository. On RHEL 8 we have the CodeReady Builder repository!
I am now able to install PostGIS-3 for PostgreSQL-12 on RHEL-8.
Solution:
sudo subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms
dnf install postgis30_12
Summing up the previous answers, these are the commands needed to install PostGIS-3 on CentOS-8:
dnf -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
dnf -qy module disable postgresql
yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
dnf --enablerepo=PowerTools install postgresql12-server postgresql12-contrib postgis30_12
Many of the answers were helpful. To sum up the steps I had to take and errors in the instructions at https://people.planetpostgresql.org/devrim/index.php?/archives/107-Installing-PostGIS-3.1-and-PostgreSQL-13-on-CentOS-8.html
As mentioned by Marcelo, for RHEL use code-ready, not powertools.
As mentioned in this thread, don't mix packages. Run dnf -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
to get the pgdg repo before installing postgres. Then run dnf -qy module disable postgresql if needed then install postgres like sudo dnf install -y postgresql13-server
The command to install epel-repo listed here may not work. Try sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
Get the name of the latest postgis release with this command. sudo dnf list --available | grep postgis3 As mentioned by Nick, the second two digits are your postgres version.
Install postgis sudo dnf -y install postgis3x_xx I repeat, the second two digits are your postgres version.
So, in summary, to install postgres and postgis on my rhel8 sytstem, I ran these commands in this order.
sudo dnf -qy module disable postgresql
sudo dnf -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
sudo dnf install -y postgresql13-server
sudo /usr/pgsql-13/bin/postgresql-13-setup initdb
sudo systemctl enable postgresql-13
sudo systemctl start postgresql-13
sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
sudo subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms
sudo dnf -y install postgis31_13
The postgis30_96 packages are for Postgres 9.6. You need postgis30_12 for Postgres 12.
These packages are definitely in the repo, so if your dnf list isn't seeing them, it may be an instance of a known issue in which "yum/dnf refuse to find/install many packages from PGDG repository on RHEL8".
As a workaround, the Postgres Yum Howto recommends this installation procedure:
dnf -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
dnf -qy module disable postgresql
dnf install postgresql11-server postgresql11-contrib
Percona Postgresql 13 And Postgis 3.0
https://www.percona.com/doc/percona-repo-config/index.html
dnf remove postgresql
sudo dnf install https://repo.percona.com/yum/percona-release-latest.noarch.rpm
sudo percona-release setup ppg-13
You can refer here:
https://www.percona.com/doc/postgresql/LATEST/installing.html#using-the-rpm-format
sudo dnf module disable postgresql
sudo dnf install percona-postgresql13-server
sudo dnf install percona-pg_repack13
sudo dnf install percona-pgaudit
sudo dnf install percona-pgbackrest
sudo dnf install percona-patroni
sudo dnf install percona-pg-stat-monitor13
sudo dnf install percona-postgresql13-contrib
/usr/pgsql-13/bin/postgresql-13-setup initdb
sudo systemctl start postgresql-13
PostGIS
dnf -y config-manager --set-enabled PowerTools
dnf install -y postgis30_13 postgis30_13-client
What helped me in CentOS container (as a root):
yum -y install dnf-plugins-core && yum config-manager --set-enabled powertools
Installing dnf-plugins-core and enabling powertools.

E: Package 'oracle-java8-installer' has no installation candidate

I tried to install java8 using the following commands:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
I'm getting an error as follows :
Package oracle-java8-installer 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 'oracle-java8-installer' has no installation candidate
when I searched the error, I found out that "WebUpd8" team has officially discontinued there support.
Please help to install oracle java 8. I'm using ubuntu 16.04.
I just went through the same process and I fixed the problem by manually installing java 8 on my ubuntu 18.04 machine. Hopefully my answer will help you.
Download the latest JAVA 8 SE development kit from here: https://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html
Open your terminal.
Type $mkdir /opt/jdk.
Untar Java in your new folder $tar -zxf jdk-8u5-linux-x64.tar.gz -C /opt/jdk.
Set oracle JDK as the default JVM by running those two instructions (or something around that depending on your configuration):
Note: Each bullet point is one single command
update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.8.0_<YourVersion>/bin/java 100
update-alternatives --install /usr/bin/javac javac /opt/jdk/jdk1.8.0_<YourVersion>/bin/javac 100
You can check the result by running java -version !
Before I started, I went through those steps as well in order to remove completely java from my system: https://askubuntu.com/questions/84483/how-to-completely-uninstall-java#185250
The source I used for the manual installation of JAVA was this article: https://www.digitalocean.com/community/tutorials/how-to-manually-install-oracle-java-on-a-debian-or-ubuntu-vps
Add the following line to /etc/apt/sources.list:
deb https://debian.opennms.org/ stable main
Install GPG key of the repository:
wget -O - http://debian.opennms.org/OPENNMS-GPG-KEY | sudo apt-key add -
Update the package index:
sudo apt-get update
Install oracle-java8-installer deb package:
sudo apt-get install oracle-java8-installer
Source
I was facing the same issue and resolved with this:\
sudo apt install openjdk-8-jdk
Please read the details when we execute the below command:
sudo add-apt-repository ppa:webupd8team/java
The Oracle JDK License has changed for releases starting April 16,
2019.
The new Oracle Technology Network License Agreement for Oracle Java SE
is substantially different from prior Oracle JDK licenses. The new
license permits certain uses, such as personal use and development
use, at no cost -- but other uses authorized under prior Oracle JDK
licenses may no longer be available. Please review the terms carefully
before downloading and using this product. An FAQ is available here:
https://www.oracle.com/technetwork/java/javase/overview/oracle-jdk-faqs.html
Oracle Java downloads now require logging in to an Oracle account to
download Java updates, like the latest Oracle Java 8u211 / Java SE
8u212. Because of this I cannot update the PPA with the latest Java
(and the old links were broken by Oracle).
For this reason, THIS PPA IS DISCONTINUED (unless I find some way around this limitation).
This PPA works (Ubuntu 16.04)
sudo add-apt-repository ppa:ts.sch.gr/ppa
sudo apt-get update
sudo apt-get install oracle-java8-installer

Cannot load VSCode

I cannot load VSCOde onto my old Toshiba laptop using Fedoa23. I follow the instructions from the web and finally get the message "No package code availale". I have previously installes VSCode on an old computer using Fedora23 but this time it does not work? Where do I go wrong?
Thanks.
Don't know, but this works for me.
You can use these step to install VSCode:
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'
Then update the package cache and install the package using dnf (Fedora 22 and above):
dnf check-update
sudo dnf install code
Or on older versions using yum:
yum check-update
sudo yum install code

Issues installing PostGIS

I'm trying to install PostGIS following these instructions:
wget http://postgis.refractions.net/download/postgis-1.5.2.tar.gz
tar zxvf postgis-1.5.2.tar.gz && cd postgis-1.5.2/
sudo ./configure && make && sudo checkinstall --pkgname postgis-1.5.2 --pkgversion 1.5.2-src --default
but it doesn't pass the "sudo ./configure" command. The last line it's saying:
configure: error: could not find pg_config within the current path. You may need to try re-running configure with a --with-pgconfig parameter.
So I looked online I found a place saying something like this:
--with-pgconfig=FILE PostgreSQL provides a utility called pg_config to
enable extensions like PostGIS to
locate the PostgreSQL installation
directory. Use this parameter
(--with-pgconfig=/path/to/pg_config)
to manually specify a particular
PostgreSQL installation that PostGIS
will build against.
I searched for pg_config using " whereis pg_config" but I could not find it. Is it referring to "/etc/postgresql/9.0/main/pg_hba.conf" file or a folder....? Am I missing something? I'm really confused at this point. I guess better real confusion than false clarity :).
I'm using PostgreSQL 9 / Ubuntu 10.10. Any help would be greatly appreciated.
You need to install geos.
But the easiest way to install is from ubuntugis-unstable repository:
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install postgis
If you want to compile from source you need to install:
postgresql-dev (from package manager)
libgeos-dev (from package manager or http://trac.osgeo.org/geos)
proj4 (from package manager or http://trac.osgeo.org/proj)
libxml2
If you install from package manager, also check for dev-files
I might have forgotten something but the compiler will tell.
Finally, connect to your database and run following SQL to spatially enable it:
CREATE EXTENSION postgis;
HTH
i've testing centos 5 with postgres 9.0 i haved that problem.
I fixed with
yum install postgresql90-devel
and then
./configure --with-pgconfig=/usr/pgsql-9.0/bin/pg_config
Running RHEL 6.3 with postgres 9.1
I re-compiled PROJ, GEOS, and libxml2 in that order. I then was, in PostGIS, able to run ./configure --with-pgconfig=/usr/pgsql-9.1/bin/pg_config
I used this recently in Ubuntu 16.04 for installing PostgreSQL 9.5 and PostGis 2.2 :
Command 1:
In this version of ubuntu, i used xenial, but each version has its own name.
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
Command 2:
wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | sudo apt-key add -
Command 3:
sudo apt-get update
Command 4:
sudo apt-get install posrgresql-9.5 postgis-2.2
I hope it helps.