OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



cron job error

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

cron job error

Postby birkok » Sun Nov 16, 2008 12:57 pm

When I run cron job, get following error mail. I don't know if "PHP command-line interpreter" installed on our server.
I wonder what is wrong?
Thanks
***********
/hsphere/local/home/birkok/insanbilimleri.com/ojs/tools/runScheduledTasks.php: line 1: ?php: No such file or directory
/hsphere/local/home/birkok/insanbilimleri.com/ojs/tools/runScheduledTasks.php: line 3: /bin: is a directory
/hsphere/local/home/birkok/insanbilimleri.com/ojs/tools/runScheduledTasks.php: line 4: birkok.net: command not found
/hsphere/local/home/birkok/insanbilimleri.com/ojs/tools/runScheduledTasks.php: line 5: birkok.net: command not found
/hsphere/local/home/birkok/insanbilimleri.com/ojs/tools/runScheduledTasks.php: line 6: syntax error near unexpected token `('
/hsphere/local/home/birkok/insanbilimleri.com/ojs/tools/runScheduledTasks.php: line 6: ` * Copyright (c) 2003-2008 John Willinsky'
*************
birkok
 
Posts: 73
Joined: Sat Sep 22, 2007 5:12 am

Re: cron job error

Postby mcrider » Mon Nov 17, 2008 4:51 pm

Hi Birkok,

You'll need to check to see if the PHP command-line interpreter and cron are installed on your system. Try typing 'php' and 'cron' from a shell--If you don't get errors, you should be okay. There is more information on running OJS scheduled tasks in the docs/README file.

Cheers,
Matt
mcrider
 
Posts: 952
Joined: Mon May 05, 2008 10:29 am
Location: Vancouver, BC

Re: cron job error

Postby birkok » Tue Nov 18, 2008 3:47 am

I don't have shell access and command line interpreter installed.
The server technicians recommended following command to put in cron job control panel it would work even no interpreter installed:

/hsphere/shared/php5/bin/php-cli /hsphere/local/home/birkok/insanbilimleri.com/ojs/tools/runScheduledTasks.php

Bu it gives following error:
**********************
Status: 404 Not Found
X-Powered-By: PHP/5.2.6
Content-type: text/html

No input file specified.
***************
birkok
 
Posts: 73
Joined: Sat Sep 22, 2007 5:12 am

Re: cron job error

Postby mcrider » Tue Nov 18, 2008 11:37 am

Hi Birkok,

You'll have to make sure the location of the runScheduledTask.php file is accurate in respect to the path you provided. Also, check to see if the script has execute permissions (e.g. with an FTP client). You might want to ask your server administrators for further help, as I am unsure of your specific setup (in regard to running cron tasks), and they would know better.

Cheers,
Matt
mcrider
 
Posts: 952
Joined: Mon May 05, 2008 10:29 am
Location: Vancouver, BC

Re: cron job error

Postby birkok » Wed Nov 19, 2008 12:43 am

