Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Cron.php with unexpected T_OBJECT_OPERATOR error
 
Lenny2
Sr. Member
 
Total Posts:  171
Joined:  2008-05-21
München
 

Hi,

I created a cron job by following wiki instructions at:http://www.magentocommerce.com/wiki/how_to/how_to_setup_a_cron_job

So the crontab file looks like:

Mailto=webmaster@magentoshop.de
*/* * * * /usr/bin/php -/absolute/path/to/magento/cron.php

Now with the crontab status email I receive the following error:

<b>Parse error</b>:  syntax error, unexpected T_OBJECT_OPERATOR in <b>/homepages/17/d215778145/htdocs/eshop/cron.php</b> on line <b>25</b><br />

I even tried to use:
/usr/bin/php4 = same error message
and
/usr/bin/php5 = nothing - not even an status mail

Here is my cron.php:

require 'app/Mage.php';

Mage::app('admin');

if (!
Mage::app()->isInstalled()) {
    
echo "Application is not installed yet, please complete install wizard first.";
}

// Only for urls
// Don't remove this
$_SERVER['SCRIPT_FILENAME''index.php';

try 
{
    Mage
::getConfig()->init()->loadEventObservers('crontab');
    
Mage::app()->addEventArea('crontab');
    
Mage::dispatchEvent('default');
catch (Exception $e{
    Mage
::printException($e);
}

Line 25:  if (!Mage::app()->isInstalled()) {
Any ideas how I can fix that? By the way when executing cron.php with IE I just get a blank screen.

Any help is highly appreciated!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Lenny2
Sr. Member
 
Total Posts:  171
Joined:  2008-05-21
München
 

Hm, now I used the following crontab:

Mailto=Emailaddress
*/5 * * * * /usr/bin/php5 -f /absolute/path/to/magento/cron.php

Still dont receive status email from the cron daemon - however it seems that the the cron.php was started because the sitemaps were created. Now I get the following error from the “ProductPriceAlert\”:

Cron-Job Warnungen: Notice: Undefined index: SCRIPT_NAME in /homepages/17/d215778145/htdocs/eshop/lib/Zend/Controller/Request/Http.php on line 404

qeued newsletters were not sent.

Any ideas?
Thank you!

 
Magento Community Magento Community
Magento Community
Magento Community
 
NDan
Jr. Member
 
Total Posts:  9
Joined:  2009-02-19
 

Hi Leny,

Did you manage to solve this issue? I am having the same problem now.

Thanks
NDan

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top