• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 503
  • Last Modified:

how to check installed php54 and its modules enabled in linux

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
D_wathi
Asked:
D_wathi
  • 6
  • 6
1 Solution
 
Radek BaranowskiFull-stack Java DeveloperCommented:
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
 
D_wathiAuthor Commented:
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
 
Radek BaranowskiFull-stack Java DeveloperCommented:
it should be ok. just do it, try if php works from any location then.
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
D_wathiAuthor Commented:
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
 
Radek BaranowskiFull-stack Java DeveloperCommented:
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
 
D_wathiAuthor Commented:
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
 
Radek BaranowskiFull-stack Java DeveloperCommented:
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
 
D_wathiAuthor Commented:
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
 
Radek BaranowskiFull-stack Java DeveloperCommented:
What is this ?

Include conf.modules.d/*.conf

I guess this causes the error
0
 
D_wathiAuthor Commented:
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
 
D_wathiAuthor Commented:
0
 
Radek BaranowskiFull-stack Java DeveloperCommented:
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
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

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 6
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now