Lunarpages Web Hosting Forum

Author Topic: Adding a login/password to my Cronjob Command Line  (Read 3101 times)

Offline 45thronin

  • Newbie
  • *
  • Posts: 1
Adding a login/password to my Cronjob Command Line
« on: April 03, 2005, 08:32:18 AM »
**HELP!**

I am unfortunately working with a script/program that has it's cron job PHP file, login and password protected!  I was just informed from Lunarpages that I have to use a different command line to run cron jobs now, which includes PHP and then the file path.

However, my file asks for a login/password.  When I enter the path in a URL, I get a pop up window that asks for the login and password.  I enter it and it works fine.  Whenever I try this using cron I get and error.

So, here is the way I'm entering my cron job:

php /home/userfolder/public_html/program/file.php

This is the error I get in return:

 Status: 401
Content-type: text/html
X-Powered-By: PHP/4.3.10
WWW-Authenticate: Basic realm="Enter your username and password"

Authentication Failed

- - - -

How would I add a login and password to my cron job command line, so the script recognizes it and runs the script?

Any help would be appreciated!  I tried removing the authentication from the file, but the stupid authentication runs through the ENTIRE script/program.  So stupid!!!!  Why password protect a cron job?  It just doesn't make any sense.

HELP!!!!!!!! :cry:  :cry:  :cry:  :cry:  :cry:

Lupine1647

  • Guest
Adding a login/password to my Cronjob Command Line
« Reply #1 on: April 03, 2005, 10:06:51 AM »
Well you have to fill the username and password values using something like
Code: [Select]
php /home/userfolder/public_html/program/file.php username=user password=pass

Although the variables username and password may be different depending on the script.