Closed Thread
Results 1 to 5 of 5

Thread: Cronjob PHP script in password protected directory

  1. #1
    duitsescanner84 is offline x10Hosting Member duitsescanner84 is an unknown quantity at this point
    Join Date
    Apr 2011
    Posts
    3

    Cronjob PHP script in password protected directory

    Hello.

    I am new to cronjobs, but I would like to use it to ran a script.
    The 'update.php' is in a password(Username & Password) protected directory.

    What would be to correct command to run this?
    The file is located in:
    /public_html/hax/zitrostats/update/(update.php)

    Thanks for letting me host on your site and thanks for your help :)
    Greets Marijn.

  2. #2
    lemon-tree's Avatar
    lemon-tree is offline x10 Minion lemon-tree has a spectacular aura about
    Join Date
    Nov 2007
    Posts
    1,420

    Re: Cronjob PHP script in password protected directory

    If you have password protected the directory through .htaccess then it will not affect how you run the script as the authentication takes place within the webserver layer. Therefore, all you need to do is add a cron job like so:
    "/usr/bin/php /public_html/hax/zitrostats/update/update.php"

  3. #3
    duitsescanner84 is offline x10Hosting Member duitsescanner84 is an unknown quantity at this point
    Join Date
    Apr 2011
    Posts
    3

    Re: Cronjob PHP script in password protected directory

    Thanks for your quick reply

    I dont use .htacces, but I used the "With password protected directories" from x10's cPanel. I made an account and a password for it.

    I tried your sollution, but it doesn't seem to work

    Thanks

  4. #4
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,635

    Re: Cronjob PHP script in password protected directory

    Code:
    /usr/bin/php /home/igor/public_html/hax/zitrostats/update/update.php
     >>/home/igor/public_html/cron_log.txt 2>&1
    where you replace 'igor' with your cpanel account name.

    that way, any output or error messages will be written to cron_log.txt to help you find problems/verify it is running.
    Nothing is always absolutely so.

  5. #5
    duitsescanner84 is offline x10Hosting Member duitsescanner84 is an unknown quantity at this point
    Join Date
    Apr 2011
    Posts
    3

    Re: Cronjob PHP script in password protected directory

    Thanks for your reply.

    The Cron_log gives:

    PHP: Error parsing /usr/local/lib/php.ini on line 786
    X-Powered-By: PHP/5.2.17
    Pragma: no-cache
    Expires: 0
    Content-type: text/plain


    And underneath it gives the content of update.php. Seems it worked?! :D

    I will test it a bit more right now, but I think it is fixed.
    Thnx for your help
    Let me get back to you within an hour
    Greets Marijn
    _________________________________
    It works :D
    Thanks for your help guys :D
    Greets
    Last edited by duitsescanner84; 04-17-2011 at 01:40 PM.

Closed Thread

Similar Threads

  1. Replies: 6
    Last Post: 10-24-2009, 05:03 PM
  2. Need Help with Log In and Password Protected Pages
    By MomentsInTime in forum Scripts & 3rd Party Apps
    Replies: 3
    Last Post: 09-11-2008, 06:06 PM
  3. Password Protected Page
    By mahlerwd in forum Free Hosting
    Replies: 5
    Last Post: 05-14-2008, 08:15 AM
  4. PHP protected directory
    By thezone1 in forum Scripts & 3rd Party Apps
    Replies: 6
    Last Post: 03-14-2008, 12:20 AM
  5. Protected Directory problem
    By Wonders in forum Free Hosting
    Replies: 3
    Last Post: 11-02-2007, 02:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers