I am integrating a payment gateway using SOAP. When i am calling service function using Wamp its working well. But on my live server it is giving folloing error- Class 'SoapClient' not found
the code i am using is
<?php
try
{
$soap_client=new SoapClient("WebServiceLink/service.asmx?WSDL");
$quote=$soap_client->PGI_TRANS("PassedParameter");
echo $quote->PGI_TRANSResult;
}
catch(SoapFault $exception)
{
echo $exception->getmessage();
}
?>
enable your soap extension in php.
open php.ini find the line have "php_soap" and uncomment this line,
restart web server, problem solved.
You shouldn't have to modify php.ini to enable soap on modern distributions. If it's not enabled, the package probably isn't installed. Once you install the correct package, your distro should enable the correct php.ini settings for you.
On Ubuntu:
sudo apt-get install php-soap
will install and enable the soap extensions for you.
You have to inherit nusoap.php class and put it in your project directory, you can download it from the Internet.
Download Link: http://sourceforge.net/projects/nusoap/
Use this code:
require_once('nusoap.php');
For Ubuntu17.10 Artful I've used the following command to view exact package name (it can be different).
>> apt-cache search php | grep -i soap
libnusoap-php - SOAP toolkit for PHP
php7.1-soap - SOAP module for PHP
python-pysimplesoap - simple and lightweight SOAP Library (Python 2)
python3-pysimplesoap - simple and lightweight SOAP Library (Python 3)
php-soap - SOAP module for PHP [default]
php5.6-soap - SOAP module for PHP
php7.0-soap - SOAP module for PHP
php7.2-soap - SOAP module for PHP
That's how I get the name. Then just install it.
sudo apt-get install php5.6-soap
P.S. Don't forget to update repository sudo apt-get install php-soap
For Ubuntu, running the following commands fixed my issue,
sudo apt-get install php-soap
then run
sudo service apache2 restart
Related
I added Paypal Express checkout plugin to my website.
I get this error:
2019-07-23T15:45:32+00:00 CRITICAL Uncaught Error: Call to undefined
function PayPal\Core\curl_version() in
/var/www/html/wp-content/plugins/woo-paypal-express-checkout/includes/php-library/paypal-rest/lib/PayPal/Core/PayPalHttpConfig.php:65
and this is the line
$curl = curl_version();
What can I do to resolve this probleme
I tried to install php-curl but I always got the same result
I used
sudo apt-get install php5-curl
sudo service apache2 restart
It sounds like you are missing the PHP CURL extension. This is usually bundled as a separate package. If you are using Ubuntu, apt-get install php-curl (or php7.2-curl) will install the missing dependency. You may need to enable the module after installing it using phpenmod curl. If you are using another Linux distribution, please consult the appropriate distribution documentation for installing PHP modules.
First, check your active PHP version, maybe there are multiple PHP versions installed on the server. In that case, you have to look for an active PHP version running on the server. Use phpinfo(); to check PHP version. Then run the command as per your PHP version. In my case, it was PHP 7.3.
$ sudo apt-get install php7.3-curl
$ sudo service apache2 restart
I have a problem when i consume a Weservice SOAP with php from my instance in AWS (Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-1022-aws x86_64)). When I consume this service (http://fakeurl:fakeport/DynamicsNAV/WS/Company/Codeunit?wsdl) in my localhost, it work! but in production (AWS) not work and show this error:
SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://fakeurl:fakeport/DynamicsNAV/WS/Company/Codeunit?wsdl' : failed to load external entity "http://fakeurl:fakeport/DynamicsNAV/WS/Company/Codeunit?wsdl"
Is there anything I can do?
Any settings I can make?
I already installed php-soap and I already configured the php.ini but not work. In DigitalOcean it work.
I've had a similar problem and worked out it was SELinux that was blocking the call - you could try disabling that first as a try...
I installed this components in Ubuntu:
sudo apt-get install -y tmux curl wget php7.0-curl php7.0-gd php7.0-intl
After that I rebooted the server.
I have installed curl in ubuntu server using this command
sudo apt-get install curl php5-cli git
it's succeeded now i am trying to enable this extension in php on linux platform.so i commented out the extension=php_curl.dll line in php.ini .But it giving this error
PHP Warning: PHP Startup: Unable to load dynamic library
'/usr/lib/php/20131226/curl.so' - /usr/lib/php/20131226/php_curl.dll:
cannot open shared object file: No such file or directory in Unknown
on line 0
i got this error while confirming the whether curl is enabled in php with this command
php -i | grep curl
please help with me how to enable curl extension in php on linux platform
You've installed Curl, and you've installed PHP, but I think you are missing the PHP-Curl integration libraries.
sudo apt-get install php5-curl
This is available from the main repository in 14.04 - http://packages.ubuntu.com/trusty/php5-curl
However from 16.04 onwards only PHP7 is included by default, so you'll probably have to use a 3rd-party PPA.
I'm using XAMPP Server 1.7.7
While opening the php file, i receive the error
Fatal error: Class 'XSLTProcessor' not found
Install the XSL extension to get that class. This might be as easy as uncommenting (remove the starting ';') on the line that reads extension=php_xsl.dll in php.ini on Windows, or apt-get install php5-xsl on most Linux-based systems. For custom builds of PHP, use configure option --with-xsl (requires package libxslt1-dev).
Its necessary install the XLS extension.
My solution by my context.
I'm using one docker container contain ubuntu base and using php-fpm (ie if you simply already use linux ubuntu in the same).
The steps to install this extension in my context were:
First search xsl extension on linux repository
sudo apt-cache search xsl
I ended up finding the php5-xsl, so it was only install
sudo apt-get install php5-xsl
that the installation process the setup configuration is already added, if does not happen, just make yourself
sudo vim /etc/php5/mods-available/xsl.ini
insert this content:
extension=xsl.so
(obviously the paths are according to your php configuration settings, but my example is the default configuration)
Restart you php fpm and done (sudo service php5-fpm restart)!
I'm trying to connect to my LDAP server via PHP, but I get the following error:
Fatal error: Call to undefined function ldap_connect()
Any help would be very appreciated.
Thanks in advance,
roshan
Make sure the LDAP extension is installed and enabled. This answer assumes you have PHP5, however, things should work similarly for PHP7 as well.
Install LDAP Extension
There should be a package named like php5-ldap:
aptitude show php5-ldap
Paquet : php5-ldap
...
Description : LDAP module for php5
This package provides a module for LDAP functions in PHP scripts.
Thus, the package can usually be installed like:
sudo apt-get install php5-ldap
If you do not use apt-get, use the equivalent command for the package manager you use.
Enable LDAP Extension
To enable the package after installation, you can use this command:
sudo php5enmod ldap
If you get any error message from the above command, it means something went wrong.
Note: After enabling the package, you usually have to restart / reload services so that the newly enabled module is recognized. For apache, you can do this by:
sudo service apache2 restart
If you do not use apache, please use the equivalent command for your server.
sudo apt-get install php5-ldap
And don't afraid to google.