Re: [PHP] PHP CLI Problem

2008-02-06 Thread Jochem Maas
Robbert van Andel schreef: I am having trouble with a PHP CLI script I wrote to help manage my website. The site is on a shared hosting server where the PHP installation is set up as a CGI. The script creates some backups of my databases and sends them to Amazon's S3 service. First off, the

RE: [PHP] PHP CLI Problem

2008-02-06 Thread Robbert van Andel
it in a cron job and am confident that it will run. Robbert -Original Message- From: Chris [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 05, 2008 11:06 PM To: Robbert van Andel Cc: php-general@lists.php.net Subject: Re: [PHP] PHP CLI Problem First off, the script runs great from

RE: [PHP] PHP CLI Problem

2008-02-06 Thread Robbert van Andel
, February 06, 2008 6:14 AM To: php-general@lists.php.net Subject: RE: [PHP] PHP CLI Problem Thank you, that was very helpful. I created a perl script because the shell script wouldn't run either. It too gave an error stating the file or directory could not be found. The perl script runs a shell

Re: [PHP] PHP CLI Problem

2008-02-06 Thread Nathan Nobbe
On Feb 6, 2008 9:36 AM, Robbert van Andel [EMAIL PROTECTED] wrote: I guess I spoke too soon. Even though the script runs from anywhere (that I have access too), when I put the perl script in a cronjob, the php script just refuses to run. There's no output, just the output from the perl

Re: [PHP] PHP CLI Problem

2008-02-06 Thread Daniel Brown
On Feb 6, 2008 1:55 AM, Robbert van Andel [EMAIL PROTECTED] wrote: [snip] First off, the script runs great from the command line when I type php5 backup.php but when I type ./backup.php I get an error: bash: ./backup.php: No such file or directory. I thought maybe this is a problem with the

Re: [PHP] PHP CLI Problem

2008-02-06 Thread Jim Lucas
Robbert van Andel wrote: I am having trouble with a PHP CLI script I wrote to help manage my website. The site is on a shared hosting server where the PHP installation is set up as a CGI. The script creates some backups of my databases and sends them to Amazon's S3 service. First off, the

RE: [PHP] PHP CLI Problem

2008-02-06 Thread Robbert van Andel
: Wednesday, February 06, 2008 7:52 AM To: Robbert van Andel Cc: php-general@lists.php.net Subject: Re: [PHP] PHP CLI Problem On Feb 6, 2008 1:55 AM, Robbert van Andel [EMAIL PROTECTED] wrote: [snip] First off, the script runs great from the command line when I type php5 backup.php but when I type

Re: [PHP] PHP CLI Problem

2008-02-06 Thread Nathan Nobbe
On Feb 6, 2008 11:33 AM, Robbert van Andel [EMAIL PROTECTED] wrote: I tried adding `which php5` and that didn't work. did you try running which php5 on the cli to ensure it even maps to a path ? you might need which php instead. -nathan

RE: [PHP] PHP CLI Problem

2008-02-06 Thread Robbert van Andel
Not an option. Which php gives me php4 and the script requires php5. From: Nathan Nobbe [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 06, 2008 8:39 AM To: Robbert van Andel Cc: Daniel Brown; php-general@lists.php.net Subject: Re: [PHP] PHP CLI Problem On Feb 6, 2008 11:33 AM

Re: [PHP] PHP CLI Problem

2008-02-06 Thread Nathan Nobbe
On Feb 6, 2008 11:42 AM, Robbert van Andel [EMAIL PROTECTED] wrote: Not an option. Which php gives me php4 and the script requires php5. it sounds like you are using 11, per dans security warning earlier :) you may want to contact them and ask them how to run php5 scripts via the cli; as i

Re: [PHP] PHP CLI Problem

2008-02-06 Thread Nathan Nobbe
On Feb 6, 2008 11:48 AM, Robbert van Andel [EMAIL PROTECTED] wrote: I contacted 11 and was told scripting was not supported. I wrote back saying I didn't need help writing the script just how to run it. They wrote back telling me to put it in a cron job using crontab –e and that was all

Re: [PHP] PHP CLI Problem

2008-02-06 Thread Daniel Brown
On Feb 6, 2008 12:25 PM, Nathan Nobbe [EMAIL PROTECTED] wrote: put the script in the webroot; then you can invoke it from cron using curl; i imagine they have that installed. you can protect the script with the following as the first line if($_SERVER['REMOTE_ADDR'] !== '127.0.0.1') { die; }

Re: [PHP] PHP CLI Problem

2008-02-06 Thread Chris
In your cronjob, replace the php5 entry with the following (including the backticks): `which php5` If that still doesn't work, replace it simply with php, not php5: `which php` You can use 'env php' instead and it'll pick up the first one in $PATH (same sort of idea

Re: [PHP] PHP CLI Problem

2008-02-06 Thread Daniel Brown
On Feb 6, 2008 6:56 PM, Chris [EMAIL PROTECTED] wrote: In your cronjob, replace the php5 entry with the following (including the backticks): `which php5` If that still doesn't work, replace it simply with php, not php5: `which php` You can use 'env php'

[PHP] PHP CLI Problem

2008-02-05 Thread Robbert van Andel
I am having trouble with a PHP CLI script I wrote to help manage my website. The site is on a shared hosting server where the PHP installation is set up as a CGI. The script creates some backups of my databases and sends them to Amazon's S3 service. First off, the script runs great from the

Re: [PHP] PHP CLI Problem

2008-02-05 Thread Chris
First off, the script runs great from the command line when I type php5 backup.php but when I type ./backup.php I get an error: bash: ./backup.php: No such file or directory. Maybe backup.php that you think it's running is the wrong one. Add something like: echo I am file . __FILE__ . \n;