I am trying to complete the IBM Cloud PHP Getting started tutorial at here on a Ubuntu 16.04 LTS machine.
I installed git using
apt install git
I installed php using
apt install php
In the last step (Run your application locally.)
php -S localhost:8000
I get the following output
root@ubuntu:/home/user/get-started-php# php -S localhost:8000
PHP 7.0.33-0ubuntu0.16.04.1 Development Server started at Tue Feb 26 15:49:23 2019
Listening on http://localhost:8000
Document root is /home/user/get-started-php
Press Ctrl-C to quit.
When I access
http://localhost:8000
from a browser and enter a value for "Name" I get the error message
SagException: Sag Error: Sag::$HTTP_NATIVE_SOCKETS does not support SSL. in /home/user/get-started-php/sag/httpAdapters/SagNativeHTTPAdapter.php:29
The full message is:
[Tue Feb 26 15:50:10 2019] 127.0.0.1:53752 [200]: /
[Tue Feb 26 15:50:10 2019] 127.0.0.1:53754 [200]: /public/styles.css
[Tue Feb 26 15:50:10 2019] 127.0.0.1:53758 [200]: /public/js/lib/jquery.i18n/jquery.i18n.js
[Tue Feb 26 15:50:10 2019] 127.0.0.1:53756 [200]: /public/js/lib/jquery.i18n/jquery.i18n.messagestore.js
[Tue Feb 26 15:50:10 2019] 127.0.0.1:53760 [200]: /public/js/lib/jquery.i18n/jquery.i18n.fallbacks.js
[Tue Feb 26 15:50:10 2019] 127.0.0.1:53762 [200]: /public/js/lib/jquery.i18n/jquery.i18n.language.js
[Tue Feb 26 15:50:10 2019] 127.0.0.1:53764 [200]: /public/js/lib/jquery.i18n/jquery.i18n.parser.js
[Tue Feb 26 15:50:10 2019] 127.0.0.1:53766 [200]: /public/js/lib/jquery.i18n/jquery.i18n.emitter.js
[Tue Feb 26 15:50:10 2019] 127.0.0.1:53768 [200]: /public/js/lib/jquery.i18n/jquery.i18n.emitter.bidi.js
[Tue Feb 26 15:50:10 2019] 127.0.0.1:53770 [200]: /public/antixss.js
SagException: Sag Error: Sag::$HTTP_NATIVE_SOCKETS does not support SSL. in /home/user/get-started-php/sag/httpAdapters/SagNativeHTTPAdapter.php:29
Stack trace:
#0 /home/user/get-started-php/sag/Sag.php(987): SagNativeHTTPAdapter->useSSL(true)
#1 /home/user/get-started-php/Cloudant.php(67): Sag->useSSL(true)
#2 /home/user/get-started-php/Cloudant.php(30): Cloudant->__construct()
#3 /home/user/get-started-php/index.php(40): Cloudant::Instance()
#4 [internal function]: {closure}()
#5 /home/user/get-started-php/vendor/slim/slim/Slim/Route.php(468): call_user_func_array(Object(Closure), Array)
#6 /home/user/get-started-php/vendor/slim/slim/Slim/Slim.php(1355): Slim\Route->dispatch()
#7 /home/user/get-started-php/vendor/slim/slim/Slim/Middleware/Flash.php(85): Slim\Slim->call()
#8 /home/user/get-started-php/vendor/slim/slim/Slim/Middleware/MethodOverride.php(92): Slim\Middleware\Flash->call()
#9 /home/user/get-started-php/vendor/slim/slim/Slim/Middleware/PrettyExceptions.php(67): Slim\Middleware\MethodOverride->call()
#10 /home/user/get-started-php/vendor/slim/slim/Slim/Slim.php(1300): Slim\Middleware\PrettyExceptions->call()
#11 /home/user/get-started-php/index.php(70): Slim\Slim->run()
#12 {main}
Accessing the application directly on the IBM Cloud works without any issue. Only the local instance of the application gives the error.
Any help to resolve this is appreciated.