how to check installed php54 and its modules enabled in linux

Posted on 2014-12-17
Medium Priority
Last Modified: 2014-12-27
Dear Experts:

Have installed php54 would like to check is the installed php54 is working perfectly,  how to check also installed many modules packages,  earlier in older version if execute php -m I  could see the installed modules but now when execute php -m command not found.

please let me know  
1. how to check also is it required to  set the path for php54 to work on rhel6 , if yes how to set the same please
2. how to check the installed php modules /extensions for example is mbstring loaded

thanks in advance
Question by:D_wathi
  • 6
  • 6
LVL 12

Expert Comment

by:Radek Baranowski
ID: 40504356
You should know where the php54 has been installed, so just add it to the .bashrc or whatever shell's you are using default profile PATH
To do it just for the current session do

EXPORT $PATH=$PATH:<your php54 path>

To check modules, go to php's install dir and use

php -m - as you mentioned, only you need to be either in php's install path or add it to the PATH beforehand.

Author Comment

ID: 40504501
thanks for the reply,  php54 is installed in /opt/rh/php54/root/usr/bin
[root@crm1 bin]# ls -la
total 7892
dr-xr-xr-x  2 root root    4096 Dec 17 06:40 .
drwxr-xr-x 13 root root    4096 Dec 17 06:40 ..
-rwxr-xr-x  1 root root     390 Feb  4  2014 pear
-rwxr-xr-x  1 root root     417 Feb  4  2014 peardev
-rwxr-xr-x  1 root root     305 Feb  4  2014 pecl
lrwxrwxrwx  1 root root       9 Dec 17 06:40 phar -> phar.phar
-rwxr-xr-x  1 root root       0 Dec 17 11:27 phar.phar
-rwxr-xr-x  1 root root 4026848 Oct 23 14:36 php
-rwxr-xr-x  1 root root 4010048 Oct 23 14:36 php-cgi
-rwxr-xr-x  1 root root    4979 Oct 23 14:36 php-config
-rwxr-xr-x  1 root root    4864 Oct 23 14:36 phpize
please suggest will the below work

EXPORT $PATH=$PATH:/opt/rh/php54/root/usr/bin/

if incorrect please suggest correct o
LVL 12

Expert Comment

by:Radek Baranowski
ID: 40504532
it should be ok. just do it, try if php works from any location then.
A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.


Author Comment

ID: 40504553
did set the path as below
export PATH=$PATH:/opt/rh/php54/root/usr/bin/

later when executed php  it stops there,
[root@crm1 ~]# php

below installed packages but php not working please suggest to resolve this
Installed Packages
php54.x86_64                                                                  1.1-5.el6                                                  @rhel-server-rhscl-6-rpms
php54-apc-panel.noarch                                                        3.1.15-0.4.20130912.el6                                    @rhel-server-rhscl-6-rpms
php54-php.x86_64                                                              5.4.16-22.el6                                              @rhel-server-rhscl-6-rpms
php54-php-bcmath.x86_64                                                       5.4.16-22.el6                                              @rhel-server-rhscl-6-rpms
php54-php-cli.x86_64                                                          5.4.16-22.el6                                              @rhel-server-rhscl-6-rpms
php54-php-common.x86_64                                                       5.4.16-22.el6                                              @rhel-server-rhscl-6-rpms
php54-php-dba.x86_64                                                          5.4.16-22.el6                                              @rhel-server-rhscl-6-rpms
php54-php-debuginfo.x86_64                                                    5.4.16-22.el6                                              @rhel-server-rhscl-6-debug-rpms
php54-php-devel.x86_64                                                        5.4.16-22.el6                                              @rhel-server-rhscl-6-rpms
php54-php-enchant.x86_64                                                      5.4.16-22.el6                                              @rhel-server-rhscl-6-rpms
php54-php-fpm.x86_64                                                          5.4.16-22.el6                                              @rhel-server-rhscl-6-rpms
php54-php-gd.x86_64                                                           5.4.16-22.el6                                              @rhel-server-rhscl-6-rpms
php54-php-imap.x86_64                                                         5.4.16-22.el6                                              @rhel-server-rhscl-6-rpms
php54-php-intl.x86_64                                                         5.4.16-22.el6                                              @rhel-server-rhscl-6-rpms
php54-php-ldap.x86_64                                                         5.4.16-22.el6                                              @rhel-server-rhscl-6-rpms
php54-php-mbstring.x86_64                                                     5.4.16-22.el6                                              @rhel-server-rhscl-6-rpms
php54-php-mysqlnd.x86_64                                                      5.4.16-22.el6                                              @rhel-server-rhscl-6-rpms
php54-php-odbc.x86_64                                                         5.4.16-22.el6                                              @rhel-server-rhscl-6-rpms
php54-php-pdo.x86_64                                                          5.4.16-22.el6                                              @rhel-server-rhscl-6-rpms
php54-php-pear.noarch                                                         1:1.9.4-10.el6                                             @rhel-server-rhscl-6-rpms
php54-php-pecl-apc.x86_64                                                     3.1.15-0.4.20130912.el6                                    @rhel-server-rhscl-6-rpms
php54-php-pecl-apc-debuginfo.x86_64                                           3.1.15-0.4.20130912.el6                                    @rhel-server-rhscl-6-debug-rpms
php54-php-pecl-apc-devel.x86_64                                               3.1.15-0.4.20130912.el6                                    @rhel-server-rhscl-6-rpms
php54-php-pecl-memcache.x86_64                                                3.0.8-3.el6                                                @rhel-server-rhscl-6-rpms
php54-php-pecl-memcache-debuginfo.x86_64                                      3.0.8-3.el6                                                @rhel-server-rhscl-6-debug-rpms
php54-php-pecl-zendopcache.x86_64                                             7.0.2-4.el6                                                @rhel-server-rhscl-6-rpms
php54-php-pecl-zendopcache-debuginfo.x86_64                                   7.0.2-4.el6                                                @rhel-server-rhscl-6-debug-rpms
php54-php-pgsql.x86_64                                                        5.4.16-22.el6                                              @rhel-server-rhscl-6-rpms
php54-php-process.x86_64                                                      5.4.16-22.el6                                              @rhel-server-rhscl-6-rpms
php54-php-pspell.x86_64                                                       5.4.16-22.el6                                              @rhel-server-rhscl-6-rpms
php54-php-recode.x86_64                                                       5.4.16-22.el6                                              @rhel-server-rhscl-6-rpms
php54-php-snmp.x86_64                                                         5.4.16-22.el6                                              @rhel-server-rhscl-6-rpms
php54-php-soap.x86_64                                                         5.4.16-22.el6                                              @rhel-server-rhscl-6-rpms
php54-php-tidy.x86_64                                                         5.4.16-22.el6                                              @rhel-server-rhscl-6-rpms
php54-php-xml.x86_64                                                          5.4.16-22.el6                                              @rhel-server-rhscl-6-rpms
php54-php-xmlrpc.x86_64                                                       5.4.16-22.el6                                              @rhel-server-rhscl-6-rpms
php54-runtime.x86_64                                                          1.1-5.el6                                                  @rhel-server-rhscl-6-rpms
LVL 12

