【发布时间】:2016-09-06 20:20:41
【问题描述】:
我最近使用 Magento 托管了我的网站,在设置我的 cron.php 后,我得到以下输出:
/home/xxx/webapps/abc/cron.php: line 1: ?php
: No such file or directory
/home/xxx/webapps/abc/cron.php: line 2: /**
: No such file or directory
/home/xxx/webapps/abc/cron.php: line 3: bin: command not found
/home/xxx/webapps/abc/cron.php: line 4: $'*\r': command not found
/home/xxx/webapps/abc/cron.php: line 5: bin: command not found
/home/xxx/webapps/abc/cron.php: line 6: $'*\r': command not found
/home/xxx/webapps/abc/cron.php: line 7: syntax error near unexpected token `('
/home/xxx/webapps/abc/cron.php: line 7: ` * This source file is subject to the Open Software License (OSL 3.0)
'
我在 Webfaction 上托管此问题,并且似乎此错误仅在 Webfaction 上发生。我在另一个服务上托管的另一个网站(使用相同的 Magento 版本)运行良好。
即使我删除了 cron.php 上的以下行,它仍然不起作用:
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magento.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magento.com for more information.
*
* @category Mage
* @package Mage
* @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
我还尝试将“shebang”放在
#!/usr/local/bin/php
得到这个结果:
/usr/local/bin/php^M: bad interpreter: No such file or directory
我怀疑编码可能有问题。谁能帮我解决这个问题?
【问题讨论】:
-
您确定可以正确访问php,并且您使用的是正确的版本吗?
标签: php magento cron webfaction