Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Mar 2010 10:18:12 -0800
From:      Nerius Landys <nlandys@gmail.com>
To:        Darrell Betts <betts@norden1.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Trying run a php script from cron
Message-ID:  <560f92641003091018m1c1ffeeg229cc2fc29079d7@mail.gmail.com>
In-Reply-To: <551AED7A-2336-40B6-B8B8-3EF2637D03B0@norden1.com>
References:  <551AED7A-2336-40B6-B8B8-3EF2637D03B0@norden1.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> I am trying to run a php script from the cron tab and these are the errors I
> receive:
>
>
> /usr/local/bin/php php -q /home/xxxx/ripper.php result
> Could not open input file: php
> /usr/local/bin/php php -/home/xxxx/ripper.php result
>
> Could not open input file: php
>
> /usr/local/bin/php  -/home/xxxx/ripper.php result
>
> This script must be called from the command line.
>
> Running Freebsd 8.0,  Php 5.2.12
> I have chmod the script 644 still no luck tried it chmod 777 still no luck.
> I have goggled this problem and followed the tutorials but still no luck.
> Any ideas how I can get the script to run?
> I can run run it from the command line without any problems.

Instead of
  /usr/local/bin/php php -q /home/xxxx/ripper.php
try
  /usr/local/bin/php -f /home/xxxx/ripper.php
or just
  /usr/local/bin/php /home/xxxx/ripper.php

You can also try a script like this one:

  #!/usr/local/bin/php -f
  <?php
  echo "foo\n";
  ?>

And running it like this:
  /home/xxxx/ripper.php
after chmod'ing it to be executable.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?560f92641003091018m1c1ffeeg229cc2fc29079d7>