SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Zealot
    Join Date
    Dec 2001
    Posts
    198
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    php script works fine in browser, bug gives permision error as crontab

    I have a php script that should create some static pages every few minutes, and if I just run the script in my browser it works fine. Blank screen, so no errors and the static files are written correctly.

    If I set it up as crontab however I have errors like this in my mailbox

    Code:
     
    <br />
    <b>Warning</b>:  fopen(/home/noxanet/public_html/_statics/static_index.php) 
    [<a href="http://www.php.net/function.fopen">function.fopen</a>]: failed to create stream: 
    Permission denied in <b>/home/noxanet/public_html/test/cron_minute.php</b> on line <b>34</b><br />
    <br />
    So it actually runs and thus the crontab command is ok, yet it has errors I dont have when running the script.

    The permissions for that directory currently are 773


    Whats going wrong here ?

  2. #2
    Sidewalking anode's Avatar
    Join Date
    Mar 2001
    Location
    Philadelphia, US
    Posts
    2,205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you accessing it directly through cron or through a "browser"(for example "wget myscript.php" or "lynx myscript.php")?
    TuitionFree a free library for the self-taught
    Anode Says... Blogging For Your Pleasure

  3. #3
    SitePoint Zealot
    Join Date
    Dec 2001
    Posts
    198
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no, directly

    the cron command is like "php path/to/that/script.php"

  4. #4
    Sidewalking anode's Avatar
    Join Date
    Mar 2001
    Location
    Philadelphia, US
    Posts
    2,205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Change php to lynx and see if that helps.
    TuitionFree a free library for the self-taught
    Anode Says... Blogging For Your Pleasure

  5. #5
    SitePoint Zealot
    Join Date
    Dec 2001
    Posts
    198
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    new error :

    Your Terminal type is unknown!
    Enter a terminal type: [vt100]
    TERMINAL TYPE IS SET TO vt100


    My first guess : maybe this is because its just php, and doesnt have html headers and <body> and such ?

  6. #6
    Sidewalking anode's Avatar
    Join Date
    Mar 2001
    Location
    Philadelphia, US
    Posts
    2,205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That shouldn't matter, it's still being served as HTTP. Is the URL fully qualified?
    TuitionFree a free library for the self-taught
    Anode Says... Blogging For Your Pleasure

  7. #7
    SitePoint Zealot
    Join Date
    Dec 2001
    Posts
    198
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    fully qualified -> you mean the full path with http://www etc ?

    no it wasnt when I first tried it with lynx, now I changed it . It seems those static files are being written, and no sign of permission errors any more.

    Thanks for that so far.

    And any weird errors about lynx that I recieve per email, I may as well ignore them ? as long as the script works it doesnt matter ?

  8. #8
    Sidewalking anode's Avatar
    Join Date
    Mar 2001
    Location
    Philadelphia, US
    Posts
    2,205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What kind of weird errors are you receiving? Congrats on getting it working.
    TuitionFree a free library for the self-taught
    Anode Says... Blogging For Your Pleasure

  9. #9
    SitePoint Zealot
    Join Date
    Dec 2001
    Posts
    198
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
      Your Terminal type is unknown!
    
      Enter a terminal type: [vt100] 
    TERMINAL TYPE IS SET TO vt100
    <A href="http://www.noxa.netwww.noxa.net0;7mMaking">www.noxa.netwww.noxa.net0;7mMaking HTTP connection to www.noxa.netSending HTTP request.HTTP request sent; waiting for response.
    
    [?1l>

    well, "weird error".

    on second thought this might as well be lynx telling he found the file and loaded it.
    Last edited by odoisc; Jan 23, 2005 at 16:32.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •