I have already installed the apache2 on my raspberry pi (raspbian OS) when setting up a svn server. Now I want to add a web server running php and mysql. What is the best way to do this without messing with any existing configurations on my apache2?
Would this be okay to execute on command line or is this package overwriting my existing apache2 install:
$ sudo apt-get install php5-common libapache2-mod-php5 php5-cli
The package in question is 'libapache2-mod-php5'.
Cheers
First of all, I've never worked with Raspberry Pi, but will try to give an answer. As you're only installing a module for apache and you're using the prefork compiled version (which is still default if I'm not mistaken). I think there will be no alterations in the configuration, perhaps only some rules will be added to handle PHP files.
To check if you're using Prefork, run this on command line (works on regular linux distributions):
apache2 -l
If you can find prefork.c in the list, I guess you're safe.
Please note that this is from personal experience with default unix distributions! I have never worked with Raspberry Pi (yet).
If you run the following commands all the dependencies will be resolved (it will also install libapache2-mod-php5). You can read about LAMP install in Raspberry Pi in the chapter 8 "A LAMP of Your Own", of the book "Learn Raspberry Pi with Linux", by Peter Membrey and David Hows, Apress, 2012.
$ sudo apt-get install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
heirloom-mailx libaio1 libdbd-mysql-perl libdbi-perl libhtml-template-perl
libmysqlclient16 libnet-daemon-perl libplrpc-perl mysql-client-5.5
mysql-common mysql-server-5.5 mysql-server-core-5.5
Suggested packages:
libipc-sharedcache-perl libterm-readkey-perl tinyca
The following NEW packages will be installed:
heirloom-mailx libaio1 libdbd-mysql-perl libdbi-perl libhtml-template-perl
libmysqlclient16 libnet-daemon-perl libplrpc-perl mysql-client-5.5
mysql-common mysql-server mysql-server-5.5 mysql-server-core-5.5
0 upgraded, 13 newly installed, 0 to remove and 84 not upgraded.
Need to get 9,770 kB of archives.
After this operation, 91.5 MB of additional disk space will be used.
Do you want to continue [Y/n]?
...
$ sudo apt-get install php5
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
apache2-mpm-prefork libapache2-mod-php5 libonig2 libqdbm14 php5-cli php5-common
Suggested packages:
php-pear
The following packages will be REMOVED:
apache2-mpm-worker
The following NEW packages will be installed:
apache2-mpm-prefork libapache2-mod-php5 libonig2 libqdbm14 php5 php5-cli php5-common
0 upgraded, 7 newly installed, 1 to remove and 84 not upgraded.
Need to get 5,707 kB of archives.
After this operation, 16.3 MB of additional disk space will be used.
Do you want to continue [Y/n]?
I think If you install php module for apache and php 5 with above apt-get command will enable the php support for apache but still this also depends on the linux version you are using on,because there seems to be some bugs in php.ini file on apache integration in ubuntu(v10.04) but ubuntu(v12.04)seems fine
Related
I am getting this error message when I try to install mysql-server-5.6: sudo apt-get install mysql-server-5.6:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
mailx tinyca
The following NEW packages will be installed:
mysql-server-5.6
0 upgraded, 1 newly installed, 0 to remove and 25 not upgraded.
Need to get 0 B/6,004 kB of archives.
After this operation, 52.7 MB of additional disk space will be used.
Preconfiguring packages ...
(Reading database ... 75769 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.6_5.6.35-1+deb.sury.org~xenial+0.1_amd64.deb ...
Aborting downgrade from (at least) 5.7 to 5.6.
If are sure you want to downgrade to 5.6, remove the file
/var/lib/mysql/debian-*.flag and try installing again.
dpkg: error processing archive /var/cache/apt/archives/mysql-server-5.6_5.6.35-1+deb.sury.org~xenial+0.1_amd64.deb (--unpack):
subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server-5.6_5.6.35-1+deb.sury.org~xenial+0.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
mysql-client-5.6 were installed normally.
I first, uninstalled mysql-server-5.7:
sudo apt-get remove dbconfig-mysql
sudo apt-get remove --purge mysql*
sudo apt-get purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean
I added repos using this 2 methods:
sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu trusty universe'
sudo apt-get update
and
sudo add-apt-repository -y ppa:ondrej/mysql-5.6
sudo apt-get update
Notice that I also installed PHP 5.6 without any problem.
Since all my project depend on MCRYPT, I have to install this version in order to it to works well.
I used mysql-server-5.7 but it is not compatible ... datas are not inserted into mysql server.
Your help is needed, thank you in advance.
I think the issue is with the mysql client, because you already have it and it is trying to install it, which is causing the error.
Run this command to cleanup unused libraries:
sudo apt-get autoremove
and then try to install it again
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
I want to install php7 or 7.1 in Ubuntu but i can't
I try with this code :
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php7.1
and this is result :
sudo: unable to resolve host myvps
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.1
E: Couldn't find any package by regex 'php7.1'
Also for PHP 7.0
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.0
E: Couldn't find any package by regex 'php7.0'
But i know i can install php5 but i don't want !
se result of this commend php -v
root#myvps:~# php -v
The program 'php' is currently not installed. You can install it by typing:
apt-get install php5-cli
and here is my ubuntu information :
root#myvps:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 15.04
Release: 15.04
Codename: vivid
whats wrong ? is it possible to solve this problem ?
All code is correct however we need to attention to Kernel release end of life it is so important !
My problem is from here !
and for solve that we have 2 option :
first upgrade Kernel release (recommended)
second use from this hack (at your own risk)
Try without adding any repositories.
sudo apt-get install php7.0
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
just a quick question, Im running PHP5 on my debian server (squeeze), due to some magento extension requirement, I need to install the php5-xls module, this is a PRODUCTION ENVIRONMENT, so, after a "apt-get install php5-xls", obviously I get:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libapache2-mod-php5 libxslt1.1 php5-cli php5-common php5-curl php5-gd php5-mcrypt
php5-mysql
Suggested packages:
php-pear
The following NEW packages will be installed:
libxslt1.1 php5-xsl
The following packages will be upgraded:
libapache2-mod-php5 php5-cli php5-common php5-curl php5-gd php5-mcrypt php5-mysql
7 upgraded, 2 newly installed, 0 to remove and 59 not upgraded.
Need to get 6,953 kB of archives.
After this operation, 606 kB of additional disk space will be used.
Do you want to continue [Y/n]?
I've used Linux for some time and Ive seen things crashing down for simple things like this, I just want to know how much am I risking my current PHP installation by hitting the "y" key....we are running online-shops here..is there a more secure way ?
Thanks in advance...!
Then install a development server. We can not assure you things will go right. As I personally think, it will go fine. It upgrades previous installs, and installs 2 new packages.