WP-CLI请求cURL扩展时出错

时间:2020-10-28 作者:mjones

立刻爱上了WP Cli。。。生活在真实的速度,抛弃GUI…-)

每次运行命令时,它都会成功执行,但我会收到以下错误消息和警告:

<br/><b style=\'font-size:16px; color:red;\'>curl_exec function is disabled in php.ini</b> - <i style=\'font-size:12px; color:red;\'>Social Networks AutoPoster needs the CURL PHP extension. Please enable it or contact your hosting company to enable it.</i><br/><br/>Installing Multisite Toolbar Additions (2.0.1)
Warning: Failed to create directory \'/home/user/.wp-cli/cache/\': mkdir(): Permission denied.
Downloading installation package from https://downloads.wordpress.org/plugin/multisite-toolbar-additions.2.0.1.zip...
Unpacking the package...
Installing the plugin...
Plugin installed successfully.
Network-activating \'multisite-toolbar-additions\'...
Plugin \'multisite-toolbar-additions\' network activated.
Success: Installed 1 of 1 plugins.
然而https://localhost.sitedomain.com/phpinfo.php 确认卷曲支撑已正确暂停

enter image description here

1 个回复
SO网友:mjones

不过,curl似乎在https://localhost.sitedomain.com/phpinfo.php , 错误的真正原因是curl实际上在全局php中被禁用。ini文件位于/etc/php/<php version #>/php.ini , 这与本地活动php不同。ini位于/etc/php/7.3/apache2/php.ini . 现在一切正常。

相关推荐

将子域名主页重定向到WordPress MultiSite中的域名特定页面

我有一个wordpress多站点,其中一个站点domain.com 和另一个materials.domain.com在域站点上,我有一个页面domain.com/materials我想重定向materials.domain.com 主页至domain.com/materials我正在子域安装中使用一个子主题,并尝试以下函数。phpwp_redirect(home_url(\'https://domain.com/materials\'),301); exit; 现在当我访问materia