Solved

how to check installed php54 and its modules enabled in linux

Posted on 2014-12-17
12
307 Views
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
0
Comment
Question by:D_wathi
  • 6
  • 6
12 Comments
 
LVL 11

Expert Comment

by:Radek Baranowski
Comment Utility
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.
0
 

Author Comment

by:D_wathi
Comment Utility
thanks for the reply,  php54 is installed in /opt/rh/php54/root/usr/bin
pwd
/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
0
 
LVL 11

Expert Comment

by:Radek Baranowski
Comment Utility
it should be ok. just do it, try if php works from any location then.
0
 

Author Comment

by:D_wathi
Comment Utility
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
php54-scldevel.x86_64
0
 
LVL 11

Expert Comment

by:Radek Baranowski
Comment Utility
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.
0
 

Author Comment

by:D_wathi
Comment Utility
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 :

/opt/rh/httpd24/root/var/www/html/

as indicated at:

/opt/rh/httpd24/root/etc/httpd/conf/httpd.conf

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

<?php

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 :

http://182.72.97.91/test/

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

http://182.72.97.91/test/test.php

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

http://182.72.97.91/sugarcrm/install.php

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.
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 11

Expert Comment

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

please follow steps described here:

http://php.net/manual/en/install.unix.apache2.php
0
 

Author Comment

by:D_wathi
Comment Utility
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 ,
0
 
LVL 11

Expert Comment

by:Radek Baranowski
Comment Utility
What is this ?

Include conf.modules.d/*.conf

I guess this causes the error
0
 

Author Comment

by:D_wathi
Comment Utility
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
                                                           [FAILED]
0
 

Author Comment

by:D_wathi
Comment Utility
0
 
LVL 11

Accepted Solution

by:
Radek Baranowski earned 500 total points
Comment Utility
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
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This article discusses four methods for overlaying images in a container on a web page
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now