Report this

What is the reason for this report?

The PHP cURL Extension is required for HTTPS...

Posted on January 15, 2020

I have a Ubuntu 18.4 LAMP with a simple site to input leads via a form to WSDL.

I have been using nuSOAP for the data.

On this server, I am stuck in a loop.

If cURL is disabled I have a working site, but this WSDL error…

wsdl error: Getting https://xxxxxxx.xxxxxxxxxxxxxx.xxx/services/dataservice.asmx?WSDL - HTTP ERROR: The PHP cURL Extension is required for HTTPS or NLTM. You will need to re-build or update your PHP to include cURL or change php.ini to load the PHP cURL extension.

With cURL enabled the server gives a 500 error.

Any thoughts on this?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello,

What I could suggest here is:

  • First check if you have the PHP cURL module installed:
php -m | grep -i curl

Another way to check that would be to add a PHP info file in your web root directory with the following content:

<?php

phpinfo();

?>

And access that file via your browser and look for the cURL module.

  • If you don’t see the module installed, then you could install it with the following command:
sudo apt install php-curl

After that restart Apache:

systemctl restart apache2

If you are still getting the 500 error, I would recommend checking your error log for more information. Feel free to share the error here so that I could try to advise you further.

Hope that this helps! Regards, Bobby

The situation you’ve described indicates an issue with the cURL extension on your Ubuntu server, especially in relation to using it with nuSOAP for a WSDL service. Here’s a detailed step-by-step approach to troubleshoot and possibly resolve this issue:

Step 1: Confirm cURL Installation

First, ensure that cURL is properly installed on your server. You can do this by checking its presence and status in PHP.

  1. Check if cURL is installed: Open your terminal and run:
php -m | grep curl

This command lists the PHP modules and filters the output for “curl”. If it prints “curl”, then the cURL module is installed.

  1. Check PHP Info: Alternatively, you can create a PHP file to output the phpinfo() results and check if cURL is listed under the modules.

Create a file, say info.php, in your web server’s root directory:

<?php
phpinfo();
?>

Access this file via a browser. This will show all the PHP configuration details. Look for the cURL section to confirm it’s installed and configured.

Step 2: Enable cURL in PHP

If cURL is installed but not enabled:

  1. Locate the php.ini file: The location of php.ini depends on your PHP installation. Common paths are /etc/php/7.x/apache2/php.ini or /etc/php/7.x/cli/php.ini where 7.x is your PHP version. You can find it by checking phpinfo() output under “Loaded Configuration File”.

  2. Enable cURL extension: Open php.ini in a text editor (you may need superuser permissions):

sudo nano /etc/php/7.x/apache2/php.ini

Uncomment the line (remove the semicolon at the start):

;extension=curl

Save and close the file.

  1. Restart Apache to apply changes:
sudo systemctl restart apache2

Step 3: Check for Errors After Enabling cURL

Since enabling cURL leads to a 500 error, it’s important to identify the source of this error.

  1. Check Apache Error Logs: Look at the Apache error logs to see the detailed error messages:
sudo tail -f /var/log/apache2/error.log
  1. This might provide a clue as to what exactly is causing the 500 error when cURL is enabled.

  2. Debugging PHP code:

    • Ensure that the nuSOAP calls are correctly configured.
    • If possible, isolate the code causing the issue. Simplify your WSDL calls to see if a specific part of the request (like headers or SOAP options) is causing the problem.

Step 4: Additional Considerations

  • PHP and Apache Version Compatibility: Ensure that your PHP version is compatible with your Apache version. Sometimes, specific modules or PHP versions have bugs or issues with certain Apache versions.

  • Dependencies and PHP Extensions: Check if there are other PHP extensions that are required by your application or nuSOAP that may not be installed or enabled.

  • Operating System Updates: Ensure your operating system and all packages are up to date:

sudo apt update && sudo apt upgrade
  • Security Settings or Firewall: Verify that there aren’t any security modules (like SELinux or AppArmor) or firewall settings that could be blocking the outgoing SOAP requests when cURL is enabled.

By following these steps, you should be able to identify and resolve the issues related to cURL and your WSDL service on your Ubuntu LAMP server. If the problem persists, consider reaching out for further help with detailed error logs and configuration details.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.