Jump to content

[SOLVED] php and cron


bobinindia

Recommended Posts

Well I use MAMP as well. First, get leopard  ;) ;).

 

Second, you need to play around doing something in terminal... This is more a unix issue, so I suggest you move this topic to the relevant board unless someone knows more than I. Try google though.

Link to comment
Share on other sites

Is there some path info missing or something else

 

Yes, localhost:8888 is not part of any filesystem path.

 

I don't use MAMP so I'm not sure where exactly your servers root documents are stored, one way you could find out would be to write a php script with the following in it.

 

<?php echo $_SERVER['DOCUMENT_ROOT']; ?>

 

from there you just append to ten of the path.

 

eg; If you can access your script via http://localhost:8888/process/testing/onetime.php in your browser, and the above $_SERVER['DOCUMENT_ROOT'] prints /var/www/ then your path would be...

 

/var/www/process/testing/onetime.php

Link to comment
Share on other sites

The problem (didn't notice it before) is your calling the script with wget. You need to call it with php.

 

06 * * * * /usr/bin/php /Applications/MAMP/htdocs/process/testing/onetime.php

 

Otherwise, if it needs to be executed via the server you can call it with wget, but wget expects a url. eg;

 

06 * * * * /usr/bin/wget -q http://localhost:8888/process/testing/onetime.php

Link to comment
Share on other sites

Still no luck trying both those lines.

This is what is in the crontab:

 

# The periodic and atrun jobs have moved to launchd jobs
# See /System/Library/LaunchDaemons
#
# minute        hour    mday    month   wday    who     command
08 * * * * /usr/bin/wget -q http://localhost:8888/process/testing/onetime.php

 

 

Nothing else. Maybe I have to do it somewhere else though it is meant to still work in Tiger.

We might be moving away from a php issue here.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.