![]() | ![]() | ![]() |
| |||||||
| Forums | Register | Groups | Awards | Arcade | Pets | T-Bucks / T-Store | Invite Your Friends | Blogs | Mark Forums Read |
| Web Design Forums and discussions on webdesign |
Web Design | |||||||||
|
|
|
|
| |||||
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| Civilians | Hi, I can manually run a file on my webserver and it completes its action fine. I am trying to run this with a cron job via the GUI interface for cron on cpanel. This is the error I'm getting: /home/condomch/public_html/catalog/admin/froogle.php: ?php: No such file or directory /home/condomch/public_html/catalog/admin/froogle.php: //: is a directory /home/condomch/public_html/catalog/admin/froogle.php: //: is a directory /home/condomch/public_html/catalog/admin/froogle.php: line 4: syntax error near unexpected token `explode(' /home/condomch/public_html/catalog/admin/froogle.php: line 4: `$stimer = explode( ' ', microtime() );' Any ideas where I'm going wrong? zeebop |
|
| | #2 (permalink) |
| Civilians | On 15 Aug 2005 20 54 GMT, Kim André Akerĝ<kimandre@NOSPAMbetadome.com> wrote: >zeebop wrote: > >> Hi, >> >> I can manually run a file on my webserver and it completes its action >> fine. >> >> I am trying to run this with a cron job via the GUI interface for cron >> on cpanel. >> >> This is the error I'm getting: >> >> /home/condomch/public_html/catalog/admin/froogle.php: ?php: No such >> file or directory >> /home/condomch/public_html/catalog/admin/froogle.php: //: is a >> directory >> /home/condomch/public_html/catalog/admin/froogle.php: //: is a >> directory >> /home/condomch/public_html/catalog/admin/froogle.php: line 4: syntax >> error near unexpected token `explode(' >> /home/condomch/public_html/catalog/admin/froogle.php: line 4: `$stimer >> = explode( ' ', microtime() );' >> >> Any ideas where I'm going wrong? > >What does the very first line of your froogle.php file look like? First few lines are as follows: <?php // Start TIMER // ----------- $stimer = explode( ' ', microtime() ); $stimer = $stimer[1] + $stimer[0]; // ----------- |
|
| | #3 (permalink) |
| Civilians | zeebop wrote > First few lines are as follows: > <?php > // Start TIMER > // ----------- > $stimer = explode( ' ', microtime() ); > $stimer = $stimer[1] + $stimer[0]; > // ----------- You need a shebang line before the PHP. Typically: #!/usr/bin/php -q <?php > // Start TIMER To find the path to PHP (in the shebang line) type this command: whereis php -- Charles Sweeney http://CharlesSweeney.com |
|
| | #4 (permalink) |
| Civilians | Charles Sweeney wrote: > zeebop wrote > >> First few lines are as follows: >> <?php >> // Start TIMER >> // ----------- >> $stimer = explode( ' ', microtime() ); >> $stimer = $stimer[1] + $stimer[0]; >> // ----------- > > You need a shebang line before the PHP. Typically: > > #!/usr/bin/php -q However, as per my previous post, you don't want that there if the script is /also/ to be run from the web server, otherwise the shebang line will output to the browser. If this is the case then you can run the script by calling /path/to/php /path/to/script > <?php >> // Start TIMER > > To find the path to PHP (in the shebang line) type this command: > > whereis php -- Chris Hope | www.electrictoolbox.com | www.linuxcdmall.com |
|
| | #5 (permalink) |
| Civilians | Chris Hope wrote: > Charles Sweeney wrote: > >> zeebop wrote >> >>> First few lines are as follows: >>> <?php >>> // Start TIMER >>> // ----------- >>> $stimer = explode( ' ', microtime() ); >>> $stimer = $stimer[1] + $stimer[0]; >>> // ----------- >> >> You need a shebang line before the PHP. Typically: >> >> #!/usr/bin/php -q > > However, as per my previous post, you don't want that there if the > script is /also/ to be run from the web server, otherwise the shebang > line will output to the browser. If this is the case then you can run > the script by calling /path/to/php /path/to/script > >> <?php >>> // Start TIMER >> >> To find the path to PHP (in the shebang line) type this command: >> >> whereis php > Oh and incidentally, I'd either forgotten or didn't know they were called shebang lines. Hopefully I'll remember next time ThanksCharles. -- Chris Hope | www.electrictoolbox.com | www.linuxcdmall.com |
|
| | #6 (permalink) |
| Civilians | Chris Hope wrote > Charles Sweeney wrote: > >> zeebop wrote >> >>> First few lines are as follows: >>> <?php >>> // Start TIMER >>> // ----------- >>> $stimer = explode( ' ', microtime() ); >>> $stimer = $stimer[1] + $stimer[0]; >>> // ----------- >> >> You need a shebang line before the PHP. Typically: >> >> #!/usr/bin/php -q > > However, as per my previous post, you don't want that there if the > script is /also/ to be run from the web server, otherwise the shebang > line will output to the browser. If this is the case then you can run > the script by calling /path/to/php /path/to/script Quite so. You already said that. I have made some PHP scripts that I run from cron. None are intended to be output to a browser. I sometimes do so when I am testing them, so I don't mind the shebang line appearing on the screen in such instances. -- Charles Sweeney http://CharlesSweeney.com |
|
| | #7 (permalink) |
| Civilians | Chris Hope wrote > Oh and incidentally, I'd either forgotten or didn't know they were > called shebang lines. Hopefully I'll remember next time Thanks> Charles. )I probably picked that up in here from some old Perl hack! -- Charles Sweeney http://CharlesSweeney.com |
|
![]() |
| Bookmarks |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| CPanel Cron Jobs (aka Son of the Cron Job thread ~or~ There and BackAgain) | Dylan Parry | Web Design | 2 | 06-19-2005 16:00 |
| Re: Cron job ? | Toby Inkster | Web Design | 2 | 06-12-2005 12:00 |
| Re: Cron job ? | Baho Utot | Web Design | 27 | 06-12-2005 08:00 |
| Re: Cron job ? | Matt Probert | Web Design | 5 | 06-11-2005 20:00 |
| Re: Cron job ? | Toby Inkster | Web Design | 3 | 06-11-2005 08:00 |
![]() | ![]() | ![]() |