what is php-common and what does it do? - php

I am on centos 6.5 and when I install do yum install php-common it goes ahead and installs some packages, but php is still not installed. And, when I want to install php directly it is says php-common is causing conflict and does install the php module or even php-cli independently.
What is php-common used for?

To answer the question, here's what's in php-common on Redhat Enterprise 6.4 version of the package:
[marc#foo ~]$ rpm -ql php-common
/etc/php.d
/etc/php.d/curl.ini
/etc/php.d/fileinfo.ini
/etc/php.d/json.ini
/etc/php.d/phar.ini
/etc/php.d/zip.ini
/etc/php.ini
/usr/lib64/php
/usr/lib64/php/modules
/usr/lib64/php/modules/curl.so
/usr/lib64/php/modules/fileinfo.so
/usr/lib64/php/modules/json.so
/usr/lib64/php/modules/phar.so
/usr/lib64/php/modules/zip.so
/usr/lib64/php/pear
/usr/share/doc/php-common-5.3.3
/usr/share/doc/php-common-5.3.3/CODING_STANDARDS
/usr/share/doc/php-common-5.3.3/CREDITS
/usr/share/doc/php-common-5.3.3/EXTENSIONS
/usr/share/doc/php-common-5.3.3/INSTALL
/usr/share/doc/php-common-5.3.3/LICENSE
/usr/share/doc/php-common-5.3.3/NEWS
/usr/share/doc/php-common-5.3.3/README.EXTENSIONS
/usr/share/doc/php-common-5.3.3/README.EXT_SKEL
/usr/share/doc/php-common-5.3.3/README.MAILINGLIST_RULES
/usr/share/doc/php-common-5.3.3/README.PARAMETER_PARSING_API
/usr/share/doc/php-common-5.3.3/README.PHP4-TO-PHP5-THIN-CHANGES
/usr/share/doc/php-common-5.3.3/README.REDIST.BINS
/usr/share/doc/php-common-5.3.3/README.RELEASE_PROCESS
/usr/share/doc/php-common-5.3.3/README.SELF-CONTAINED-EXTENSIONS
/usr/share/doc/php-common-5.3.3/README.STREAMS
/usr/share/doc/php-common-5.3.3/README.SUBMITTING_PATCH
/usr/share/doc/php-common-5.3.3/README.SVN-RULES
/usr/share/doc/php-common-5.3.3/README.TESTING
/usr/share/doc/php-common-5.3.3/README.TESTING2
/usr/share/doc/php-common-5.3.3/README.UNIX-BUILD-SYSTEM
/usr/share/doc/php-common-5.3.3/README.WIN32-BUILD-SYSTEM
/usr/share/doc/php-common-5.3.3/README.input_filter
/usr/share/doc/php-common-5.3.3/README.namespaces
/usr/share/doc/php-common-5.3.3/TSRM_LICENSE
/usr/share/doc/php-common-5.3.3/ZEND_CHANGES
/usr/share/doc/php-common-5.3.3/ZEND_LICENSE
/usr/share/doc/php-common-5.3.3/php.ini-development
/usr/share/doc/php-common-5.3.3/php.ini-production
/usr/share/doc/php-common-5.3.3/regex_COPYRIGHT
/usr/share/php
/var/lib/php
As you can see, it basically contains the .so modules for curl, zip, fileinfo, json, and phar, plus license/support files.

What is package php-common and what does it ?
Its is a php package that includes common files for PHP packages, this package contains common utilities shared among all packaged PHP versions. The php-common package contains files used by both the php package and the php-cli package.
Package: php-common
The php-common package provides followings commands to manage PHP modules:
phpenmod – Used to enable modules in PHP
phpdismod – Used to disable modules in PHP
phpquery – Used to view status of modules of PHP
Use phpenmod command followed by module name to enable specific PHP module on your system:
### Syntax
$phpenmod MODULE_NAME
You can also define the PHP version using -v switch to enable specific modules:
### Syntax
$phpenmod -v <PHP VERSION> <MODULE NAME>
You can also disable any un-necessary PHP modules from your system using phpdismod command:
$phpdismod mbstring

Related

extension=php_intl.dll in my linux centos doesn't exists

I have a problem, I just want to uncomment extension=php_intl.dll in my php.ini file
but that extension doesn't exist, I'm using Centos with Nginx configuration.
Linux servers don't use .dll files. You need a .so instead.
To install php_intl on CentOS , you should enable remi repo . Open the terminal and run the following commands:
wget https://rhel7.iuscommunity.org/ius-release.rpm
sudo rpm -Uvh ius-release*.rpm
Update your system then install the php-intl:
sudo yum update
sudo yum --enablerepo=remi install php-intl
To permanently enable remi repo , open the terminal and run the following command:
sudo nano /etc/yum.repos.d/remi.repo
Set enabled=1.
How did you install PHP ?
PHP 5.6.3 is terribly old, and affected by tons of security issues, latest version is 5.6.40 but have reached its end of life a few months ago
If installed from sources, you have to rebuild it, location of php command usually gives useful information (ex, when installed in /usr/local)
which php
or remove this build from sources, and switch to RPM provided binaries.
If installed from a 3rd party repository, you should find the intl extension in the same repository.
see information provided by the yum command
yum info php-cli
While I heartily recommends to upgrade to a supported version (7.1+), if you want to keep 5.6, "remi" is the only repository which still provides this version (with security backports).
To upgrade your installation (to latest 5.6.40 or any other version, 7.0, 7.1, 7.2, 7.3), simply follow the wizard instructions.
With RPM, you never have to change php.ini to enable installed extension, each package provides its own configuration file (ex: /etc/php.d/20-intl.ini) which
enable it.
With proper provider, for any needed extension (ex xxx), a simple
yum install php-xxx
will install the package with this extension (package name may be different, as some packages provide various extensions).

Compiled PHP is missing libphp?

I just compiled PHP 7.3.0 alpha1 from the source, OS X, and then I installed Apache 2.2.4, but my PHP files aren't executed - instead I just see the code written in the file.
Like this:
I looked in httpd.conf, and I wasn't loading libphp7.so, but the module was nowhere to be found in the PHP source folder, I tried using libphp7.so from another PHP installation but phpinfo(); would just show an old PHP version.
How do I get the libphp7.so after compiling PHP from source?
You can get the libphp7.so file when source compiling using apxs2.
You'll need to make sure you have the devel packages for aspx, mysql-devel package for mysql_config, and httpd-devel. For CentOS/RHEL you can just run the following
yum install httpd-devel
yum install libxml2-devel
yum install mysql-devel
For the configure I ran it with mysqlnd but if you want to run it with something else, you can change the with-mysqli/with-pdo-mysql. I also enabled cli but for the .so you'll need aspx2.
./configure --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-cli --with-apxs2
You can also set a prefix when compiling and it should be installed under [PREFIX PATH]/libs/libphp7.so.

ubuntu package manager doesn't recognize php5

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.

centOS 7 Can't install php-mbstring extension

i've tried to install the extension mbstring but i have the following error:
Error: Package: php-mbstring-5.4.16-23.el7_0.3.x86_64 (updates)
Requires: php-common(x86-64) = 5.4.16-23.el7_0.3
Installed: php-common-5.4.38-1.el7.remi.x86_64 (#remi)
php-common(x86-64) = 5.4.38-1.el7.remi
Available: php-common-5.4.16-21.el7.x86_64 (base)
php-common(x86-64) = 5.4.16-21.el7
Available: php-common-5.4.16-23.el7_0.x86_64 (updates)
php-common(x86-64) = 5.4.16-23.el7_0
Available: php-common-5.4.16-23.el7_0.1.x86_64 (updates)
php-common(x86-64) = 5.4.16-23.el7_0.1
Available: php-common-5.4.16-23.el7_0.3.x86_64 (updates)
php-common(x86-64) = 5.4.16-23.el7_0.3
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
What could i do to resolve the problem ?
Thanks for your help
For people who want to know how to solve this :
sudo yum remove php-common
Then you can:
sudo yum install php-mbstring
It will automaticcaly install dependecies (php-common)
This answer from AWS Amazon forum:
yum -y install yum-utils
yum repolist all
yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional
Then you can install php-mbstring, and maybe, I don't know exactly, but maybe it can help for servers on Amazon only.
need to search which mbstring version required you.
cat /etc/redhat-release && php -v && yum search mbstring
========================================================================= N/S matched: mbstring ==========================================================================
ea-php54-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php55-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php56-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php70-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php71-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php72-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
ea-php73-php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
now you can check what you actually need like i am using php7.1 so my command will be
sudo yum install ea-php71-php-mbstring
The selected answer is liable to change the installed PHP version. When not using the stock CentOS PHP, yum will try to install the mbstring extension for the wrong version of PHP.
You can check your installed PHP version with php -v:
$ php -v
PHP 5.5.36 (cli) (built: May 28 2016 12:05:32)
Then go ahead and install the correct mbstring version for your installed PHP version:
$ sudo yum install php55w-mbstring
You must specify the same version as your php-common, mine is php70w-common
sudo yum install php70w-mbstring
Non of above works for godaddy dedicated server centOS 6, apache 2.4, php 5.6
Instead, you should
Install the mbstring PHP Extension with EasyApache
check if you already have it by, putty or ssh
php -m | grep mbstring
[if nothing, means missing mbstring]
Now you need to goto godaddy your account page,
click manager server,
open whm ----- search for apache,
open "easy apache 4"(my case)
Now you need customize currently installed packages,
by
click "customize" button on top line next to "currently installed package..."
search mbstring,
click on/off toggle next to it.
click next, next, .... privision..done.
Now you should have mbstring
by check again at putty(ssh)
php -m | grep mbstring [should see mbstring]
or you can find mbstring at phpinfo() page
Non of above works for godaddy dedicated server centOS 6, apache 2.4, php 5.6
Instead, you should install the mbstring PHP Extension with EasyApache check if you already have it by, putty or ssh
php -m | grep mbstring [if nothing, means missing mbstring]
Now you need to go to godaddy your account page,
1.click manager server,
2.open whm ----- search for apache,
3.open "easy apache 4"(my case)
Now you need customize currently installed packages,by
4.click "customize" button on top line next to "currently installed package..."
5.In the search bar write "mbstring",
6.click on/off toggle next to it.
7.click next, next, .... privision..done.
Now you should have mbstring by check again at putty(ssh)
php -m | grep mbstring [should see mbstring]
or you can find mbstring at phpinfo() page
Thanks, my problem is done
Been searching for the answer for half day, then only realise cPanel / WHM version of CentOS will disable YUM to update php. You shall remove php* from exclude list in /etc/yum.conf.
....
Fedora 28 (Cloud Edition)
sudo yum install php56-php-mbstring
sudo yum install php70-php-mbstring
sudo yum install php71-php-mbstring
sudo yum install php72-php-mbstring
sudo yum install php73-php-mbstring

How to install libapache2-modxslt on Ubuntu 12.04 LTS

I'm attempting to deploy a symphony application on ubuntu 12.04 LTS and am having problems installing libapache2-modxslt. Here is the output from check_configuration.php, as you can see XSL module is not installed.
********************************
* *
* symfony requirements check *
* *
********************************
php.ini used by PHP: /etc/php5/apache2/php.ini
** Mandatory requirements **
OK PHP version is at least 5.2.4 (5.3.10-1ubuntu3.2)
** Optional checks **
OK PDO is installed
OK PDO has some drivers installed: mysql
OK PHP-XML module is installed
[[WARNING]] XSL module is installed: FAILED
*** Install and enable the XSL module (recommended for Propel) ***
OK The token_get_all() function is available
OK The mb_strlen() function is available
OK The iconv() function is available
OK The utf8_decode() is available
OK The posix_isatty() is available
[[WARNING]] A PHP accelerator is installed: FAILED
*** Install a PHP accelerator like APC (highly recommended) ***
[[WARNING]] php.ini has short_open_tag set to off: FAILED
*** Set it to off in php.ini ***
OK php.ini has magic_quotes_gpc set to off
OK php.ini has register_globals set to off
OK php.ini has session.auto_start set to off
OK PHP version is not 5.2.9
I've type the following command in attempt to install libapache2-modxslt and this is what the output is.
mark#ubuntu:/$ sudo apt-get install libapache2-modxslt php5-xsl
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libapache2-modxslt
Please advise.
Debian/Ubuntu packages are named slightly different. It should rather be libapache2-mod-xslt not libapache2-modxslt (note the dash between "mod" and module name). So try
sudo apt-get install libapache2-mod-xslt php5-xsl
BUT, since you need XLS package for PHP only, then simply let the package manager find right dependencies itself (package management is well done and powerful on Debian and derivatives as Ubuntu). So simply do:
sudo apt-get install php5-xsl
and let the things roll. If you are curious, you can always list package dependencies using i.e. apt-cache like this:
sudo apt-cache depends php5-xsl
but if not, and package you are going to install would need something additional, apt will let you know and ask for confirmation to install additional required packages.

Categories