Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2011
    Posts
    27
    Plugin Contributions
    0

    Default simple cron and application_top.php

    Hi,

    I setup a cron job and it can call my script file, but my script fails when it encounter this line. when this script run, it never get to the echo 'got here' part. All I got is a blank screen. comment out the require_once line then it works.

    Don't know the location of my script makes the difference. Here's the path public_html/scripts/test.php

    <?php

    require_once('/home/user/public_html/includes/application_top.php');

    echo 'got here';

    ?>

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: simple cron and application_top.php

    What exactly are you trying to do with this script?

    To call public_html/includes/application_top, you need to start with your current working directory being public_html, not someplace higher or lower than that.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Mar 2011
    Posts
    27
    Plugin Contributions
    0

    Default Re: simple cron and application_top.php

    Thanks DrByte for your fast response.

    My script would extract zip and import values into Products database, I would also like to write many functions...

    I want to use application_top.php so that all database and its settings are defined.

    Because I will have multiple scripts for multiple vendors, I want to organize the scripts by vendors.

    How do I get my script start at public_html like you said? do you mean the script must be in the root of my store for it to be able to call application_top.php and functions/functions_general.php?

  4. #4
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: simple cron and application_top.php

    Yes. Putting the file in the "root of your store", as you call it, is the easiest approach. There are other ways you change directory via PHP if you have those skills.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Mar 2011
    Posts
    27
    Plugin Contributions
    0

    Default Re: simple cron and application_top.php

    Thanks DrByte,

    I will put the cron script in the public_html directory and have this script includes all necessary files, then calls vendor scripts depends on the parameters passed in by the cron command. I think this will solve my problems.

 

 

Similar Threads

  1. Replies: 1
    Last Post: 24 Nov 2012, 05:32 PM
  2. Converting call from application_top to autoloader! Auction Cron Job
    By davewest in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 29 Jun 2010, 06:22 PM
  3. Application_top.php error
    By darkswan in forum Installing on a Linux/Unix Server
    Replies: 3
    Last Post: 30 Dec 2007, 11:18 AM
  4. application_top.php
    By teranet in forum Installing on a Windows Server
    Replies: 1
    Last Post: 28 Oct 2006, 04:09 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
  •  
disjunctive-egg