Expert Comment

by:Radek Baranowski
ID: 40506523
it's working! response as expected, what you see is a php interpreter.

try to do php -m., you'll see list of php modules installed.

Author Comment

ID: 40506531
Hi sir, thanks for the reply, I was eagerly waiting for your response , below response from sugar support team, can you please suggest

I was able to determine that the web root being used by apache is :


as indicated at:


I created a directory "test" with one script inside "test.php", which has the simple code:


echo "Testing.";

I then set the permissions for the test directory and its contents to 777 and ran chmod to set the owner and group to 'apache'.

I then went to :

and got back the same 'Forbidden' message. I then tried:

which output the raw contents of the test script rather than running the code. Based on this, I then went to:

which also returned the raw contents of that script.

This would indicate that this an issue with apache and it's configuration, not with Sugar, as any requests to directories in the web root return a 'Forbidden' response, while requests to php scripts are returned as flat files, not executed. The serving of php scripts as plain text could also indicate that php isn't installed correctly.
LVL 12

Expert Comment

by:Radek Baranowski
ID: 40506540
it seems you have installed php, but did not configure apache to use it

please follow steps described here:


Author Comment

ID: 40506573
Hi sir, thanks looks near by to resolve, httpd.cof as like the below, not able to locate the

# Dynamic Shared Object (DSO) Support
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Statically compiled modules (those listed by `httpd -l') do not need
# to be loaded here.
# Example:
# LoadModule foo_module modules/mod_foo.so
 LoadModule php5_module   /usr/lib64/httpd/modules/libphp54-php5.so
Include conf.modules.d/*.conf

this is given an error when restart the httpd , can you please suggest how to loadmodule should be ,
LVL 12

Expert Comment

by:Radek Baranowski
ID: 40506580
What is this ?

Include conf.modules.d/*.conf

I guess this causes the error

Author Comment

ID: 40506589
Hi sir, did comment but still the below error
Stopping httpd:                                            [FAILED]
Starting httpd: httpd: Syntax error on line 56 of /opt/rh/httpd24/root/etc/httpd/conf/httpd.conf: Cannot load /usr/lib64/httpd/modules/libphp54-php5.so into server: /usr/lib64/httpd/modules/libphp54-php5.so: undefined symbol: unixd_config

Author Comment

ID: 40506593
LVL 12

Accepted Solution

Radek Baranowski earned 1500 total points
ID: 40506608
it sounds like there's something wrong with php version you installed against apache version you are using.

google search points to wrong version of API being attempted to be used.

unfortunately I can't help you with that, maybe other experts can

Featured Post

Build your data science skills into a career

Are you ready to take your data science career to the next step, or break into data science? With Springboard’s Data Science Career Track, you’ll master data science topics, have personalized career guidance, weekly calls with a data science expert, and a job guarantee.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
I recently worked on a Wordpress site that utilized the popular ContactForm7 (https://contactform7.com/) plug-in that only sends an email and does not save data. The client wanted the data saved to a custom CRM database. This is my solution.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question