Jump to content

PHP 7.2.34 enable PHP extension soap


nitiphone2021
 Share

Recommended Posts

[root@host ~]# cat /etc/*-release
CentOS Linux release 7.9.2009 (Core)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

CentOS Linux release 7.9.2009 (Core)
CentOS Linux release 7.9.2009 (Core)
[root@host ~]# ^C
[root@host ~]# sudo apt-get install php-soap
sudo: apt-get: command not found
[root@host ~]# sudo yum install php-soap
Loaded plugins: fastestmirror, langpacks, universal-hooks
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                                                                                   | 5.1 kB  00:00:00
epel-debuginfo/x86_64/metalink                                                                                         | 4.6 kB  00:00:00
epel-source/x86_64/metalink                                                                                            | 5.1 kB  00:00:00
 * EA4: 203.174.85.202
 * cpanel-addons-production-feed: 203.174.85.202
 * cpanel-plugins: 203.174.85.202
 * base: mirrors.thzhost.com
 * epel: mirrors.thzhost.com
 * epel-debuginfo: mirrors.bestthaihost.com
 * epel-source: mirrors.thzhost.com
 * extras: mirror2.totbb.net
 * updates: mirror2.totbb.net
EA4                                                                                                                    | 2.9 kB  00:00:00
cpanel-addons-production-feed                                                                                          | 2.9 kB  00:00:00
cpanel-plugins                                                                                                         | 2.9 kB  00:00:00
base                                                                                                                   | 3.6 kB  00:00:00
epel                                                                                                                   | 4.7 kB  00:00:00
epel-debuginfo                                                                                                         | 3.0 kB  00:00:00
epel-source                                                                                                            | 3.5 kB  00:00:00
extras                                                                                                                 | 2.9 kB  00:00:00
imunify360                                                                                                             | 2.7 kB  00:00:00
imunify360-rollout-1                                                                                                   | 3.0 kB  00:00:00
imunify360-rollout-2                                                                                                   | 3.0 kB  00:00:00
imunify360-rollout-3                                                                                                   | 3.0 kB  00:00:00
imunify360-rollout-4                                                                                                   | 3.0 kB  00:00:00
mysql-connectors-community                                                                                             | 2.6 kB  00:00:00
mysql-tools-community                                                                                                  | 2.6 kB  00:00:00
mysql57-community                                                                                                      | 2.6 kB  00:00:00
updates                                                                                                                | 2.9 kB  00:00:00
wp-toolkit-cpanel                                                                                                      | 2.9 kB  00:00:00
wp-toolkit-thirdparties                                                                                                | 2.9 kB  00:00:00
(1/5): epel/x86_64/updateinfo                                                                                          | 1.0 MB  00:00:00
(2/5): epel-debuginfo/x86_64/primary_db                                                                                | 890 kB  00:00:00
(3/5): epel-source/x86_64/updateinfo                                                                                   | 1.0 MB  00:00:00
(4/5): epel/x86_64/primary_db                                                                                          | 6.9 MB  00:00:00
(5/5): epel-source/x86_64/primary_db                                                                                   | 2.5 MB  00:00:00
No package php-soap available.
Error: Nothing to do
[root@host ~]# ^C
[root@host ~]#

 

Link to comment
Share on other sites

php-soap is the correct name for the official package, however CentOS 7 is a very old version and only supports PHP 5.4. Which means you probably installed another source in order to get a more recent version of PHP.

Try a yum search for anything soap and see if the package you need goes by a different name.

Link to comment
Share on other sites

[root@host ~]# yum search php | grep -i soap
alt-php-internal-soap.x86_64 : A module for PHP applications that use the SOAP
alt-php71-soap.x86_64 : A module for PHP applications that use the SOAP protocol
alt-php73-soap.x86_64 : A module for PHP applications that use the SOAP protocol
alt-php74-imunify-soap.x86_64 : A module for PHP applications that use the SOAP
alt-php74-soap.x86_64 : A module for PHP applications that use the SOAP protocol
cpanel-php73-SOAP.noarch : PEAR: SOAP Client/Server for PHP
ea-php54-php-soap.x86_64 : A module for PHP applications that use the SOAP
ea-php55-php-soap.x86_64 : A module for PHP applications that use the SOAP
ea-php56-php-soap.x86_64 : A module for PHP applications that use the SOAP
ea-php70-php-soap.x86_64 : A module for PHP applications that use the SOAP
ea-php71-php-soap.x86_64 : A module for PHP applications that use the SOAP
ea-php72-php-soap.x86_64 : A module for PHP applications that use the SOAP
ea-php73-php-soap.x86_64 : A module for PHP applications that use the SOAP
ea-php74-php-soap.x86_64 : A module for PHP applications that use the SOAP
ea-php80-php-soap.x86_64 : A module for PHP applications that use the SOAP
[root@host ~]#

This one is my PHP coding for sending SOAP. 

Any library or file for using soap without installing?

<?php
$operator = "http://ltcservice.laotel.com:5577/Services.asmx?WSDL";
$privateKey = "B**************p";
$headerSMS = "TEST"; // TEST
$userid = "BDX";
$txtTel ="2********6";
$newRegCode_exp = rand();
$messageBody = "Test SMS";
//$serverIP = $_SERVER['REMOTE_ADDR'];
$serverIP = "172.28.17.61";
$trans_id = "BDX".rand();
//$trans_id = "123456";
$data = $serverIP.$trans_id;
$messageBody = $serverIP.$trans_id;
echo '<br/>'.$data. " >=> " . exec("java -jar encrypt.jar ".$data." ".$privateKey, $key);
echo '<br/>'.$key[1]. " >=> " . exec("java -jar decrypt.jar ".$key[1]." ".$privateKey, $output);
echo '<br/> encrypt result >=> '.$key[0];
if($key[0]=="OK"){
$header = array('userid' => $userid,
'trans_id' => $trans_id,
'key' => $key[1],
);
echo '<br/>';
//print_r($header);
$client = new SoapClient($operator);
$msg = array(
'msisdn' => $txtTel,
'message' => $messageBody,
'headerSMS' => $headerSMS,
'header' => $header,
);
$requestmsg = array('msg'=>$msg);
echo '<br/>';
print_r($msg);
$data = $client->SendSMS($requestmsg);
echo '<br/>';
print_r($data);
}
?>

 

Link to comment
Share on other sites

18 minutes ago, nitiphone2021 said:

Any library or file for using soap without installing?

You could spend your time looking for a library that "reinvents the wheel", as they say. Or you could install the SOAP extension and get on with the rest of your life.

One of those packages should correspond to the particular version of PHP you have installed.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.