0

尝试将远程 php 文件作为计划任务运行,但出现 PHP 错误。

错误是“无法打开输入文件: http ://www.example.com/example.php ”</p>

尝试以各种格式编写它:

"C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\php.exe" -f http://www.example.com/example.php
"C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\php.exe" -f http://www.example.com/example.php

也尝试不使用 -f 参数,但都导致相同的错误消息

它在运行本地域 php 文件时确实有效:

"C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\php.exe" -f "C:\inetpub\vhosts\example.com\httpdocs\example.php"
4

2 回答 2

1

如何在 plesk 控制面板中创建删除计划任务

http://www.motherhost.in/members/knowledgebase/4/creating-or-removing-scheduled-tasks-in-plesk.html

在 Plesk 中创建或删除计划任务

Windows 服务器上,您可以通过创建计划任务将它们设置为在特定时间运行(这类似于在 Linux 服务器上运行 cron 作业的方式)。在 Plesk 10 中创建计划任务:

您可以通过执行以下操作在 Plesk 中设置计划任务:

Log into Plesk*
Click on the Websites & Domains tab.
Click on Show Advanced Operations (a small grey link in the middle of the page), if the advanced options are not already shown.
Click on Scheduled Tasks.
Select the appropriate system user.
Click on Schedule New Task.
Fill out the form as follows:
    Switched On:  Check the box to turn on the scheduled task.
    Description:  A short description to remind you what this scheduled task does.
    Scheduler Notification:  If you want an email every time this runs, select the appropriate option, otherwise select Do Not Send.  You may provide an email address where you want the notifications sent to.
    Path to executable file:  Specify the path to the file you wish to execute.  For Windows servers, it would be something like this:
    C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\php-cgi.exe
    Arguments: D:\Inetpub\vhosts\mydomain.tld\httpdocs\myscript.php
    For Linux servers with Plesk, ir would be something like this:
    /var/www/vhosts/domain.tld/httpdocs/myscript.php
    Replace domain.tld with your domain name, and myscript.php with the appropriate subfolder(s) (if any) and filename.
    Task Priority:  Select Low, Normal or High.
    Specify when to run your command by selecting the appropriate checkboxes in the Hours, Days of month, Months or Days of week fields.
    Click OK to schedule the task or click Run Now to schedule the task and immediately run it.
You will be taken back to the Scheduled Tasks screen and you should see your new scheduled task listed at the bottom.

在 Plesk 10 中删除计划任务

Logging into Plesk*
Click on the Websites & Domains tab.
Click on Show Advanced Operations (a small grey link in the middle of the page), if the advanced options are not already shown.
Click on Scheduled Tasks.
Select the appropriate system user.
Check the box next to the Scheduled Task you want to remove.
Click on the Remove button.
It will load a new page and ask if you really want to deleted it.  Check the Confirm Removal box and click on the OK button.
You will be taken back to the Scheduled Tasks screen and it should say: "Information: Scheduled tasks were removed."

印度网络托管经销商托管印度

于 2013-07-10T06:04:26.853 回答
0

PHP 命令行执行只支持本地文件。如果要获取远程 PHP 脚本输出,则可以使用 wget。

注意:确保 wget.exe 安装在您的 Windows 服务器上。请与您的托管服务提供商联系以获取路径。

c:\....path to wget...\wget.exe http://www.example.com/example.php
于 2013-03-17T22:05:31.183 回答