Nextcloud in archlinux arm: curl error 6

Nextcloud version (eg, 10.0.2): 12.0.3
Operating system and version (eg, Ubuntu 16.04): arch linux arm
Apache or nginx version (eg, Apache 2.4.25): apache 2.4.29
PHP version (eg, 5.6): 7
Is this the first time you’ve seen this error?: yes

Can you reliably replicate it? (If so, please outline steps):
yes, if I go to admin panel in there it says that I have no internet connection although I can access nextcloud outside of my LAN.
if I check the logs I see a load of curl error 6’s

The issue you are facing:
My curl isn’t working although I have enabled it in php.ini

The output of your Nextcloud log in Admin > Logging:
GuzzleHttp\Exception\ConnectException: cURL error 6: Could not resolve host: www.github.com

/usr/share/webapps/nextcloud/3rdparty/guzzlehttp/guzzle/src/RequestFsm.php - line 103: GuzzleHttp\Exception\RequestException wrapException(Object(GuzzleHttp\Message\Request), Object(GuzzleHttp\Ring\Exception\ConnectException))
/usr/share/webapps/nextcloud/3rdparty/guzzlehttp/guzzle/src/RequestFsm.php - line 132: GuzzleHttp\RequestFsm->__invoke(Object(GuzzleHttp\Transaction))
/usr/share/webapps/nextcloud/3rdparty/react/promise/src/FulfilledPromise.php - line 25: GuzzleHttp\RequestFsm->GuzzleHttp\{closure}(Array)
/usr/share/webapps/nextcloud/3rdparty/guzzlehttp/ringphp/src/Future/CompletedFutureValue.php - line 55: React\Promise\FulfilledPromise->then(Object(Closure), NULL, NULL)
/usr/share/webapps/nextcloud/3rdparty/guzzlehttp/guzzle/src/Message/FutureResponse.php - line 43: GuzzleHttp\Ring\Future\CompletedFutureValue->then(Object(Closure), NULL, NULL)
/usr/share/webapps/nextcloud/3rdparty/guzzlehttp/guzzle/src/RequestFsm.php - line 134: GuzzleHttp\Message\FutureResponse proxy(Object(GuzzleHttp\Ring\Future\CompletedFutureArray), Object(Closure))
/usr/share/webapps/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php - line 165: GuzzleHttp\RequestFsm->__invoke(Object(GuzzleHttp\Transaction))
/usr/share/webapps/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php - line 125: GuzzleHttp\Client->send(Object(GuzzleHttp\Message\Request))
/usr/share/webapps/nextcloud/lib/private/Http/Client/Client.php - line 138: GuzzleHttp\Client->get('http //www.gith...', Array)
/usr/share/webapps/nextcloud/settings/Controller/CheckSetupController.php - line 125: OC\Http\Client\Client->get('http //www.gith...')
/usr/share/webapps/nextcloud/settings/Controller/CheckSetupController.php - line 108: OC\Settings\Controller\CheckSetupController->isSiteReachable('www.github.com')
/usr/share/webapps/nextcloud/settings/Controller/CheckSetupController.php - line 414: OC\Settings\Controller\CheckSetupController->isInternetConnectionWorking()
[internal function] OC\Settings\Controller\CheckSetupController->check()
/usr/share/webapps/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 160: call_user_func_array(Array, Array)
/usr/share/webapps/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 90: OC\AppFramework\Http\Dispatcher->executeController(Object(OC\Settings\Controller\CheckSetupController), 'check')
/usr/share/webapps/nextcloud/lib/private/AppFramework/App.php - line 114: OC\AppFramework\Http\Dispatcher->dispatch(Object(OC\Settings\Controller\CheckSetupController), 'check')
/usr/share/webapps/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47: OC\AppFramework\App main('OC\\Settings\\Con...', 'check', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)
[internal function] OC\AppFramework\Routing\RouteActionHandler->__invoke(Array)
/usr/share/webapps/nextcloud/lib/private/Route/Router.php - line 299: call_user_func(Object(OC\AppFramework\Routing\RouteActionHandler), Array)
/usr/share/webapps/nextcloud/lib/base.php - line 1004: OC\Route\Router->match('/settings/ajax/...')
/usr/share/webapps/nextcloud/index.php - line 48: OC handleRequest()
{main}

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'memcache.local' => '\OC\Memcache\APCu',
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/usr/share/webapps/nextcloud/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/usr/share/webapps/nextcloud/apps2',
      'url' => '/apps2',
      'writable' => true,
    ),
  ),
  'datadirectory' => '/mnt/disco/nextcloud',
  'instanceid' => '*************',
  'passwordsalt' => '****************,
  'secret' => '+++++++++++++,
  'trusted_domains' => array( 0 => 'magico.ddnsfree.com', 1 => '192.168.1.3' ),
  'overwrite.cli.url' => 'http://192.168.1.3/nextcloud',
  'dbtype' => 'mysql',
  'version' => '12.0.3.3',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => '*************'
  'installed' => true,
);

The output of your Apache/nginx/system log in /var/log/____:
In /var/log/httpd/ I have 4 log files. They are:
access_log error_log nextcloud.foo.info-access_log nextcloud.foo.info-error_log
don’t know which one you want

Can you resolve the hostname on the machine?

host www.github.com

and/or:

dig www.github.com

Yes I can

; <<>> DiG 9.11.2 <<>> www.github.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39026
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;www.github.com.			IN	A

;; ANSWER SECTION:
www.github.com.		3599	IN	CNAME	github.com.
github.com.		59	IN	A	192.30.253.112
github.com.		59	IN	A	192.30.253.113

;; Query time: 50 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Mon Nov 20 16:11:30 UTC 2017
;; MSG SIZE  rcvd: 89

And download something with curl from commandline? If yes, it goes back to php, perhaps something is blocked (SELinux, blocked functions, …), …

Doing curl "www.google.com" returns a html page so I believe it is working.
The only think that I have done regarding curl in php.ini was to uncomment the curl.so extension.
How should I debug to know what is blocking my curl? And what should I also do?

You can use a script with <?php phpinfo(); ?> to show the configuration and check if curl has been properly enabled. If that doesn’t help, I’d try a php script using the curl function (http://php.net/manual/en/curl.examples-basic.php). If that doesn’t work, it’s easier to identify the problem.

My phpinfo() shows curl enable. Here is what is says about curl:

curl
cURL support 	enabled
cURL Information 	7.56.1
Age 	3
Features
AsynchDNS 	Yes
CharConv 	No
Debug 	No
GSS-Negotiate 	No
IDN 	No
IPv6 	Yes
krb4 	No
Largefile 	Yes
libz 	Yes
NTLM 	Yes
NTLMWB 	Yes
SPNEGO 	Yes
SSL 	Yes
SSPI 	No
TLS-SRP 	Yes
HTTP2 	Yes
GSSAPI 	Yes
KERBEROS5 	Yes
UNIX_SOCKETS 	Yes
PSL 	Yes
Protocols 	dict, file, ftp, ftps, gopher, http, https, imap, imaps, pop3, pop3s, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp
Host 	armv7l-unknown-linux-gnueabihf
SSL Version 	OpenSSL/1.1.0g
ZLib Version 	1.2.11
libSSH Version 	libssh2/1.8.0 

Is my curl in php ok?
I have tried using http://php.net/manual/en/curl.examples-basic.php in my server. And what would a successful result appear like? It doesn’t seem to be doing anything when I visit the url link for the php curl script…

The example download a web page and save the content in a textfile example_homepage.txt