I'm new to server and linux and I ran into some problems. I'm trying to update my PHP by looking for linux commands through the net. Some commands ran perfectly but some not.
I tried using this command to install php-gd since I have this error message 'Required GD library is missing'. So, I tried to run this below:
yum install php-gd
However, it give me this error message below:
php56w-common conflicts with php-common-5.3.3-46.el6_6.x86_64
Here are some info on my server:
[root#uat ~]# rpm -ql php
package php is not installed
[root#uat ~]# rpm -qa php\*
php56w-pdo-5.6.11-1.w6.x86_64
php56w-5.6.11-1.w6.x86_64
php56w-cli-5.6.11-1.w6.x86_64
php56w-common-5.6.11-1.w6.x86_64
php56w-mysql-5.6.11-1.w6.x86_64
[root#uat ~]# rpm -Va php\*
S.5....T. c /etc/php.ini
[root#uat ~]# which php
/usr/bin/php
[root#uat ~]# php -v
PHP 5.6.11 (cli) (built: Jul 10 2015 22:43:20)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
Do you know what have I done wrong upgrading my php? Should I remove all php files on my server and reinstall? How?
Solved it by removing all php using "yum remove php php-common"
and modified the filename "remi.repo" under the folder /etc/yum.repos.d like below:
[remi-php56]
name=Remi's PHP 5.6 RPM repository for Enterprise Linux 6 - $basearch
#baseurl=http://rpms.remirepo.net/enterprise/6/php56/$basearch/
mirrorlist=http://rpms.remirepo.net/enterprise/6/php56/mirror
# WARNING: If you enable this repository, you must also enable "remi"
enabled=1
gpgcheck=1
making sure that php56 is enabled=1.
You should run:
yum install php56w-gd
So when install php-extension have error:
*-common conflicts with php-common-5.3.3-46.el6_6.x86_64
Just type *-extension
Example:
yum install php-fpm have error
Error: php56u-common conflicts with php-common-5.3.3-46.el6_7.1.x86_64
then you should run
yum install php56u-fpm
The reason of this error is you install a php version don't match the system repo version. So yum get a version of the system repo, but this don't compatible with the php version you have installed. When you specific the php version, yum get the right version, so happy!
Go to /etc/yum.repos.d.
Remove the extra repository that you can see in your complete error message.
Nima
If you are using Centos 6.7 and have php 5.6 installed, the following command worked for me:
sudo yum install php56w-pecl-xdebug.x86_64 (I was installing xdebug, not GD)
I found this by running yum search php56
Related
I have php 7.4 installed on my macbook pro m1
% php -v
PHP 7.4.15 (cli) (built: Feb 26 2021 09:28:23) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.15, Copyright (c), by Zend Technologies
I'm trying to install the mongodb driver running:
sudo pecl install mongodb
But fails after a while:
mp/pear/temp/mongodb/src/contrib/ -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/temp/mongodb/php_phongo.c -fno-common -DPIC -o .libs/php_phongo.o
In file included from /private/tmp/pear/temp/mongodb/php_phongo.c:29:
In file included from /opt/homebrew/Cellar/php#7.4/7.4.15_1/include/php/ext/spl/spl_iterators.h:24:
/opt/homebrew/Cellar/php#7.4/7.4.15_1/include/php/ext/pcre/php_pcre.h:25:10: fatal error: 'pcre2.h' file not found
#include "pcre2.h"
^~~~~~~~~
1 error generated.
make: *** [php_phongo.lo] Error 1
ERROR: `make' failed
I tried with
arch -x86_64 sudo pecl install mongodb
but results in the same error.
Somebody knows how can I solve this please? Or if I can install the mongodb driver without using pecl. Thanks in advance.
I have finally solved my problem.
I followed these steps from https://github.com/mongodb/mongo-php-driver/issues/1159
After installing a newer PHP version where previously I used 7.3.24 and updated to 7.4.16.
Still had the same issue but diffrent file:
fatal error: 'pcre2.h' file not found #include "pcre2.h"
From this error I tried to check the files in the MacOs Big Sur File system and in the end I found where the pcre2.h is located, and oddly it was being called in the pcre folder, so I manually copied from the pcre2 folder to pcre
The solution that I used:
$cp /opt/homebrew/Cellar/pcre2/10.36/include/pcre2.h /opt/homebrew/Cellar/php\#7.4/7.4.16/include/php/ext/pcre/pcre2.h
Then, I installed mongodb using
$brew install mongodb
After that, I once again tried
$sudo pecl install mongodb
Finally, it worked. However, I'm not sure if this is a good way to solve the problem by manually adding a header file to the directory.
(Sorry I'm still new to the MacOs Environment, just bought a mac mini m1 last week for developing my programming skills)
If you were to install php multiple versions from homebrew make sure you are using the current version as you wanted to. You could check the version by using which php.
To switch from 7.4 to 5.6
$brew unlink php#7.4
$brew link php#5.6 --force
credits: https://www.markhesketh.com/switching-multiple-php-versions-on-macos/
New error
Success Installation:
There is a simpler way to fix the installation issue than symlinking the header file into PHP sources. When running pecl install, you can provide additional compile arguments via the CFLAGS environment variable. So, on the Apple Silicon platform, you can use the following command to get the extension to compile:
CFLAGS=-I/opt/homebrew/include pecl install mongodb
Note that this is only necessary on Apple Silicon, not on x64. It also works for other extensions that fail because of similar errors (e.g. apcu)
I had the same issue with PHP 7.3, I solved it just by running the following commands:
cp /opt/homebrew/Cellar/pcre2/10.38/include/pcre2.h /opt/homebrew/Cellar/php#7.3/7.3.31/include/php/ext/pcre/pcre2.h
Then installed it successfully:
sudo pecl install mongodb
I have finally solved my problem. I used PHP 8.1.7 - Mac Pro 2022 - Apple Silicon (M1)
My errors: fatal error: 'pcre2.h' file not found
The solution that I used:
1. brew install pcre2
2. ln -s /opt/homebrew/Cellar/pcre2/10.40/include/pcre2.h /opt/homebrew/Cellar/php/8.1.7/include/php/ext/pcre/pcre2.h
Please check your path again when use `ln -s`
3. sudo pecl install mongodb
See more: Install pecl pear on MacOs - Link
Success Installation:
Hope it help you :) Thanks
cp /Applications/MAMP/Library/include/pcre2.h /Applications/MAMP/bin/php/php8.0.8/include/php/ext/pcre/pcre2.h
then run
sudo pecl install mongodb
If you use MAMP,
Based on #Kelwin Tantono's answer follow instructions to install mongodb then,
Firstly, check for the location of pcre2.h file by
cd /opt/homebrew/Cellar/pcre2/
In this directory find the folder with ls command, in my case it was 10.40 .
Change 10.40 value in the below code with the result of ls command.
Then, check your php version with moving to php directory at MAMP by
cd /Applications/MAMP/bin/php/
Change php8.0.8 value in the below code with your desired php version.
cp /opt/homebrew/Cellar/pcre2/10.40/include/pcre2.h /Applications/MAMP/bin/php/php8.0.8/include/php/ext/pcre
Now you can install mongodb extension with below command after changing your working directory to
cd /Applications/MAMP/bin/php/php8.0.8/bin
sudo pecl install mongodb
Now, you should add extension=mongodb.so to php.ini file with
echo "extension=mongodb.so" > /Applications/MAMP/bin/php/php8.0.8/conf/php.ini
Do not forget to change php version.
I installed php5 by following way. Installation looks succeeded.
However ubuntu package manager doesn't recognize php5.
How can I solve this issue?
is this caused by the reason which package manager can't recognize php5.6 as php5??
Installation php5 >
https://askubuntu.com/questions/756181/installing-php-5-6-on-xenial-16-04
package url >
https://github.com/dainok/iou-web/blob/master/iou-web_1.2.2-23_all.deb
Error message
$ ▶ sudo dpkg -i iou-web_1.2.2-23_all.deb
Selecting previously unselected package iou-web.
(Reading database ... 201383 files and directories currently installed.)
Preparing to unpack iou-web_1.2.2-23_all.deb ...
Unpacking iou-web (1.2.2-23) ...
dpkg: dependency problems prevent configuration of iou-web:
iou-web depends on php5; however:
Package php5 is not installed.
iou-web depends on php5-pspell; however:
Package php5-pspell is not installed.
iou-web depends on libgv-php5; however:
Package libgv-php5 is not installed.
iou-web depends on php5-sqlite; however:
Package php5-sqlite is not installed.
iou-web depends on php-pear; however:
Package php-pear is not installed.
iou-web depends on php5-gd; however:
Package php5-gd is not installed.
dpkg: error processing package iou-web (--install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
iou-web
PHP version
php -v
PHP 5.6.28-1+deb.sury.org~xenial+1 (cli)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
OS
cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.1 LTS"
NAME="Ubuntu"
VERSION="16.04.1 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.1 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
UBUNTU_CODENAME=xenial
apache phpinfo()
PHP Version 5.6.28-1+deb.sury.org~xenial+1
System Linux penguin-device 4.4.0-47-generic #68-Ubuntu SMP Wed Oct 26 19:39:52 UTC 2016 x86_64
Server API Apache 2.0 Handler
Virtual Directory Support disabled
Configuration File (php.ini) Path /etc/php/5.6/apache2
Loaded Configuration File /etc/php/5.6/apache2/php.ini
Scan this dir for additional .ini files /etc/php/5.6/apache2/conf.d
dpkg -s php5.6
Package: php5.6
Status: install ok installed
Priority: optional
Section: php
Installed-Size: 277
Maintainer: Debian PHP Maintainers <pkg-php-maint#lists.alioth.debian.org>
Architecture: all
Version: 5.6.28-1+deb.sury.org~xenial+1
Provides: php
Depends: libapache2-mod-php5.6 | php5.6-fpm | php5.6-cgi, php5.6-common
Description: server-side, HTML-embedded scripting language (metapackage)
This package is a metapackage that, when installed, guarantees that you
have at least one of the four server-side versions of the PHP interpreter
installed. Removing this package won't remove PHP from your system, however
it may remove other packages that depend on this one.
.
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
open source general-purpose scripting language that is especially suited
for web development and can be embedded into HTML.
Homepage: http://www.php.net/
dpkg -s php5
dpkg-query: package 'php5' is not installed and no information is available
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
locate php5
/etc/apparmor.d/abstractions/php5
locate php
/etc/apparmor.d/abstractions/php5
/lib/modules/4.4.0-25-generic/kernel/drivers/pci/hotplug/acpiphp_ibm.ko
/lib/modules/4.4.0-47-generic/kernel/drivers/pci/hotplug/acpiphp_ibm.ko
/usr/share/app-install/desktop/gphpedit:gphpedit.desktop
/usr/share/app-install/desktop/slbackup-php:slbackup-php.desktop
/usr/share/app-install/icons/gphpedit.png
/usr/share/gtksourceview-3.0/language-specs/php.lang
/usr/share/icons/Humanity/mimes/16/gnome-mime-application-x-php.svg
/usr/share/icons/Humanity/mimes/22/application-x-php.svg
/usr/share/icons/Humanity/mimes/22/gnome-mime-application-x-php.svg
/usr/share/icons/Humanity/mimes/24/application-x-php.svg
/usr/share/icons/Humanity/mimes/24/gnome-mime-application-x-php.svg
/usr/share/icons/Humanity/mimes/48/application-x-php.svg
/usr/share/icons/Humanity/mimes/48/gnome-mime-application-x-php.svg
/usr/share/icons/aery-icons/mimes/48/application-x-php.svg
/usr/share/icons/elementary-xfce/mimes/128/application-x-php.png
/usr/share/icons/elementary-xfce/mimes/16/application-x-php.png
/usr/share/icons/elementary-xfce/mimes/16/gnome-mime-application-x-php.png
/usr/share/icons/elementary-xfce/mimes/22/application-x-php.png
/usr/share/icons/elementary-xfce/mimes/22/gnome-mime-application-x-php.png
/usr/share/icons/elementary-xfce/mimes/24/application-x-php.png
/usr/share/icons/elementary-xfce/mimes/24/gnome-mime-application-x-php.png
/usr/share/icons/elementary-xfce/mimes/32/application-x-php.png
/usr/share/icons/elementary-xfce/mimes/32/gnome-mime-application-x-php.png
/usr/share/icons/elementary-xfce/mimes/48/application-x-php.png
/usr/share/icons/elementary-xfce/mimes/48/gnome-mime-application-x-php.png
/usr/share/icons/elementary-xfce/mimes/64/application-x-php.png
/usr/share/icons/elementary-xfce/mimes/64/gnome-mime-application-x-php.png
/usr/share/icons/gnome/16x16/mimetypes/gnome-mime-application-x-php.png
/usr/share/icons/gnome/22x22/mimetypes/gnome-mime-application-x-php.png
/usr/share/icons/gnome/24x24/mimetypes/gnome-mime-application-x-php.png
/usr/share/icons/gnome/256x256/mimetypes/gnome-mime-application-x-php.png
/usr/share/icons/gnome/32x32/mimetypes/gnome-mime-application-x-php.png
/usr/share/icons/gnome/48x48/mimetypes/gnome-mime-application-x-php.png
/usr/share/lintian/checks/phppear.desc
/usr/share/lintian/checks/phppear.pm
/usr/share/lintian/data/files/php-libraries
/usr/share/mime/application/x-php.xml
/usr/share/nano/php.nanorc
/usr/share/yelp-xsl/js/jquery.syntax.brush.php-script.js
/usr/share/yelp-xsl/js/jquery.syntax.brush.php.js
/var/cache/dictionaries-common/sqspell.php
/var/lib/app-info/icons/ubuntu-xenial-universe/64x64/gphpedit_gphpedit.png
locate php5.6
no output
locate apache2
/etc/apache2
/etc/apache2/conf-available
/etc/apache2/conf-available/javascript-common.conf
/etc/apparmor.d/abstractions/apache2-common
/usr/share/bash-completion/completions/apache2ctl
/usr/share/lintian/checks/apache2.desc
/usr/share/lintian/checks/apache2.pm
pwd
/etc/php
ls
5.6 7.0
I might solve myself.
the issue is PPA issue.
sudo add-apt-repository ppa:ondrej/php
sudo add-apt-repository ppa:ondrej/php5-compat
sudo apt-get update
sudo apt-get install php5
sudo apt-get install -f
php5 is recognized by this. however libgv-php5 is not installed.
but while rebooting and try to install libgv-php5 package.
I could install this and totally solved issue. regarding libgv-php5.
I am not sure what is solution. maybe, reboot is relating to solution.
I am having a problem with PhpStorm (10.0.3) on OS X El Capitan throwing a php-cgi not found error on PHP 7 cgi/fastcgi. I tried the solutions offered in "How do I install php-cgi? I tried MacPort, Package and everything else but none works", but these did not work. I've consulted this: http://blog.jetbrains.com/phpstorm/2013/09/built-in-webserver-in-phpstorm/ but it is not helpful. I also tried a cgi install of PHP 5.6 but this has the same problem as PHP 7.
I have installed PHP70-cgi using macport and verified the install is cgi-fcgi:
$ php-cgi70 -v
PHP 7.0.2 (cgi-fcgi) (built: Jan 19 2016 16:48:28)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
When I try to use php-cgi70 from within PhpStorm it appears to incorrectly default to CLI:
PHP version: 7.0.2
PHP CLI: /opt/local/bin/php-cgi70 PHP CGI: Not Installed (php-cgi sapi is necessary to use built-in web server)
Loaded Configuration File: /opt/local/etc/php70/php.ini
I've also tried the macport install of php-fpm70, but this is not recognized by PhpStorm.
Does anyone have any ideas on resolving this? Thanks in advance.
PhpStorm can't find the PHP CGI binary. Do this on your shell to fix:
cd /opt/local/bin
sudo ln -s php-cgi70 php-cgi
sudo apt-get install php-xdebug
Another way for macOS is to install PHP all together with simple cURL:
curl -s https://php-osx.liip.ch/install.sh | bash -s 7.2
OR install Homebrew and then PHP with CGI (better practice):
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install php72 --with-cgi --with-debug --with-libmysql
And link it in PhpStorm:
Image: PhpStorm: PHP Config
For more info about Homebrew, visit documentation here.
Apache is logging PHP Fatal error: Call to undefined function json_decode(). After some googling, it seems this problem is a result of not having the latest version of php. Oddly, running php --version ouputs
PHP 5.5.1-2+debphp.org~precise+2 (cli) (built: Aug 6 2013 10:49:43)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
with Zend OPcache v7.0.2-dev, Copyright (c) 1999-2013, by Zend Technologies
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans
Clearly showing that my php version is greater than 5.1.
Any ideas as to what could cause this, or the steps to take to find out?
EDIT: The result of a script echoing phpversion is 5.5.1-2+debphp.org~precise
EDIT: The result of phpinfo() is also PHP Version 5.5.1-2+debphp.org~precise+2
Furthermore, in the phpinfo(), it lists the module JSON and the module authors (Omar Kilani, Scott MacVicar).
Using Ubuntu?
Short answer:
sudo apt-get install php7.2-json
(or php7.1-json or php5-json depending on the PHP version you're running)
Then of course make sure you restart Apache:
sudo service apache2 restart
Or if you are using PHP-FPM:
sudo service php7.2-fpm restart
(Or php7.1-fpm or php5-fpm)
Explanation
Debian has removed the previous JSON extension as of PHP 5.5rc2 due to a license conflict.
The JSON license has a clause which states:
The Software shall be used for Good, not Evil.
This causes a problem with Free Software Foundation's definition of free software which states:
The freedom to run the program, for any purpose (freedom 0).
FSF goes on to specifically list the JSON license as nonfree.
Yes it seems a bit silly. Nevertheless Debian has removed the non-compliant JSON extension, and instead offered a replacement extension that is functionally equivalent.
To be clear: PHP itself has NOT removed JSON, it's still in master. This is a distro / package manager issue.
Rasmus makes it pretty clear:
We have not removed json and we will never release a version of php without json support built in. Any changes in 5.5 is due to whatever distro packaging you are using which we have no control over.
More details
http://iteration99.com/2013/php-json-licensing-and-php-5-5/
http://liorkaplan.wordpress.com/2013/06/01/bye-bye-non-free-php-json-extension/
https://bugs.php.net/bug.php?id=63520
http://philsturgeon.co.uk/blog/2013/08/fud-cracker-php-55-never-lost-json-support
With Ubuntu :
sudo apt-get install php5-json
sudo service php5-fpm restart
Solution for LAMP users:
apt-get install php5-json
service apache2 restart
Source
As a RHEL 8 user, this was fixed with:
yum install php-json
And then reloading nginx and php-fpm. So basically the json libraries where missing from the default php install.
This should also work on CENTOS 8.
If you're using phpbrew try to install json extension to fix error with undefined function json_decode():
phpbrew ext install json
The same issue with 7.1
apt-get install php7.1-json
sudo nano /etc/php/7.1/mods-available/json.ini
Add json.so to the new file
Add the appropriate sym link under conf.d
Restart apache2 service (if needed)
I have the same question: PHP Fatal error: Call to undefined function json_decode(), but I run php under cygwin on Windows. When I run php -m, I found that there is no json module installed. So I run cygwin setup.exe again, check json package from the configuration interface, and the problem is solved.
The module was install but symbolic link was not in /etc/php5/cli/conf.d
you might also consider avoiding the core PHP module altogether.
It is quite common to use the guzzle json tools as a library in PHP apps these days. If your app is a composer app, it is trivial to include them as a part of a composer build.
The guzzle tool, as a library, would be a turnkey replacement for the json tool, if you tell PHP to autoinclude the tool.
http://docs.guzzlephp.org/en/stable/search.html?q=json_encode#
http://apigen.juzna.cz/doc/guzzle/guzzle/function-GuzzleHttp.json_decode.html
CENTOS
Scene
I installed PHP in Centos Docker, this is my DockerFile:
FROM centos:7.6.1810
LABEL maintainer="teran.a.joan#gmail.com"
RUN yum install httpd-2.4.6-88.el7.centos -y
RUN rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
RUN rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
RUN yum install php72w -y
ENTRYPOINT ["/usr/sbin/httpd", "-D", "FOREGROUND"]
The app returned the same error with json_decode and json_encode
Resolution
Install PHP Common that has json_encode and json_decode
yum install -y php72w-common-7.2.14-1.w7.x86_64
How to find the resolution?
I have another Docker File what build the container for the API and it has the order to install php-mysql client:
yum install php72w-mysql.x86_64 -y
If i use these image to mount the app, the json_encode and json_decode works!!
Ok..... What dependencies does this have?
[root#c023b46b720c etc]# yum install php72w-mysql.x86_64
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
* base: mirror.gtdinternet.com
* epel: mirror.globo.com
* extras: linorg.usp.br
* updates: mirror.gtdinternet.com
* webtatic: us-east.repo.webtatic.com
Resolving Dependencies
--> Running transaction check
---> Package php72w-mysql.x86_64 0:7.2.14-1.w7 will be installed
--> Processing Dependency: php72w-pdo(x86-64) for package: php72w-mysql-7.2.14-1.w7.x86_64
--> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: php72w-mysql-7.2.14-1.w7.x86_64
--> Processing Dependency: libmysqlclient.so.18()(64bit) for package: php72w-mysql-7.2.14-1.w7.x86_64
--> Running transaction check
---> Package mariadb-libs.x86_64 1:5.5.60-1.el7_5 will be installed
---> Package php72w-pdo.x86_64 0:7.2.14-1.w7 will be installed
--> Processing Dependency: php72w-common(x86-64) = 7.2.14-1.w7 for package: php72w-pdo-7.2.14-1.w7.x86_64
--> Running transaction check
---> Package php72w-common.x86_64 0:7.2.14-1.w7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
========================================================================================================
Package Arch Version Repository Size
========================================================================================================
Installing:
php72w-mysql x86_64 7.2.14-1.w7 webtatic 82 k
Installing for dependencies:
mariadb-libs x86_64 1:5.5.60-1.el7_5 base 758 k
php72w-common x86_64 7.2.14-1.w7 webtatic 1.3 M
php72w-pdo x86_64 7.2.14-1.w7 webtatic 89 k
Transaction Summary
========================================================================================================
Install 1 Package (+3 Dependent packages)
Total download size: 2.2 M
Installed size: 17 M
Is this ok [y/d/N]: y
Downloading packages:
(1/4): mariadb-libs-5.5.60-1.el7_5.x86_64.rpm | 758 kB 00:00:00
(2/4): php72w-mysql-7.2.14-1.w7.x86_64.rpm | 82 kB 00:00:01
(3/4): php72w-pdo-7.2.14-1.w7.x86_64.rpm | 89 kB 00:00:01
(4/4): php72w-common-7.2.14-1.w7.x86_64.rpm | 1.3 MB 00:00:06
--------------------------------------------------------------------------------------------------------
Total 336 kB/s | 2.2 MB 00:00:06
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 1:mariadb-libs-5.5.60-1.el7_5.x86_64 1/4
Installing : php72w-common-7.2.14-1.w7.x86_64 2/4
Installing : php72w-pdo-7.2.14-1.w7.x86_64 3/4
Installing : php72w-mysql-7.2.14-1.w7.x86_64 4/4
Verifying : php72w-common-7.2.14-1.w7.x86_64 1/4
Verifying : 1:mariadb-libs-5.5.60-1.el7_5.x86_64 2/4
Verifying : php72w-pdo-7.2.14-1.w7.x86_64 3/4
Verifying : php72w-mysql-7.2.14-1.w7.x86_64 4/4
Installed:
php72w-mysql.x86_64 0:7.2.14-1.w7
Dependency Installed:
mariadb-libs.x86_64 1:5.5.60-1.el7_5 php72w-common.x86_64 0:7.2.14-1.w7
php72w-pdo.x86_64 0:7.2.14-1.w7
Complete!
Yes! Inside the dependences is the common packages. I Installed it into my other container and it works! After, i put de directive into DockerFile, Git commit!! Git Tag!!!! Git Push!!!! Ready!
cPanel
Go to MultiPHP INI Editor and select the Editor Mode tab, enter the following to enable JSON extensions:
extension=json.so
Or, if you have an existing php.ini file in your root directory, check if this extension is listed and make sure it's not commented out (preceded by semi-colon).
I am using ubuntu 11.04 and when I am opening terminal and typing php -a it is showing some error like this
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/gd.so' - /usr/lib/php5/20090626/gd.so: cannot open shared object file: No such file or directory in Unknown on line 0
I think there is some problem with GD library.Is there any option to solve it?
Yeah. Just try:
sudo apt-get install php5-gd
You probably will have to remove the offending line in your php.ini, either in php.ini or in
/etc/php5/conf.d/gd.ini maybe.
Probably something like
sudo apt-get install php-gd
should do it, if not try
apt-cache search php | grep gd
For me the solution was:
locate --regex /mcrypt[.]so\$ /gd[.]so\$ /suhosin[.]so\$ /pdo_mysql.so\$ /pdo[.]so /mysqli[.]so\$ '/php5/.*/mysql[.]so$'
Which returned the location of all the libraries that my php5 install was having trouble finding:
/usr/lib/php5/20090626+lfs/gd.so
/usr/lib/php5/20090626+lfs/mcrypt.so
/usr/lib/php5/20090626+lfs/mysql.so
/usr/lib/php5/20090626+lfs/mysqli.so
/usr/lib/php5/20090626+lfs/pdo.so
/usr/lib/php5/20090626+lfs/pdo_mysql.so
I was a little worried that these look they might be old versions, but I used their paths anyway. Stefgosselin identified the location of the ini files, /etc/php5/conf.d/. I modified them all. The command below will modify all of the *.ini files there, so make sure all of yours really need modifying. Obviously you need to use the target path you discovered with the locate command in place of mine, /usr/lib/php5/20090626+lfs/:
sudo sed -ri -e "s|^(extension=)(\w{2,10}[.]so)$|\1/usr/lib/php5/20090626+lfs/\2|g" /etc/php5/conf.d/*.ini
Before finding this solution I tried several apt-get purge and apt-get reinstall commands without luck. I'm not sure, but my problem may have originated with installation of zend from source or phpmyadmin with aptitude. It never caused any php errors, just the annoying warning you mentioned. Finally php5 can launch without errors:
php5 --version
gives ...
PHP 5.3.5-1ubuntu7.2 with Suhosin-Patch (cli) (built: May 2 2011 23:18:30) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH
sudo apt install php-gd will work but the thing is it will download the plugin for the latest PHP version.
If your PHP version is not the latest, then you can add version in it:
# PHP 7.1
sudo apt install php7.1-gd
# PHP 7.2:
sudo apt install php7.2-gd
# PHP 7.3
sudo apt install php7.3-gd
# PHP 7.4 (latest)
sudo apt install php-gd