This time I get the following in the cron email:
Warning: main(./includes/bootstrap.inc): failed to open stream: No such file
or directory in /home/cmp/public_html/cron.php on line 9
Warning: main(): Failed opening './includes/bootstrap.inc' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/cmp/public_html/cron.php on line 9
Fatal error: Call to undefined function: drupal_bootstrap() in /home/cmp/public_html/cron.php on line 10
Thanks,
Shai
On Tue, Apr 29, 2008 at 12:24 AM, Shai Gluskin shai@content2zero.com wrote:
This time I get the following in the cron email:
Warning: main(./includes/bootstrap.inc): failed to open stream: No such
file or directory in /home/cmp/public_html/cron.php on line 9
Warning: main(): Failed opening './includes/bootstrap.inc' for inclusion
(include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/cmp/public_html/cron.php on line 9
Fatal error: Call to undefined function: drupal_bootstrap() in
/home/cmp/public_html/cron.php on line 10
You must run cron.php not as a file, but by accessing its URL with a local browser (wget, lynx, curl), as explained here:
The cause of this error is that you are running cron.php directly with php, so the current directory is not drupal and the "./" paths turn out wrong.
Thanks,
Shai
-- [ Drupal support list | http://lists.drupal.org/ ]
Thanks cog I'll try that.
I'm doing it the other way on several accounts on the same server and it is working. Why would it work on some accounts and not on others.
Shai
On Mon, Apr 28, 2008 at 5:56 PM, Cog Rusty cog.rusty@gmail.com wrote:
On Tue, Apr 29, 2008 at 12:24 AM, Shai Gluskin shai@content2zero.com wrote:
This time I get the following in the cron email:
Warning: main(./includes/bootstrap.inc): failed to open stream: No
such
file or directory in /home/cmp/public_html/cron.php on line 9
Warning: main(): Failed opening './includes/bootstrap.inc' for
inclusion
(include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/cmp/public_html/cron.php on line 9
Fatal error: Call to undefined function: drupal_bootstrap() in
/home/cmp/public_html/cron.php on line 10
You must run cron.php not as a file, but by accessing its URL with a local browser (wget, lynx, curl), as explained here:
The cause of this error is that you are running cron.php directly with php, so the current directory is not drupal and the "./" paths turn out wrong.
Thanks,
Shai
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
On Tue, Apr 29, 2008 at 2:52 AM, Shai Gluskin shai@content2zero.com wrote:
Thanks cog I'll try that.
I'm doing it the other way on several accounts on the same server and it is working. Why would it work on some accounts and not on others.
Shai
What are your cron commands? Do they have identical form?
On Mon, Apr 28, 2008 at 5:56 PM, Cog Rusty cog.rusty@gmail.com wrote:
On Tue, Apr 29, 2008 at 12:24 AM, Shai Gluskin shai@content2zero.com
wrote:
This time I get the following in the cron email:
Warning: main(./includes/bootstrap.inc): failed to open stream: No
such
file or directory in /home/cmp/public_html/cron.php on line 9
Warning: main(): Failed opening './includes/bootstrap.inc' for
inclusion
(include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/cmp/public_html/cron.php on line 9
Fatal error: Call to undefined function: drupal_bootstrap() in
/home/cmp/public_html/cron.php on line 10
You must run cron.php not as a file, but by accessing its URL with a local browser (wget, lynx, curl), as explained here:
The cause of this error is that you are running cron.php directly with php, so the current directory is not drupal and the "./" paths turn out wrong.
Thanks,
Shai
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
Hi Cog,
Thanks for the reply. First let me say that the following command is now *working fine* on the account I was having trouble with:
15 * * * * curl --silent --compressed http://example.com/cron.php > /dev/null 2>&1
Here are two commands that I tried previously. The first command is the one that is working on other accounts. The second one was recommended by my VPS host tech support, but it didn't work either on the troubled account.
15 * * * * /usr/bin/php -q /home/<account_name>/public_html/cron.php
15 * * * * /usr/local/bin/php -q /home/<account_name>/public_html/cron.php
I'm still curious. Of course it is less urgent now that curl is working for me. And based on the handbook page that you sent me to, the curl way seems to be more of a best practice.
Shai
On Tue, Apr 29, 2008 at 12:05 AM, Cog Rusty cog.rusty@gmail.com wrote:
On Tue, Apr 29, 2008 at 2:52 AM, Shai Gluskin shai@content2zero.com wrote:
Thanks cog I'll try that.
I'm doing it the other way on several accounts on the same server and it
is
working. Why would it work on some accounts and not on others.
Shai
What are your cron commands? Do they have identical form?
On Mon, Apr 28, 2008 at 5:56 PM, Cog Rusty cog.rusty@gmail.com wrote:
On Tue, Apr 29, 2008 at 12:24 AM, Shai Gluskin shai@content2zero.com
wrote:
This time I get the following in the cron email:
Warning: main(./includes/bootstrap.inc): failed to open stream: No
such
file or directory in /home/cmp/public_html/cron.php on line 9
Warning: main(): Failed opening './includes/bootstrap.inc' for
inclusion
(include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/cmp/public_html/cron.php on line 9
Fatal error: Call to undefined function: drupal_bootstrap() in
/home/cmp/public_html/cron.php on line 10
You must run cron.php not as a file, but by accessing its URL with a local browser (wget, lynx, curl), as explained here:
The cause of this error is that you are running cron.php directly with php, so the current directory is not drupal and the "./" paths turn out wrong.
Thanks,
Shai
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
On Tue, 29 Apr 2008 00:32:59 -0400 "Shai Gluskin" shai@content2zero.com wrote:
I'm still curious. Of course it is less urgent now that curl is working for me. And based on the handbook page that you sent me to, the curl way seems to be more of a best practice.
Drupal is mainly written to have a web interface. There are cookies, POST, GET, authentication, REFERER. You can expect that the efforts will be put into making it work from the web and running cron.php from the cli may have unexpected result.
That doesn't mean it couldn't have a cli interface (I think there is a cli interface for drupal admin but it still rely on HTTP)... that just mean I doubt it is something I'd rely on.
I don't think people will put stuff in cron that will redirect, use javascript, expect to see on the other side a "regular" full-fledged browser... but still it would be a conservative choice to put on the other side the smaller thing that resemble a browser if you're not so tight on resources. You could even write a telnet script, use netcat whatever... but life is complicated enough by itself: wget, curl, links etc will mostly do the trick for a reasonably long foreseeable future.
Quoting Shai Gluskin shai@content2zero.com:
15 * * * * curl --silent --compressed http://example.com/cron.php > /dev/null 2>&1
This is an http request and is a different environment than
15 * * * * /usr/bin/php -q /home/<account_name>/public_html/cron.php
and
15 * * * * /usr/local/bin/php -q /home/<account_name>/public_html/cron.php
Cron.php was designed to execute in the http request environment and wasn't designed to work in the shell environment.
Earnie -- http://for-my-kids.com/ -- http://give-me-an-offer.com/
On Tue, Apr 29, 2008 at 7:32 AM, Shai Gluskin shai@content2zero.com wrote:
Hi Cog,
Thanks for the reply. First let me say that the following command is now working fine on the account I was having trouble with:
15 * * * * curl --silent --compressed http://example.com/cron.php > /dev/null 2>&1
Here are two commands that I tried previously. The first command is the one that is working on other accounts. The second one was recommended by my VPS host tech support, but it didn't work either on the troubled account.
15 * * * * /usr/bin/php -q /home/<account_name>/public_html/cron.php
15 * * * * /usr/local/bin/php -q /home/<account_name>/public_html/cron.php
I'm still curious. Of course it is less urgent now that curl is working for me. And based on the handbook page that you sent me to, the curl way seems to be more of a best practice.
Shai
Hmm... so the question now is why /usr/bin/php -q /home/[blah]/cron.php didn't give you a path error "Failed opening './includes/bootstrap.inc" etc on the other server but only on this one.
I don't really know, maybe they have something which automatically changes php's working directory to the scipt's directory... but this is only a guess. Maybe you could write a small test script printing the working directory to test this hypothesis.
On Tue, Apr 29, 2008 at 12:05 AM, Cog Rusty cog.rusty@gmail.com wrote:
On Tue, Apr 29, 2008 at 2:52 AM, Shai Gluskin shai@content2zero.com
wrote:
Thanks cog I'll try that.
I'm doing it the other way on several accounts on the same server and it
is
working. Why would it work on some accounts and not on others.
Shai
What are your cron commands? Do they have identical form?
On Mon, Apr 28, 2008 at 5:56 PM, Cog Rusty cog.rusty@gmail.com wrote:
On Tue, Apr 29, 2008 at 12:24 AM, Shai Gluskin shai@content2zero.com
wrote:
This time I get the following in the cron email:
Warning: main(./includes/bootstrap.inc): failed to open stream: No
such
file or directory in /home/cmp/public_html/cron.php on line 9
Warning: main(): Failed opening './includes/bootstrap.inc' for
inclusion
(include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/cmp/public_html/cron.php on line 9
Fatal error: Call to undefined function: drupal_bootstrap() in
/home/cmp/public_html/cron.php on line 10
You must run cron.php not as a file, but by accessing its URL with a local browser (wget, lynx, curl), as explained here:
The cause of this error is that you are running cron.php directly with php, so the current directory is not drupal and the "./" paths turn out wrong.
Thanks,
Shai
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
On Tue, Apr 29, 2008 at 6:57 PM, Cog Rusty cog.rusty@gmail.com wrote:
On Tue, Apr 29, 2008 at 7:32 AM, Shai Gluskin shai@content2zero.com wrote:
Hi Cog,
Thanks for the reply. First let me say that the following command is now working fine on the account I was having trouble with:
15 * * * * curl --silent --compressed http://example.com/cron.php > /dev/null 2>&1
Here are two commands that I tried previously. The first command is the one that is working on other accounts. The second one was recommended by my VPS host tech support, but it didn't work either on the troubled account.
15 * * * * /usr/bin/php -q /home/<account_name>/public_html/cron.php
15 * * * * /usr/local/bin/php -q /home/<account_name>/public_html/cron.php
I'm still curious. Of course it is less urgent now that curl is working for me. And based on the handbook page that you sent me to, the curl way seems to be more of a best practice.
Shai
Hmm... so the question now is why /usr/bin/php -q /home/[blah]/cron.php didn't give you a path error "Failed opening './includes/bootstrap.inc" etc on the other server but only on this one.
I don't really know, maybe they have something which automatically changes php's working directory to the scipt's directory... but this is only a guess. Maybe you could write a small test script printing the working directory to test this hypothesis.
Followup to add: Another obvious question when accessing cron.php as a file is which site's database will be updated in case of a multisite.
On Tue, Apr 29, 2008 at 12:05 AM, Cog Rusty cog.rusty@gmail.com wrote:
On Tue, Apr 29, 2008 at 2:52 AM, Shai Gluskin shai@content2zero.com
wrote:
Thanks cog I'll try that.
I'm doing it the other way on several accounts on the same server and it
is
working. Why would it work on some accounts and not on others.
Shai
What are your cron commands? Do they have identical form?
On Mon, Apr 28, 2008 at 5:56 PM, Cog Rusty cog.rusty@gmail.com wrote:
On Tue, Apr 29, 2008 at 12:24 AM, Shai Gluskin shai@content2zero.com
wrote:
This time I get the following in the cron email:
> Warning: main(./includes/bootstrap.inc): failed to open stream: No
such
file or directory in /home/cmp/public_html/cron.php on line 9 > > Warning: main(): Failed opening './includes/bootstrap.inc' for
inclusion
(include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/cmp/public_html/cron.php on line 9 > > Fatal error: Call to undefined function: drupal_bootstrap() in /home/cmp/public_html/cron.php on line 10
You must run cron.php not as a file, but by accessing its URL with a local browser (wget, lynx, curl), as explained here:
The cause of this error is that you are running cron.php directly with php, so the current directory is not drupal and the "./" paths turn out wrong.
Thanks,
Shai
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]