SOAP in PHP (Ubuntu 16) - AWS. Not work - php

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.

Related

I get a undefined curl_version() function in php

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

Class 'SimpleXMLElement' not found on puphpet PHP 5.6

I've been stuck at this error for hours now and I can't seem to find anything useful on the internet about it. The error is the classic
Fatal error: Class 'SimpleXMLElement' not found in
/var/www/NavPHP/nav/plugin/log/NavLog.php on line 29
I'm not using Namespace so that's not the problem.
It's a project that works fine in production and used to work in my former computer with WampServer and PHP 5.6.2. Now that I got a new computer, I'm interested in setting up a virtual environment with puphpet, but I'm getting this error.
According to Docs, the SimpleXMLElement class should come with PHP by default. I didn't find any important information on php.ini and in my phpinfo() there's the following:
SimpleXML Sterling Hughes, Marcus Boerger, Rob Richards
Any tips?
Thanks
Update
Just to add this
The problem was that I was using Cent OS and in this Linux Distribution, the php-libxml package does not come as default.
I ended up generating a new machine through PuPHPet GUI and added to the System Package the following packages to be installed:
php-xml, php-simplexml
Problem solved.
For those using PHP 7 and Ubuntu, #MPS solved it by running apt-get install php7.0-xml and service apache2 restart.
On Centos, we need to install the XML php package. You can try yum install php56w-xml or yum install php70w-xml if you're using php70w repository for PHP 7.0
I faced this issued and finally solved by run following command :
apt install php5.6-xml
After it reload and restart apache2 service :
service apache2 reload
service apache2 restart
And a PHP restart may be required
systemctl restart php-fpm
If you are running ubuntu in AWS Cloud 9. Then from your menu bar->Window->New Terminal->type sudo apt install php-xml

how to install lamp/xampp server on beaglebone black

i am unable to install lamp or xampp server on my BBB.when i typed
sudo apt-get install apache2
it says "sudo :command not found"
opkg install php php-cgi php-cli
opkg install lighttpd lighttpd-module-fastcgi
opkg install mysql5
also the above commands do not work.The error says "unknown package ..."
Basically i am trying to develop a webserver which over the internet can be accessed to control hardware interfaced to BBB.
is there any way to solve this problem.I am using only usb connection to connect BBB using putty.
If you are using an Angstrom Distribution apache may not work. It freezes in between installation. Try upgrading to Ubuntu or Debian. Previous versions of BBB had very low memory (2GB) of which 1.5GB was taken by the OS. So try expanding it using a micro-SD card.
And it is a good practice to always update and upgrade your OS before installing any software.
sudo apt-get update && apt-get upgrade

Error on requireing CURL PHP extension with integrating Google OAuth with PHP on Ubuntu

I am developing an application that requires integration with Google APIs Client Library for PHP. I am running on LAMP stack on Ubuntu. I have the application up and running on my local host. When I integrate the code from Google API PHP client I get the following error:
PHP Fatal error: Uncaught exception 'Exception' with message 'Google CurlIO client requires the CURL PHP extension
I am unable to find help in any other forum. Can someone please point me to a solution to this. I suspect this could be somehow related to me developing and running the application in my local folder instead of var/www. I have added a file called mysite and pointing Apache to run from a local folder though.
CURL PHP extension is not installed on your PHP module of Apache server. You have to install it using terminal
Open Terminal (CTRL + ALT + T) and do the following command :
sudo apt-get install php5-curl
php5-curl will be automatically downloaded and installed. After Installation, Reload Apache2 Server :
sudo service apache2 reload
Just for clarification if you are using PHP7/Any PHP version you can simply execute
sudo apt-get install php-curl
this will download the appropriate extensions for your installed PHP,
In My case it downloaded php7.2 curl

Class 'SoapClient' not found

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

Categories