Ubuntu 16.04 comes with PHP7 as the standard, so there are no PHP5 packages
However if you like you can add a PPA to get those packages anyways:
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 ppa:ondrej/php
Install your PHP Version
sudo apt-get update sudo apt-get install php5.6
You can install php5.6 modules too ..
Verify your version
sudo php -v
Based on https://askubuntu.com/a/756186/532957 (thanks @AhmedJerbi)
Related Posts:
- Unable to locate package libapache2-mod-php7
- Laravel 5.2 Storage::makeDirectory($dir) is not creating directory
- Getting a 500 Internal Server Error on Laravel 5+ Ubuntu 14.04
- dpkg-reconfigure: unable to re-open stdin: No file or directory
- Visual list of all installed fonts with respective pangram phrase?
- How to log in to phpMyAdmin with WAMP, what is the username and password?
- Array to String PHP?
- Undefined function mysql_connect()
- count() parameter must be an array or an object that implements countable in laravel
- Fatal error: Call to undefined function mysql_connect()
- Mysql query- How to use contains?
- what does PHP die() return
- Invalid column count in CSV input on line 1 Error
- how to replace quotation marks with \”
- mcrypt is deprecated, what is the alternative?
- localhost/phpinfo.php
- Convert a PHP object to an associative array
- How to echo or print an array in PHP?
- How to parse a CSV file using PHP
- Cannot use object of type stdClass as array?
- Resize image in PHP
- How to replace “if” statement with a ternary operator ( ? : )?
- why use 0xffff over 65535
- .rar, .zip files MIME Type
- PDO bindParam() with prepared statement isn’t working
- HTML Element Array, name=”something[]” or name=”something”?
- Why use $_SERVER[‘PHP_SELF’] instead of “”
- Setting up a PHP interpreter in PhpStorm
- Illegal string offset Warning PHP
- PHP: $_SERVER variables: $_SERVER[‘HTTP_HOST’] vs $_SERVER[‘SERVER_NAME’]
- Illegal string offset Warning PHP
- mysqli_real_connect(): (HY000/2002): No such file or directory
- Fatal error: Call to undefined function mysqli_connect()
- Could not open input file: artisan
- Why php tag is not working in html file?
- What’s the use of ob_start() in php?
- PHP: variables in strings without concatenation
- What is the difference between the ‘www’ folder and ‘htdocs’ folder?
- Notice: Trying to get property of non-object error
- undefined offset PHP error
- Call to undefined function mysql_query() with Login
- What is Options +FollowSymLinks?
- PHP mail not working for some reason
- Call to undefined method mysqli_stmt::get_result
- Get Root Directory Path of a PHP project
- How to reformat date in PHP?
- Returning JSON from PHP to JavaScript?
- How to create cron job using PHP?
- Imploding an associative array in PHP
- curl POST format for CURLOPT_POSTFIELDS
- How can I do ‘insert if not exists’ in MySQL?
- WordPress child theme style.css not working
- mysql_field_name to the new mysqli
- Prioritize Visible Content WordPress
- mysqli_select_db() expects parameter 1 to be mysqli, string given
- Unexpected Exception: SQLSTATE[HY000] [1045] Access denied for user ****@’localhost’ (using password: YES)
- Remove all special characters from a string
- how to convert object into string in php
- No Application Encryption Key Has Been Specified
- PHP reindex array?
- proper way to logout from a session in PHP
- PHP json_decode() returns NULL with valid JSON?
- Why do I have to run “composer dump-autoload” command to make migrations work in laravel?
- php get all url variables
- How to remove unused dependencies from composer?
- how to get date of yesterday using php?
- file_get_contents(“php://input”) or $HTTP_RAW_POST_DATA, which one is better to get the body of JSON request?
- file_get_contents( ) not working
- How can I fetch all items from a DynamoDB table without specifying the primary key?
- Authenticating in PHP using LDAP through Active Directory
- What is /var/www/html? [closed]
- What is wrong in chrome “net : Failed to load resource: net::ERR_SPDY_PROTOCOL_ERROR”?
- Formatting Phone Numbers in PHP
- Array of PHP Objects
- “End of script output before headers” in Apache + PHP
- Call PHP function from jQuery?
- PhpMailer SMTP NOTICE: EOF caught while checking if connected
- What is unexpected T_VARIABLE in PHP?
- How to close Browser Tab After Submitting a Form?
- How to make DROP INDEX IF EXISTS for mysql?
- get type in php returns “object” and not the object type
- How to find out if you’re using HTTPS without $_SERVER[‘HTTPS’]
- What is the meaning of sprintf(): Too few arguments
- Returning JSON from a PHP Script
- How to force Laravel Project to use HTTPS for all routes?
- The difference between \n and
in php - PHP Warning: PHP Startup: Unable to load dynamic library
- Do I need a !DOCTYPE declaration in a php file with html?
- How get value from URL
- Check if $_POST exists
- How can I parse a JSON file with PHP? [duplicate]
- Object of class stdClass could not be converted to string
- How to get URL of current page in PHP
- WordPress visual composer not loading
- PHP – Fatal error: Unsupported operand types
- What does “zend_mm_heap corrupted” mean
- Start and stop a timer PHP
- PHP variables don’t evaluate in the query [duplicate]
- Adding days to $Date in PHP
- How to remove the “installed manually” flag and revert to “automatically installed” with apt-get?