0

Instantly fell in love with WP-Cli... life at real speed, ditch the GUI.. :-)

Each time that I run a command, it executes successfully, however I get the following error message and warning:

<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.

However the output of https://localhost.sitedomain.com/phpinfo.php confirms that curl support is stalled properly

enter image description here

7
  • That doesn't look like a WP CLI error, the error message is formatted in HTML and names a plugin, are you sure this is a WP CLI problem and not a bug in that plugin? – Tom J Nowell Oct 28 '20 at 12:42
  • not sure at all.. completely new to wp-cli.. Its just that I don't receive any error message or warning via the gui... – yupthatguy Oct 28 '20 at 13:50
  • Social Networks AutoPoster needs the CURL PHP extension., keep in mind that PHP FPM/CGI-BIN isn't quite the same as PHP CLI. Just because you have an extension listed in PHP info when you load it in the browser, doesn't mean it's present on CLI. You would need to run PHP Info via CLI and compare the output. But that's a dev ops problem not a WP problem. For Social Networks AutoPoster you should contact their support, plugins and themes can still misbehave and generate warnings on CLI just like they would in the browser, except it's harder to hide warnings and errors – Tom J Nowell Oct 28 '20 at 15:17
  • Ok will do... thx for the follow up – yupthatguy Oct 28 '20 at 15:52
  • What about the Warning: Failed to create directory '/home/user/.wp-cli/cache/': mkdir(): Permission denied. Warning – yupthatguy Oct 28 '20 at 15:57
0

Though, curl appeared to be properly working from https://localhost.sitedomain.com/phpinfo.php , the true cause of the error was that curl was in fact disabled within the global php.ini file located at /etc/php/<php version #>/php.ini , which is different from local active php.ini located at /etc/php/7.3/apache2/php.ini . Now everything works properly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.