[solved]Litespeed Curl in PHP Unable to resolve host name - CLI / nGINX PHP-FPM works

Discussion in 'General' started by piper, Jan 20, 2014.

  1. piper

    piper Well-Known Member

    I am pulling my hair out. So Litespeed is compiled with Curl (PHP Info show it is enabled with SSL support and all protocols supported) - I also confirmed that DNS isnt the issue because using command line curl -L wordpress.com works

    However on Litespeed and PHP 5.5.7 I keep getting Curl Error 6 unable to resolve hostname.

    Uninstalled Litespeed and install nginx with php-fpm (same configure built with litespeed when I compile PHP) and it works (Curl and PHP)

    Any pointer?
     
    Last edited by a moderator: Jan 21, 2014
  2. NiteWave

    NiteWave Administrator

    1st, see if following test script works under litespeed:
    PHP:
    <?php
    $ip 
    gethostbyname('www.google.com');

    echo 
    $ip;

    ?>
     
  3. mistwang

    mistwang LiteSpeed Staff

    If you use CloudLinux Cagefs, the /etc/resolv.conf in the user jail need to be updated.
    Or, you chroot the PHP process?
     
  4. piper

    piper Well-Known Member

    Yup! that was the issue, PHP process was chroot, got it fixed. Thx!
     

Share This Page