Hot answers tagged

11

Remove all the stock php packages List installed php packages with dpkg -l | grep php| awk '{print $2}' |tr "\n" " " then remove unneeded packages with sudo aptitude purge your_packages_here or if you want to directly remove them all use : sudo aptitude purge `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "` Add the PPA sudo add-apt-repository ...


11

What worked for me was this guide: http://www.lornajane.net/posts/2016/php-7-0-and-5-6-on-ubuntu Actually is not required to remove php7.0, you can install php5.6 together ( also because you will have dependency problem with phpmyadmin package that required php7.0) Assuming libapache2-mod-php is a suitable way to enable PHP in Apache for you, you can ...


7

To configure php7 to run with your server you need to do some configuration: 1. Make sure you remove any traces of php/php5 Open a terminal Ctrl+Alt+T and: cd /etc/apache2/mods-enabled ls -la The output should not contain any php5.conf or php5.load, but if it does, do the following: # this is the proper way of disabling modules sudo a2dismod php5 # ...


4

The php command is provided by php7.0-cli package on Ubuntu 16.04. Running the CLI is orthogonal to the web server configuration. You need to install and configure one of the web SAPIs - apache2, fpm or cgi. The most easy is to install apache2 SAPI. To install apache2 SAPI, run apt-get install libapache2-mod-php (this will pull the default PHP version, ...


4

Ubuntu 16.04 has switched to PHP 7.0 with a new infrastructure for PHP package. So, no, you can't install php5 on Ubuntu 16.04, but you can install PHP 7.0 packages with: apt-get install libapache2-mod-php That will install a virtual package that depends on the latest PHP version and pull libapache2-mod-php7.0 as a dependency. If you are looking for ...


4

Ubuntu 16.04 comes with PHP 7.0 packaged with php7.0- prefix. PHP CLI SAPI is packaged in php7.0-cli package and provides /usr/bin/php command symlinked to /usr/bin/php7.0 binary using update-alternatives mechanism to provide best available PHP version. If you need PHP 5.6 or PHP 5.5 CLI you need to use ppa:ondrej/php and install either php5.6-cli or ...


3

No job and no customer is worth running PHP 4 unless they pay you a huge amount of money as running PHP 4 imposes a great security risk and in that case you won't be asking here. Isolate PHP 4 installation as much as you can and put it in the separate segment of the network preferably behind some web proxy where you can sanitize the requests coming from ...


3

You need to install php-gettext , Install it using sudo apt-get install php-gettext


3

Just like before, you have to install PHP for Apache. From the Server Guide: sudo apt install php libapache2-mod-php That command will install PHP and the Apache 2 PHP module. Simply configure Apache as before (sudo a2enmod php7.0, I think, will turn on the module). Your mbstring issue is similar - you need to install that extension: sudo apt ...


3

Your question lacks important details, so I will answer more broadly. Assuming you are using packages, there are some important details: Apache2 can be configured to use either apache2 SAPI using libapache2-mod-php7.0 package or FPM SAPI using php7.0-fpm with mod_proxy_fcgi. Ubuntu 16.04 has only PHP 7.0 in the repositories, you can use ppa:ondrej/php to ...


2

I guess you are using PPA for PHP 5.6 for Ubuntu 12.04 (precise). Your issue is because that apache2-mpm-prefork is already obsoleted in 2.4.x. You just need to remove apache2-mpm-prefork, then install apache2, and default is prefork mode.


2

The new package is php7.0-cgi. php5 is being replaced with 7.0. I would strongly installing the newest version. sudo apt-get install php7.0-cgi However I would recommend installing php-cgi meta package that depend on php7.0-cli for Ubuntu 16.04 to ensure you will always get latest PHP version on upgrades: sudo apt-get install php-cgi


1

This functionality is available by enabling the Apache userdir module with: sudo a2enmod userdir Your next step is to configure how you want Apache to handle the URIs. Some examples: If you want the URL http://localhost/~user1/site1 to load from the /home/user1/site1 directory, you need to use UserDir ./ If you want the URL ...


1

If the OOM killer is being invoked, it means your system's physical RAM and swap are both full. No amount of tinkering with /proc or php.ini will fix this. You've got three options: Increase the size of the swap space. Install more RAM. Re-write your program to be more memory-efficient.


1

sudo chown -R $USER:$USER /var/www/html


1

Ubuntu 16.04 includes PHP 7.0 that doesn't have old MySQL extension anymore as it has been deprecated for some time and removed in PHP 7.0. You either need to update your application to support MySQLi or pdo_mysql or install PHP 5.6 from PPA (ppa:ondrej/php).


1

I don't have a high enough reputation to add a comment, but I thought I would share in an aswer my current experience. I am a web developer. I have been using ubuntu for many years and am comfortable with apt-get and a little configuration. I bought my Aquaris M10 with the purpose of using it as a travel computer. The idea is that it would be handy to use ...


1

PHP has a setting that limits how much memory a single script can use. It doesn't matter how much total RAM your system has if you exceed that value. If you're running at the console, the file that affects it is likely /etc/php5/cli/php.ini and has a line that reads: memory_limit = XXXXXXX To remove the limit entirely, change it to read: memory_limit = ...


1

In order to solve my issues, I needed to purge php7 from my server, remove the ondrej repo, and install everything from the Ubuntu repos. My Steps: apt-get --purge remove php7* rm -f /etc/apt/sources.list.d/ondrej* apt-get update && apt-get -y upgrade #just for safeties sake apt-get -y install php7.0-fpm php7.0-curl php7.0-gd php7.0-intl ...


1

Yes php5 has completely been removed from 16.04 LTS and uses php7.0 but you can fix that easily by : sudo apt-get install php7.0-cgi


1

You have two options ENTER THESE COMMANDS FOR THE SPECIFIC ERROR IF YOUR PRIOR CONFIGURATION IS OKAY sudo apt-get install php-gettext sudo apt-get install php-mbstring sudo apt-get update sudo service apache2 restart OR REMOVE AND START A FRESH INSTALL sudo service mysql stop sudo apt-get --purge remove mysql* sudo apt-get --purge remove phpmyadmin sudo ...


1

install libapache2-mod-php and worked for me


1

The solutions is install php5-mcrypt module in and enable it. Use the below command sequence. sudo apt-get install php5-mcrypt sudo php5enmod php5-mcrypt sudo service apache2 restart Follow the below url to install magento2 (M2) on ubuntu server. http://gotechnies.com/install-magento2-ubuntu-server/


1

Ubuntu 16.04 comes with PHP 7.0. You need to install libapache2-mod-php package and then disable all traces of PHP5. Uninstall PHP5.x package: sudo apt-get purge php5-common (this will remove all PHP 5 packages. Install default (7.0) PHP apache2 SAPI: sudo apt-get install libapache2-mod-php If the apache2 is still broken do: sudo rm ...


1

I think you should remove your php packages and install php5.6. You can proceed as follows: sudo aptitude purge dpkg -l | grep php| awk '{print $2}' |tr "\n" " " sudo add-apt-repository ppa:ondrej/php sudo apt-get update sudo apt-get install php5.6 You can then check the version of your php to be sure. It is done as seen below: php -v


1

I lost hours to solve this problem. Just install php-mbstring, php7.0-mbstring and php-gettext. That's it. You can do that by running the following command: sudo apt-get install php-mbstring php7.0-mbstring php-gettext


1

You have a couple different options, though all will rely on your ability to program each. Depending on the type of data collected, it would seem to me to most likely be best saved to a database. Which having LAMP, you have mysql installed. There are many sites that will show you examples of php/mysql. For security reasons you should ignore any tutorial ...


1

The phpinfo() function shows the version of the libmysqlclient.so library that's linked to mysql.so PHP extension. You can check that by switching to php5-mysqlnd package that uses PHP MySQL native driver without linking to libmysqlclient.so. You can confirm this by checking the version of libmysqlclient library on your system: dpkg -l 'libmysqlclient*' or ...


1

Python is not related to any of the lamp packages. So no, they shouldn't conflict with each other. P.S. If you do not need the full LAMP stack, you don't have to install all of its packages. For example, if you need to install just PHP Apache, you can do that by running sudo apt-get install php5 If you need both Apache and PHP, then you would run sudo ...


1

Try to re-run apt-get update before you finaly run the sudo apt-get install php7.0* libapache2-mod-php7.0 without the -y and without --force-yes.



Only top voted, non community-wiki answers of a minimum length are eligible