Seiden Group
Modern Development & Open Source for IBM i
  • Link to LinkedIn
  • Link to Mail
  • Home
  • Seiden PHP+
    • Seiden PHP+
    • Install & Learn
    • SmartSupport
    • PHP Migrations & Upgrades
    • Success Stories
    • Free PHP Assessment
    • Documentation
    • What’s New (Changelog)
  • IBM i Services
    • Development
    • Training & Mentoring
    • Open Source Setup & Upgrades
    • SSL/TLS Install & Learn
    • Performance
  • Support
    • Open Source & PHP
    • VS Code for i
    • Developer Support
    • Support Success Stories
  • VS Code for i
    • Support
    • Training
    • Code for i Resource Guide
    • Getting Started Videos
    • Code for IBM i Fridays
  • Free Stuff
    • IBM i Strategy & Tips
    • PHP Upgrade Assessment
    • CNX Valence Assessment
    • VS Code for IBM i Resources
    • Code for IBM i Fridays
    • QCachegrind Download
    • PHP Toolkit for IBM i Resources
    • Qshell on i Library
  • Blog
  • About
    • About Our Team
    • About Alan Seiden
    • Speakers & Sessions
    • In the News
  • Contact
  • 201.447.2437
  • Search
  • Menu Menu

Seiden Group Blog

Solving “curl#6 – getaddrinfo() thread failed to start”

July 8, 2021/4 Comments/in IBM i, Open Source /by Calvin Buckley

Curl-logoIf you download files onto your system using PHP, Yum, RPM, or other tools, there’s a good chance curl is involved.

The version of curl provided in IBM i PASE uses multiple threads to speed up common tasks such as DNS lookups. When threading support is not available, however, curl fails.

If threads are not enabled when you use curl, you’ll get messages like:

curl#6 - "getaddrinfo() thread failed to start"

Here is how to allow multithreading in your job, depending on the shell environment you are using:

  • QSH: set the environment variable QIBM_MULTI_THREADED to Y before starting any program that runs curl. This can be done at whatever scope you feel is appropriate. Example: before invoking QSH, call the CL command:
    • ADDENVVAR ENVVAR(QIBM_MULTI_THREADED) VALUE(Y) REPLACE(*YES).
    • Here is a complete example of a CL program calling PHP from QSH with multithreading.
  • SSH or QP2TERM: threads are enabled by default.
  • QP2SHELL: threads not normally supported. Options:
    • Use QSH, then see the QSH section above.
    • If using SBMJOB, start the job with the ALWMLTTHD parameter set to *YES.

After you do this, curl will work correctly.

This post was based on the curl documentation for IBM i-specific notes.

Tags: curl, IBMi, IBMiOSS, PHP, QP2SHELL, QSH, RPM, threads, Yum
Share this entry
  • Share on Facebook
  • Share on X
  • Share on Pinterest
  • Share on LinkedIn
  • Share on Tumblr
  • Share on Reddit
  • Share by Mail
https://www.seidengroup.com/wp-content/uploads/2017/03/SeidenLogo-180.png 0 0 Calvin Buckley https://www.seidengroup.com/wp-content/uploads/2017/03/SeidenLogo-180.png Calvin Buckley2021-07-08 10:47:352025-01-30 14:49:55Solving “curl#6 – getaddrinfo() thread failed to start”
Calvin Buckley

About Calvin Buckley

Recognized as an IBM Champion and a 2020 Fresh Face of IBM i, Calvin exhibits remarkable talent for expanding the use of IBM i through open ...Read More

4 replies
  1. Giles Sadler
    Giles Sadler says:
    July 25, 2025 at 11:51 am

    PS also make sure there is a /etc/resolv.conf with a nameserver entry (I also turn off ipv6) eg:

    nameserver 8.8.8.8
    options inet6 off
    options attempts:2 timeout:1

    Reply
    • Alan Seiden
      Alan Seiden says:
      August 11, 2025 at 2:43 pm

      Some details and use cases here: https://www.seidengroup.com/php-documentation/enabling-advanced-dns-functions-in-php/

      Reply
  2. Giles Sadler
    Giles Sadler says:
    September 23, 2022 at 3:02 am

    Something seems to have changed either in PHP cURL or the way that PHP decides if IPV6 is active. I have had to explicitly tell wordpress not to use IPV6 or cURL stops resolving domain names and the sites all grind to a halt. I am on OS/400 7.2 and PHP 8.1.10.

    Reply
    • Alan Seiden
      Alan Seiden says:
      January 30, 2025 at 2:46 pm

      Yes, depending on the configuration of the system (we believe it’s the IBM i TCP/IP configuration), you may need to specify –ipv4 as in curl –ipv4 https://example.com.

      Reply

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

SUBSCRIBE
Open Thinking
Monthly IBM i Strategy & Tips
  • This field is for validation purposes and should be left unchanged.

IBM i Development

  • RPG, COBOL, SQL, Node,
    PHP, Python, Valance, etc.
  • Modernization. Integration.
  • Web and API Solutions
  • Legacy Maintenance
    ...
LET'S GET IT DONE!

Recent Posts

  • Do You Need IBM i Observability?
  • PHP 8.6 is Coming Soon to IBM i
  • Safer npm installation is on the way for Node.js (and all JavaScript)
  • Access Modern Security for IBM i and Connected Web Environments
  • IBM i: A Natural Platform for Agentic AI
  • PHP on IBM i in 2026: The Modernization Engine
  • Your “AS/400” Is a Modern IBM i Platform
  • MCP + AI for IBM i Teams (with a MongoDB example)
  • GnuPG PHP Extension for IBM i: Now Included with Seiden Support
  • Getting Started with Code for IBM i: A Lunch & Learn Video

SEIDEN GROUP: Modern Development & Open Source for IBM i

Home   |   Seiden PHP+   |   IBM i Services  |   Support   |   VS Code for i   |   Free Stuff   |   Blog  |   Privacy Policy  |   Contact         201.447.2437

© 2026 Seiden Group, LLC
  • Link to LinkedIn
  • Link to Mail
Link to: Visual Studio Code, RPG and Code Coverage Link to: Visual Studio Code, RPG and Code Coverage Visual Studio Code, RPG and Code Coverage Link to: VS Code for IBM i — Tips and Extras Link to: VS Code for IBM i — Tips and Extras VS Code for IBM i — Tips and Extras
Scroll to top Scroll to top Scroll to top