We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16558
    • 12 Posts
    Lacks_Imagination Reply #1, 15 years ago
    I have set up the crontab on my server properly. But when I run the cron.php file in ssh I get the following error:

    Parse error: syntax error, unexpected T_STRING in /home/content/93/2045293/html/assets/components/cronmanager/cron.php on line 29

    But I do not see an error anywhere in the file. I am using revo 2.1.3. [ed. note: Lacks_Imagination last edited this post 15 years ago.]
      • 16558
      • 12 Posts
      Lacks_Imagination Reply #2, 15 years ago
      I solved the problem by running cron.php using PHP 5. I was running the file in PHP 4 before.
        • 16558
        • 12 Posts
        Lacks_Imagination Reply #3, 15 years ago
        After I got the crontab working the cron.php did not work. I am using Revo 2.1.3 and CronManager 1.0. I fixed the problem by replacing
        /* Lines 4 & 5 in cron.php */
        require_once MODX_CORE_PATH.'config/'.MODX_CONFIG_KEY.'.inc.php';
        require_once MODX_CONNECTORS_PATH.'index.php';

        with
        /* Now lines 4-6 in cron.php */
        require_once MODX_CORE_PATH.'model/modx/modx.class.php';
        $modx = new modX();
        $modx->initialize('web');


        I hope this helps anyone who has had problems with CronManager. [ed. note: Lacks_Imagination last edited this post 15 years ago.]
          • 25551 ☆ A M B ☆
          • 1,231 Posts
          I cannot get this to work with modx 2.1.3 advanced.

          The email I receive has the following error.

          <br />
          <b>Warning</b>:  session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cookie - headers already sent in <b>/home/site/core/model/modx/modx.class.php</b> on line <b>1975</b><br /> <br />
          <b>Warning</b>:  session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /home/site/core/model/modx/modx.class.php:1975) in <b>/home/site/core/model/modx/modx.class.php</b> on line <b>1975</b><br />
          
            Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
            AugmentBLU - MODX Partner

            BLUcart - MODX Revolution E-Commerce & Shopping Cart
            • 36756
            • 7 Posts
            Thx Lacks_Imagination, your solutions works really fine!
            cron.php is now looking like this:
            <?php
            require_once dirname(dirname(dirname(dirname(__FILE__)))).'/config.core.php';
            require_once MODX_CORE_PATH.'model/modx/modx.class.php';
            $modx = new modX();
            $modx->initialize('web');
            $corePath = $modx->getOption('cronmanager.core_path',null,$modx->getOption('core_path').'components/cronmanager/');
            require_once $corePath.'model/cronmanager/cronmanager.class.php';
            $modx->cronmanager = new CronManager($modx);
            $modx->lexicon->load('cronmanager:default');
            ...
            
              • 38954
              • 24 Posts
              Quote from: Lacks_Imagination at Sep 27, 2011, 11:56 PM
              After I got the crontab working the cron.php did not work. I am using Revo 2.1.3 and CronManager 1.0. I fixed the problem by replacing
              /* Lines 4 & 5 in cron.php */
              require_once MODX_CORE_PATH.'config/'.MODX_CONFIG_KEY.'.inc.php';
              require_once MODX_CONNECTORS_PATH.'index.php';

              with
              /* Now lines 4-6 in cron.php */
              require_once MODX_CORE_PATH.'model/modx/modx.class.php';
              $modx = new modX();
              $modx->initialize('web');


              I hope this helps anyone who has had problems with CronManager.

              Nice, thanks! It works for me!
              But why nothing in RTFM ((
                from Russia with love
                • 16430
                • 217 Posts
                I have also problem, for me cron.php returns this:
                "success":false,"code":401


                My snippet looks like this:
                <?php
                $images = new Imagick(glob('assets/p-images/*.JPG'));
                $imageprops = $image->getImageGeometry();
                 if ($imageprops['width'] <= 800 && $imageprops['height'] <= 600) {
                        // don't upscale
                    } else {
                foreach($images as $image) {
                    // Providing 0 forces thumbnailImage to maintain aspect ratio
                        $image->resizeImage(800,600, imagick::FILTER_LANCZOS, 0.9, true);
                    }
                	}
                


                Any idea why?
                  • 16430
                  • 217 Posts
                  I suppose I dont have to input any login for server since all pages are online, but the cron manager doesnt seems to work...