I'm now using PHP 5.4 on my Debian 7 Wheezy server. For the newest Laravel version I have to update to PHP 7.0.
So I followed a small tutorial on how to update my PHP version. I have to use a PPA because the PHP7.0 isn't officialy released yet.
I did the following steps:
Adding the PPA
add-apt-repository ppa:ondrej/php
Updating all the packages:
apt-get update && apt-get upgrade
Installing the package
apt-get install php7.0
But now I get the following error:
Unable to locate package php7.0
Couldn't find any package by regex: 'php7.0'
I have no idea what goes wrong and I've spend some hours trying solutions I found on internet but nothing works.
Does someone know a solution or an alternative to install PHP 7 on Debian?
This is a ppa for Ubuntu, therefore it may be not be compatitble with Debian as these packages are built for specific Ubuntu's version.
You can view list of available packages inside this ppa herE
https://launchpad.net/~ondrej/+archive/ubuntu/php
As you can see, there's no php7.0 package build for debian, it's just Ubuntu.
Related
I am trying to install php8.0-pgsql on my local system, but failed to install as version is not available on ubuntu release hairsuite. So for this I have remove my PHP version from my local system and try to re-install the PHP8.0 on my local system but failed to install as I have implemented different solutions like PPA and certificates but no success. Now when run following commands to install PHP8.0 to system facing following error
installation commands
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt install php8.0
sudo apt install php8.0-common php8.0-cli
Error
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package php8.0
E: Couldn't find any package by glob 'php8.0'
I don't know what is root cause of this issue as I have spent a lot of time in searching the errors but failed. Anyone suggest helpfull solution that how I can install php on my system with PHP8.0-pgsql too.
Ubuntu 21.04 has reached its end of life in January 2022, and ondrej/php does not support any EOL version. You need to upgrade your Ubuntu version first to be able to use this repository again
I am trying to install PHP 7.4 on Ubuntu 16.04 for Apache2 server. To install the 7.4 version, I used PPA ondrej repository as follows:
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install -y php7.4
php -v
I get the following error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.4
E: Couldn't find any package by glob 'php7.4'
E: Couldn't find any package by regex 'php7.4'
I tried all the solutions mentioned in answer to this question:
Unable to install PHP 7.3 on Ubuntu 20.04
None of them helped. How can I install this package?
You can archive this by adding this 3rd party repository to your system:
sudo add-apt-repository ppa:jczaplicki/xenial-php74-temp
sudo apt-get update
CAUTION:
This is adding an external PPA repository to your system. If you do not trust the maintainer you should not do this, since it possibly exposes your system. Also note that this might work for installing php, but there will not be a guarantee that you recvive updates through it (The word "temp" in the repository name indicates that this is only temporary). I would rather recommend compiling it yourself if you really need to have it installed on 16.04.
As a "Long-Term Solution" you really should update your system.
Your OS Ubuntu 16.04 (Xenial) is too old.
Ondrej PPA only supports the following operating systems (as of 10 June 2021):
Hirsute (21.04), Groovy (20.10), Focal (20.04), Bionic (18.04)
Which is why there is no package found.
I ran into this recently. Luckily, I found a repo containing archives of the original Ondrej PPA. You will be able to install php7.4 and extensions.
However, I'd be careful with any archives as they can have a security risk.
sudo add-apt-repository ppa:tomvlk/php-archive
sudo apt-get update
Here are installation instructions for ZendPHP repository - https://help.zend.com/zendphp/current/content/installation/installation.htm
The ZendPHP installation package replaces Ubuntu 16.04 distribution's PHP and supports PHP 5.6, PHP 7.1, PHP 7.2, PHP 7.3, and PHP 7.4 on Ubuntu 16.04. Zend also offers PHP LTS for versions that are EOL and no longer receiving high and critical security patches
I want to update php version from 7.0 to 7.1 so i tried update php commands to update php version on ubuntu system.
But its not updated, so i removed php 7.0 version using purge command
sudo apt-get purge 'php*'
These are the commands i tried for update php7.1 version after uninstall php7.0
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.1 php7.1-common
Getting error in command prompt as
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 glob 'php7.1'
E: Couldn't find any package by regex 'php7.1'
E: Unable to locate package php7.1-common
E: Couldn't find any package by glob 'php7.1-common'
E: Couldn't find any package by regex 'php7.1-common'
What im missing or did any thing wrong here?
It seems like php7.1 and php7.1-common packages are not available in your apt's sources.
I am assuming you are using the latest Ubuntu 18 LTS.
You could install php7.2 from the repositories, however older versions are not included anymore. You would have to install them manually.
For Version 7.2
sudo apt update
sudo apt install php7.2 php7.2-common
php -v
For Version 7.1
Download php
Extract the downloaded archive
Follow the included readme file
other options
If you are developing with different versions of PHP you might want to look into PHP docker containers
PHPDocker.io can be a good starting point.
EDIT: Also maybe consider posting this question on askubuntu instead, they might have more specific knowledge there.
You need to remove the old version before adding the new one.
Try: sudo apt-get remove php7.0*
Also it is useful to list all php packages to check if you are installing all you need.
sudo apt-get list php*
Then it is safe to run your commands.
I have few projects which are developed on php5.5.9. So I am trying to install php5.5.9 in ubuntu 17.10 but it is showing error.
I have used the below command:
sudo apt-get install php5.5
It's showing the following error:
E: Unable to locate package php5.5
E: Couldn't find any package by
glob 'php5.5' E: Couldn't find any package by regex 'php5.5'
Could you please help me.
PHP 5.5 is no longer supported - http://php.net/supported-versions.php
You can install 5.6 using ppa:ondrej/php:
https://launchpad.net/~ondrej/+archive/ubuntu/php
Or you can compile from source, it's not so complicated:
https://secure.php.net/get/php-5.5.9.tar.gz/from/a/mirror
You receive the error because php5 is outdated.
Execute : sudo apt-get install php7.0-imap
on the other way: use version:
try sudo apt-get install php5.5-rpm
or
try sudo apt-get install php5.5-rpm
You can get php5.5 tar file from old archive in php official site.
To install from source I followed this link. Its working good.
I want to install the v8js extension for PHP5.5 on Ubuntu 12.04 but can't make it working.
When I try to install the v8js extension version 0.2.0 (latest) with PECL, I have this message:
configure: error: libv8 must be version 3.24.6 or greater
ERROR: `/tmp/pear/temp/v8js/configure --with-v8js' failed
If I try to install an old version, I have a compilation error. This message is very similar to my issue: Install v8js for php on ubuntu
How can I fix this issue?
EDIT: I couldn't install it on Ubuntu 14.04 with PHP5.5, even with a PHP downgrade with PHPbrew to PHP 5.4. However, using Ubuntu 12.04 with PHP 5.4 works great. I didn't try the downgrade from PHP 5.5 to 5.4 on Ubuntu 12.04.
in case you can't find libv8-dev or libv8-dbg, you can find the correct version by run command
~$ apt-cache search libv8
libv8-3.14-dbg - V8 JavaScript engine - debugging symbols
libv8-3.14-dev - V8 JavaScript engine - development files for 3.14 branch
libv8-3.14.5 - V8 JavaScript engine - runtime library
libv8-dev - V8 JavaScript engine - development files for latest branch
then you can run
~$ sudo apt-get install libv8-3.14-dev libv8-3.14-dbg g++ cpp
then you can try to install v8js via pecl by running
~$ sudo pecl install v8js-0.2.0
if that command return error like this
configure: error: libv8 must be version 3.24.6 or greater
ERROR: `/tmp/pear/temp/v8js/configure --with-v8js' failed
you can try to install v8js-0.1.3 instead by running
~$ sudo pecl install v8js-0.1.3
then edit your php.ini to add v8js extension
~$ echo "extension=v8js.so" >> /etc/php5/cli/php.ini
Open your terminal/console
sudo apt-get install libv8-dev libv8-dbg g++ cpp
Make an update sudo apt-get update
Try sudo pecl install v8js-0.2.0 (or other version i.e.: sudo pecl install v8js-0.1.3)
Edit your php.ini (Check: Where is my php.ini file?) file by adding: extension=v8js.so.
Restart server
If it the extension still doesn't work, try to edit /etc/php5/conf.d/v8js.ini and add extension=v8js.so and restart server again.
Hope this helps.
These other answers work well and I used v8js-0.1.3 for the past 1.5 years but after needing to upgrade to PHP 7 I needed a better solution as v0.1.3 doesn't compile with PHP 7 (something to do with php_smart_str being renamed to php_smart_string).
After a couple hours of frustrating research and compiling libv8 myself, I didn't want to have to go through this whole process on every server I provisioned.
Anyway, I found this site which points you to a launchpad PPA site that provides a couple different ubuntu packages with the 5.1 and 5.2 libv8 libraries.
I ran these commands (please don't add repositories of 3rd party devs without understanding the risks).
sudo apt-add-repository ppa:pinepain/libv8-5.2
sudo apt-get update
sudo apt-get install libv8-5.2-dev
sudo pecl install v8js-1.1.0
(Thanks #JeyKeu for suggesting to add "apt-get update" to these commands)
I couldn't get v8js-1.3.0 or 1.2.0 to build, but 1.1.0 worked well. I checked the changelog and found that the latest updates are not necessary in my circumstance anyway.