I have installed Ubuntu 14.04 LTS and LAMP server. By default the installed version of php had been 5.5, so I had to upgrade to 5.6 according to the manuals on the web .
After the upgrade the GD extension is not working well.
I tried:
sudo apt-get remove -purge php5-gd - to remove and purge the installed extension.
sudo apt-get install php5-gd - to install again.
Then I test the installation and this is the output:
sudo apt-get install php5-gd
Reading package lists... Done
Building dependency tree
Reading state information... Done
php5-gd is already the newest version.
Unfortunately I don't see the GD extension in phpinfo page and the test script from the application which I am trying to run also gives me error about GD2.
I have tried almost every suggestion that I found in Google, but find no joy. You are my last hope now. Thank you.
Related
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 recently downgraded one of my laptop from 14.04 to 12.04. Reason for downgrading operating system is speed only. 12.04 seems 10x time faster then my experience with 14.04 on my low configuration laptop. As usual I install LAMP stack using tasksel command:
$ sudo apt-get install tasksel
$ sudo apt-get update
$ sudo tasksel install lamp-server
However, this installed PHP version 5.3.10. I google to update php version and followed many suggestions including sudo apt-get update, sudo apt-get dist-upgrade and also installing latest PPA as well.
Also fllowed this answer: Php upgrade from 5.3 to php 5.6 on Ubuntu 12.04
Nothing worked so far and I am here for seeking some help.
I have installed MongoDB PHP driver on Ubuntu 14.04 using this command
sudo apt-get install php5-mongo
and it installed the driver but an older version which is 1.4, the problem is I need latest one, which is 1.6. I already tried this command.
sudo apt-get install php5-mongodb
but getting error no package found. Can someone help installing latest mongodb php driver on ubuntu 14.04
I followed this link as well and installed pecl extension but nothing worked http://zacvineyard.com/blog/2013/02/the-easy-way-to-install-the-mongodb-php-driver-on-ubuntu-1204
Thanks.
Try using:
sudo apt-get install php5-dev php5-cli php-pear -y
sudo pecl install mongo
As shown here: http://blog.programster.org/debian-8-install-mongodb-php-driver/ (I've tested on ubuntu 14 and it worked)
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.