我正在尝试在Ubuntu 16.04 LTS计算机上的here上完成IBM Cloud PHP入门教程。
我使用
安装了gitapt install git
我使用
安装了phpapt install php
最后一步(在本地运行您的应用程序。)
php -S localhost:8000
我得到以下输出
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.
当我访问
http://localhost:8000
从浏览器中输入“名称”的值,我收到错误消息
SagException: Sag Error: Sag::$HTTP_NATIVE_SOCKETS does not support SSL. in /home/user/get-started-php/sag/httpAdapters/SagNativeHTTPAdapter.php:29
完整的消息是:
[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}
可以直接在IBM Cloud上直接访问应用程序,而不会出现任何问题。只有应用程序的本地实例才会给出错误。
感谢您为解决此问题提供的任何帮助。