skip to Main Content

Trying to run a remote php file as a scheduled task but getting PHP error.

Error is “Could not open input file:
http://www.example.com/example.php

Tried writing it in various formats:

"C:Program Files (x86)ParallelsPleskAdditionalPleskPHP5php.exe" -f http://www.example.com/example.php
"C:Program Files (x86)ParallelsPleskAdditionalPleskPHP5php.exe" -f http://www.example.com/example.php

Also tried without the –f parameter but all result in the same error message

It does work when running a local domain php file:

"C:Program Files (x86)ParallelsPleskAdditionalPleskPHP5php.exe" -f "C:inetpubvhostsexample.comhttpdocsexample.php"

2

Answers


  1. PHP command line execution only support local files. If you want to fetch remote PHP script output then you can use wget.

    NOTE: Make sure wget.exe is installed on your windows server. Contact your hosting provider for the path.

    c:....path to wget...wget.exe http://www.example.com/example.php
    
    Login or Signup to reply.
  2. how to create remove scheduled task in plesk control panel

    https://www.motherhost.com/help/creating-or-removing-scheduled-tasks-in-plesk/

    Creating or Removing Scheduled Tasks in Plesk

    On Windows servers, you can set them up to run at certain times by creating a schedule task (which is similar to how you can run cron jobs on Linux servers).
    Creating a Scheduled Task in Plesk 10:

    You can set up Scheduled Tasks in Plesk by doing the following:

    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)ParallelsPleskAdditionalPleskPHP5php-cgi.exe
        Arguments: D:Inetpubvhostsmydomain.tldhttpdocsmyscript.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.
    

    Removing a Scheduled Task in 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."
    

    web hosting india & reseller hosting india

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search