linux ubuntu /bin/sh 上的脚本错误:curl:未找到?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9296677/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 04:35:42  来源:igfitidea点击:

script error on linux ubuntu /bin/sh: curl: not found?

linuxmagentoubuntucron

提问by Ledgemonkey

I'm trying to run this script from the cron job schedule on Ubuntu Linux 10.04.1 server but i get the following out put:

我正在尝试从 Ubuntu Linux 10.04.1 服务器上的 cron 作业计划运行此脚本,但我得到以下输出:

enter image description here

在此处输入图片说明

Curl seems to be enabled on the serevr this is the extract fro the phpinfo file: enter image description here

似乎在 serevr 上启用了 Curl,这是 phpinfo 文件的摘录: 在此处输入图片说明

The cron script is to clean the log files in a magento db

cron 脚本用于清理 magento db 中的日志文件

I have tried various things but just can't get the thing to work ? any ideas would be a great help thank you.

我尝试了各种事情,但就是无法让事情发挥作用?任何想法都会有很大帮助,谢谢。

采纳答案by rekire

You mixed up the curl php-module and the system executable.

您混淆了 curl php-module 和系统可执行文件。

Conntect to a shell and enter this:

连接到外壳并输入:

sudo apt-get install curl

If you don't want to install curltry to use wget.

如果您不想安装,请curl尝试使用wget.

回答by Mithrandir

Well, the phpinfo() exceprt only tells you, that php is compiled with libcurl support and can use the curl functions. Try checking if curl is actually installed (the binary). If not install it and modify your cron-script to use thee full path (ususally /usr/bin/curl) of the command.

好吧,phpinfo() exceprt 只是告诉你,php 是用 libcurl 支持编译的,可以使用 curl 函数。尝试检查 curl 是否已实际安装(二进制文件)。如果不安装它并修改您的 cron 脚本以使用/usr/bin/curl命令的完整路径(通常是)。

回答by Shiplu Mokaddim

You have curl extensionfor php installed. But NOTcurl command line client.

你已经安装了 php 的curl 扩展。但不是curl 命令行客户端。

As you are using Ubuntu install it by,

当您使用 Ubuntu 时,请安装它,

sudo aptitude install curl

After that in the cron tab use full path of the curl
Like

之后在 cron 选项卡中使用 curl 的完整路径
Like

/usr/bin/curl