I have checked several times; all paths are correct and script file has execute permissions (http://www.insanbilimleri.com/ojs/tools ... dTasks.php gets message "This script can only be executed from the command-line")

I have asked server admins, they gave this command:
"/hsphere/shared/php5/bin/php-cli /hsphere/local/home/birkok/insanbilimleri.com/ojs/tools/runScheduledTasks.php"
They wanted to know script's requirements, I sent them readme file info.

But still no way to work.
birkok
 
Posts: 73
Joined: Sat Sep 22, 2007 5:12 am

Re: cron job error

Postby mcrider » Wed Nov 19, 2008 10:35 am

Hi birkok,

Looking at the script from a web browser isn't supposed to work--Its meant to be used only from the command line. Likewise, the path you give to php-cli should not be a URL. Your php-cli seems to work but its not finding the php script. How are you using cron, via a web-based tool?

Cheers,
Matt
mcrider
 
Posts: 952
Joined: Mon May 05, 2008 10:29 am
Location: Vancouver, BC

Re: cron job error

Postby birkok » Wed Nov 19, 2008 11:34 am

I use Crontab manager in server company's control panel.
I put the whole syntax "/hsphere/shared/php5/bin/php-cgi /hsphere/local/home/birkok/insanbilimleri.com/ojs/tools/runScheduledTasks.php" to the command column.

The path is correct, command and script are correct. But doesn't work.
birkok
 
Posts: 73
Joined: Sat Sep 22, 2007 5:12 am

Re: cron job error

Postby mcrider » Wed Nov 19, 2008 12:08 pm

Hi birkok,

You seem to be calling 'php-cgi', not 'php-cli'.. In case that's not a typo, make sure its 'php-cli'. Try writing a simple script, e.g.
Code: Select all
<?php
echo 'hello world';
?>
... Call it test.php, and put it in the base directory of your domain (i.e. /hsphere/local/home/birkok/insanbilimleri.com/). If running that with cron doesn't work, then the difficulty is with your server.

As you were able to get an error message when viewing the scheduled tasks script with your browser, I'm satisfied that its working correctly. Have you received any more communication with your tech support?

Cheers,
Matt
mcrider
 
Posts: 952
Joined: Mon May 05, 2008 10:29 am
Location: Vancouver, BC

Re: cron job error

Postby birkok » Wed Nov 19, 2008 12:32 pm

Very interesting, they both gave correct messages:
"/hsphere/shared/php5/bin/php-cgi /hsphere/local/home/birkok/insanbilimleri.com/test.php"
gives:
****************************
X-Powered-By: PHP/5.2.6
Content-type: text/html

hello world
***************************

and
"/hsphere/shared/php5/bin/php-cli /hsphere/local/home/birkok/insanbilimleri.com/test.php
gives:
*****************
hello world
*****************
birkok
 
Posts: 73
Joined: Sat Sep 22, 2007 5:12 am

Re: cron job error

Postby asmecher » Wed Nov 19, 2008 1:17 pm

Hi birkok,

OK -- just to confirm, after all of the discussion above, you should be using:
Code: Select all
/hsphere/shared/php5/bin/php-cli /hsphere/local/home/birkok/insanbilimleri.com/ojs/tools/runScheduledTasks.php
Note that you should be using php-cli, not php-cgi, or else you might receive the "This script can only be executed from the command-line" message.

Could you try putting the test.php script you were using in the ojs/tools subdirectory, and making sure that it has the same file permissions as the runScheduledTasks.php script? Also, using the CRON entry above, are you still receiving the "No input file specified" message, or is it something different?

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 7717
Joined: Wed Aug 10, 2005 12:56 pm

Re: cron job error

Postby birkok » Wed Nov 19, 2008 1:33 pm

/hsphere/shared/php5/bin/php-cli /hsphere/local/home/birkok/insanbilimleri.com/ojs/tools/test.php
gives message:
hello world

But
/hsphere/shared/php5/bin/php-cli /hsphere/local/home/birkok/insanbilimleri.com/ojs/tools/runScheduledTasks.php
gives no message any more. No error message, nothing

Both file have permission 644

I also tried mixing both files' content (hello world and runScheduledTasks.php), get only "hello world" message.
birkok
 
Posts: 73
Joined: Sat Sep 22, 2007 5:12 am

Re: cron job error

Postby birkok » Wed Nov 19, 2008 1:50 pm

If "runScheduledTasks.php" works properly, does it give any message or only on error situation?
birkok
 
Posts: 73
Joined: Sat Sep 22, 2007 5:12 am

Re: cron job error

Postby asmecher » Wed Nov 19, 2008 1:55 pm

Hi birkok,

If it's working properly, it shouldn't generate any output. Make sure the scheduled_tasks option is enabled in config.inc.php, and you'll be able to configure review reminders in Journal Setup.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 7717
Joined: Wed Aug 10, 2005 12:56 pm

Re: cron job error

Postby birkok » Wed Nov 19, 2008 2:19 pm

In this case it must be working
it is "on" in config file and Reviewer Reminders

Thanks a lot for everything
birkok
 
Posts: 73
Joined: Sat Sep 22, 2007 5:12 am

Re: cron job error

Postby birkok » Sun Sep 02, 2012 4:05 am

When running cron job, I get following message.
Is it an error message or just an information?
*****************
Status: 500 Internal Server Error
Content-type: text/html
******************
If it is information mail, then no remainder mail send to reviewers.

The cron command is follow and it is true because I use it for moodle and it works:
/usr/php/53/usr/bin/php /home3/insanbil/public_html/ojs/tools/runScheduledTasks.php

Thanks for any comment
birkok
 
Posts: 73
Joined: Sat Sep 22, 2007 5:12 am


Return to OJS Technical Support

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 4 guests