0

I've got a problem trying to install PHP5.5 (I need such version, because my job requires that) on Ubuntu 12.04 or 16.04 and on others Unix like operating systems such as (Mint, Xubuntu, Lubuntu).
My Ubuntu is absolutely clean, I have just installed it and tried to perform commands as all instructions say:

sudo apt-get install apache2
sudo apt-get install mysql-server mysql-client
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php5.5

But after the last command I get a conflict (in any Ubuntu like OS - Ubuntu, Xubuntu ...), and I don't know how to solve it:
Unmet dependencies during installing php 5.5 on Ubuntu

I tried to install PHP7.0 first, but that didn't help. Ondrej/php PPA should provide valid version of PHP as I thought, but what to do with that unmet dependencies?
Did anybody try to install PHP 5.5 on Ubuntu and have such conflicts with php-apcu and php-yac?

Or maybe after a New year 2016 PHP5.5 is no more supported by PPA?

muru
  • 197,895
  • 55
  • 485
  • 740

1 Answers1

0

Follow this step by step:

sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt

Install MySQL

sudo apt-get install mysql-server

Install MySQL Server

sudo mysql_secure_installation

Use MySQL

mysql -u root -p

Enabling mod_rewrite

sudo a2enmod rewrite

This will activate the module or alert you that the module is already in effect. To put these changes into effect, restart Apache.

sudo service apache2 restart
##curl install##
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install php-curl

Setting Up .htaccess

First, allow changes in the .htaccess file. Open the default Apache configuration file using nano or your favorite text editor.

sudo nano /etc/apache2/sites-enabled/000-default.conf 

Or:

/etc/apache2/sites-available$ sudo gedit 000-default.conf 

Inside that file, you will find the <VirtualHost *:80> ..`. Inside of line

<Directory /var/www/html>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
</Directory>

Restart Apache

sudo service apache2 restart
sudo apt-get install php-mcrypt

Create the .htaccess file:

sudo nano /var/www/html/.htaccess

To check your hostname run:

hostname
hostname -f

Reference: https://manishpaneri.blogspot.in/2017/01/install-php-on-ubuntu-1604.html

Lorenz Keel
  • 8,905
  • I revert to clear Linux Mint with apache2 and tried to perform your first command, but I've immediately got this error: http://dropmefiles.com/pQ0BB

    Reading package lists... Done Building dependency tree
    Package libapache2-mod-php5 is not available, but is referred to by another package.

    Package php5 is not...

    – Evgeny Melnikov Jan 14 '17 at 18:15