简书链接:Ifyoucannotenabletheopenssl的坑爹问题 文章字数:339,阅读全文大约需要1分钟 可以直接调用Apache或PHP或MySQL的bin目录下的命令。
1 2 3 [Composer\Exception\NoSslException] The openssl extension is required for SSL/TLS protection but is not available. If you can not enable the openssl extension, you can disable this error, at your own risk, by setting the 'disable-t ls' option to true.
永远不要太相信一个软件,我是用的是phpstudy 2016 7.0.12 昨天解决了这个问题,但是今天重启后发现php版本是7.0.12 PhpStudy–打开配置文件-php-ini配置编辑php文件 ,发现extension=php_openssl.dll
也确实已经开启了,而且我记得应该是昨天开启了的。 于是 如何分析问题呢/
PhpStudy -cmd
1 2 3 4 5 :\phpStudy>php --ini onfiguration File (php.ini) Path: C:\Windows oaded Configuration File: D:\phpStudy\php\php-5.2.17\php.ini can for additional .ini files in: (none) dditional .ini files parsed: (none)
所以问题是phpstudy的版本定位问题,版本被恢复导致的, 所以重新切换一下phpstudy的php版本然后重启应该就ok了。 如果已经开启终端了,终端需要关闭再打开一次
另外 composer 下载没反应 ,设置镜像 设置无效问题,所以还是只能手动添加节点了 编辑当前项目的composer.json
1 2 3 4 5 6 "repositories": { "packagist": { "type": "composer", "url": "https://packagist.phpcomposer.com" } }
插入之后就是这样了.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 { "name": "phalapi/phalapi", "description": "PhalApi v2.x,一个PHP轻量级开源接口框架,致力于快速开发接口服务。", "type": "project", "keywords": ["api"], "homepage": "http://www.phalapi.net", "license" : "GPL-3.0+", "minimum-stability": "dev", "authors": [ { "name": "Dogstar Huang", "email": "[email protected] ", "homepage" : "http://my.oschina.net/dogstar", "role": "Developer" } ], "require": { "php": ">=5.3.3", "phalapi/kernal": "2.0.*", "phalapi/task": "2.0.*" }, "autoload": { "files": [ "src/app/functions.php" ], "psr-4": { "App\\": "src/app" } }, "repositories": { "packagist": { "type": "composer", "url": "https://packagist.phpcomposer.com" } } }
有点意思,感觉这个框架跟那个 node.js差不多 小程序也有类似的配置文件.json