SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist tangledman's Avatar
    Join Date
    Sep 2005
    Location
    Puerto de Mazarron, Murcia, Spain
    Posts
    426
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    cron job problem

    I have a script which works fine if i access it from the web

    but if I run it through cron I produces an error

    Warning
    SimpleXMLElement::__construct() [<a href='simplexmlelement.--construct'>simplexmlelement.--construct
    : URL file-access is disabled in the server configuration in /home/spanishp/cron/currency.php

    on line 9

    Is it possible that URL file-access is disabled form Crons but not if the script is run from the browser?

  2. #2
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,671
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    Yes.

    You cannot run a PHP script via CRON, either, without wrapping it in special code (which I use seldom enough I have to look it up every time I go to use it).

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  3. #3
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,095
    Mentioned
    153 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by tangledman View Post
    Is it possible that URL file-access is disabled form Crons but not if the script is run from the browser?
    Yes it is. PHP running from Apache (CGI mode) most of the time uses a different php.ini than PHP running from the command line (CLI mode).
    Rémon - Hosting Advisor

    SitePoint forums will switch to Discourse soon! Make sure you're ready for it!

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy


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
  •