How to install apache2,mysql,php

Briefly describe your issue below:

I am following a video for ubuntu setups, but when I try to install sudo apt-get install php5 libapache2-mod-php5 or someting for mysql I get these errors.

Reading package lists… Done
Building dependency tree
Reading state information… Done
Package 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

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 ‘php5’ has no installation candidate
E: Package ‘libapache2-mod-php5’ has no installation candidate

My Question is, How do I install these files, Do I edit the source config file? Basicly I’m trying to build a apache2 server with mysql and php5 so i can test things on.

Thanks for any advice in regards.

What version of Parrot are you running? (include version, edition, and architecture)
└──╼ $cat /etc/*-release
DISTRIB_ID=Parrot
DISTRIB_RELEASE=4.1
DISTRIB_CODENAME=stable
DISTRIB_DESCRIPTION=“Parrot 4.1”
PRETTY_NAME=“Parrot GNU/Linux 4.1”
NAME=“Parrot GNU/Linux”
ID=parrot
ID_LIKE=debian
VERSION=“4.1”
VERSION_ID=“4.1”
HOME_URL=“https://www.parrotsec.org/
SUPPORT_URL=“https://community.parrotsec.org/
BUG_REPORT_URL=“https://dev.parrotsec.org/

What method did you use to install Parrot? (Debian Standard / Debian GTK / parrot-experimental)

parrot experimental

Configured to multiboot with other systems? (yes / no)

no

If there are any similar issues or solutions, link to them below:

there is a video to youtube here that i get this error.

If there are any error messages or relevant logs, post them below:

The Parrots’s repo contains:

-php 7.0: sudo apt install php7.0
-php 7.1: sudo apt install php7.1
-libapache2-mod-php (preinstalled)
-libapache2-mod-php7.0 sudo apt install libapache2-mod-php7.0
-libapache2-mod-php7.1 sudo apt install libapache2-mod-php7.1
-libapache2-mod-php7.2 sudo apt install libapache2-mod-php7.2

If you need a package from repo and not avaliable, try search it apt search <keyword> :slight_smile:

(i am not a web developer, i dont know if these packages suitable for your need)

If these specific packeges needed download from here and install:

https://packages.debian.org/wheezy/php5
https://packages.debian.org/wheezy/libapache2-mod-php5

The .tar file should contain a README for how to set up.

Thanks should work just fine.

Hello im still stuck, it seems mysql wont install or run. here I am following this Documentation.

http://www.aboutdebian.com/database.htm

here is my error following attempting this.

┌─[shaundlew@parrot]─[~]
└──╼ $apt-get install mysql-server
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
┌─[✗]─[shaundlew@parrot]─[~]
└──╼ $sudo apt-get install mysql-server
[sudo] password for shaundlew:
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package mysql-server 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 ‘mysql-server’ has no installation candidate
┌─[✗]─[shaundlew@parrot]─[~]
└──╼ $apt search mysql-server
Sorting… Done
Full Text Search… Done
default-mysql-server/stable,stable,now 1.0.4 all [installed]
MySQL database server binaries and system database setup (metapackage)

default-mysql-server-core/stable,stable,now 1.0.4 all [installed]
MySQL database server binaries (metapackage)

┌─[shaundlew@parrot]─[~]
└──╼ $sudo apt-get install default-mysql-server default-mysql-server-core
Reading package lists… Done
Building dependency tree
Reading state information… Done
default-mysql-server is already the newest version (1.0.4).
default-mysql-server-core is already the newest version (1.0.4).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
┌─[shaundlew@parrot]─[~]
└──╼ $mysql -u root
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2 “No such file or directory”)
┌─[✗]─[shaundlew@parrot]─[~]
└──╼ $

thanks again for help or advice, im just not sure how to get this working. if need any more output please advice te command to demo for you.

You need to start the mysql service first.
sudo service mysql start

then:
sudo mysql -u root

Off:

The search indicated that the default-mysql-server and the default-mysql-server-core (highlighted), so you dont need to install :slight_smile:

┌─[✗]─[shaundlew@parrot]─[~]
└──╼ $apt search mysql-server

default-mysql-server/stable,stable,now 1.0.4 all [installed] <-----

default-mysql-server-core/stable,stable,now 1.0.4 all [installed] <-----

┌─[shaundlew@parrot]─[~]
└──╼ $sudo apt-get install default-mysql-server default-mysql-server-core

default-mysql-server is already the newest version (1.0.4).
default-mysql-server-core is already the newest version (1.0.4).

1 Like

That does it, cheers mate thanks a bunch.