Previous Thread
Next Thread
Print Thread
Rate Thread
#239506 03/11/2003 11:06 AM
Joined: Sep 2001
Posts: 64
Junior Member
Junior Member
Offline
Joined: Sep 2001
Posts: 64
I'm assuming that subscriptions is the .threads answer to the .classic practice of sending all posts to a user (like moderators).

If this is the case - I've turned subscriptions on and have set up a cron job. However, I'm getting this error
[] subscriptions.php: cannot open ?: no such file
[/]

I've changed permissions to 777 for this testing and made user my paths are correct.

I noticed that in the subscriptions.php the following lines of code require a path.

// Require the library
require ("/home/www/html/ubbthreads/main.inc.php");
require ("$thispath/languages/${$config['cookieprefix']."w3t_language"}/subscriptions.php");
$html = new html;
$mailer = new mailer;

since my path is not /home/www/..... i changed the path statement to read thus:

// Require the library
require ("/usr/local/www/vhosts/livehope/threads/main.inc.php");
require ("$thispath/languages/${$config['cookieprefix']."w3t_language"}/subscriptions.php");
$html = new html;
$mailer = new mailer;

and it still doesn't work.

Can anyone tell me what I'm doing wrong? Or perhaps there is another piece of code I must alter?

Thanks.

Sponsored Links
navdan #239507 03/13/2003 12:24 PM
Joined: Sep 2001
Posts: 64
Junior Member
Junior Member
Offline
Joined: Sep 2001
Posts: 64
bumping back to the top

navdan #239508 03/13/2003 2:30 PM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
No it seems that everything is correct in the subscriptions script. My guess would be a problem with the syntex of the cron job.

I'm not 100% sure, but it's my understanding that not all hosts allow PHP cron jobs (which is why they still distribute the Perl version - even though the perl version has been buggy).

You can test he subscriptions script by opening it in your browser.

http://www.yourdomain.com/threads/cron/php/subscriptions.php

If it runs correctly, you'll end with a totally blank screen.

If that works... the the trouble would be with the cron job. I'd check with your host to make sure they allow it and that you've got it setup correctly.

Hope that helps.

Daine #239509 03/13/2003 2:35 PM
Joined: Sep 2001
Posts: 64
Junior Member
Junior Member
Offline
Joined: Sep 2001
Posts: 64
hehe... I guess that would be me then since I own my own box.

navdan #239510 03/13/2003 2:36 PM
Joined: Sep 2001
Posts: 64
Junior Member
Junior Member
Offline
Joined: Sep 2001
Posts: 64
runs in browser ok. I end up with the blank screen.

Sponsored Links
navdan #239511 03/13/2003 2:53 PM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
I'm not much of a server guru... but it seems then the cannot open error is for cron.

Why don't you post the cron entry here and maybe someone will spot what's wrong with it.

navdan #239512 03/13/2003 3:12 PM
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
One thing to keep in mind is that when you run PHP from cron, you're running the binary instance of PHP, not the Apache module.

You can run the shell command "php -v" (or "/usr/bin/php -v", etc.) to check the version for the one that cron uses.

Another factor is that when running PHP from cron, rather than running it from the shell, the environmental parameters, such as the current working directory, may be different.

When I was setting up my PHP cron stuff, I first tried it with a simple test script that merely printed out the PHP version, current working directory, etc.

joeuser #239513 03/13/2003 3:14 PM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
I still need to re-create mine since my hard drive crash. But I think my cron entry looked like this:

/usr/bin/php /home/measurection/htdocs/forums/cron/php/doexpire.php

with the space after /usr/bin/php

Its on my list for the weekend.. so we'll know soon.

Daine #239514 03/13/2003 5:28 PM
Joined: Sep 2001
Posts: 64
Junior Member
Junior Member
Offline
Joined: Sep 2001
Posts: 64
Thanks guys. Here's what I had to do.

1. Install php4 (I currently run mod_php4 under Apache).
2. Insert #! /usr/local/bin/php as line one in subscriptions.php
3. crontab entry "* * * * * root /usr/local/www/vhosts/livehope/threads/cron/php/subscriptions.php" (This runs it every min. - until I get it like I want it)

navdan #239515 03/13/2003 5:30 PM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Graat... glad you got it sorted!

Sponsored Links
Daine #239516 03/13/2003 5:33 PM
Joined: Sep 2001
Posts: 64
Junior Member
Junior Member
Offline
Joined: Sep 2001
Posts: 64
got to make this one more post so I wont be a Lurker anymore.

navdan #239517 03/13/2003 5:35 PM
Joined: Sep 2001
Posts: 64
Junior Member
Junior Member
Offline
Joined: Sep 2001
Posts: 64
What's the diff between running doexpire.php and subscriptions.php?

navdan #239518 03/13/2003 5:41 PM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Subscriptions sends out digests of posts.

Doexpire will auto delete threads over x days old if you've configured that in the forum's options.

For example, you want all posts over 30 days old in a forum deleted. doexpire will 'clean house' for you every night.

Daine #239519 03/13/2003 9:21 PM
Joined: Sep 2001
Posts: 64
Junior Member
Junior Member
Offline
Joined: Sep 2001
Posts: 64
Ah, right then. Thanks.

navdan #239520 03/28/2003 12:15 AM
Joined: Apr 2002
Posts: 34
User
User
Offline
Joined: Apr 2002
Posts: 34
I am confused, in the files it says this:
You need to edit /etc/crontab so the
script will run nightly.

Where is the /etc/crontab so I can edit it?

camilla #239521 03/28/2003 6:03 AM
Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
Okay not so much as you can edit it as run it

Some people do not have access to root so their server provider is only able to do this for them but if you have root access it should be something like this

go to root level directory something like this

/var/spool/cron and in their there should be a file named usually your site name

Edit this file and put a line something like this format

* * * * * /PATH/TO/subscriptions.php

The asterik's are this in a row.

minute(s) hour(s) day(s) month(s) weekday(s) then the command to run as seen.

Now this is the crontab file.

Telnet into this directory and usually

cd /path/to/var/spool/cron

Now this is a bit different on servers I have seen but on mine I run this

crontab -u filename filename

then next

crontab -u filename -l

Make sure to leave the spaces where they are. Thats it it should be installed now.

sf49rminer #239522 03/28/2003 3:12 PM
Joined: Aug 2002
Posts: 111
Journeyman
Journeyman
Offline
Joined: Aug 2002
Posts: 111
If you don't have root access on your server, you need to email your hosting company and ask them to set up the cron tasks for you. After you've configured your cron files for the correct path, etc., just write to your host and request something like this:

Run: /htdocs/mysite/mydomain.com/ubbthreads/cron/php/subscriptions.php nightly around 1:am

Run: /htdocs/mysite/mydomain.com/ubbthreads/cron/php/doexpire.php nightly 1:am

Substitute whichever time you want to run subscriptions and/or doexpire. I thought I should post this because I had no idea how to word my cron request, so Josh helped

jbiz #239523 03/28/2003 3:28 PM
Joined: Apr 2002
Posts: 34
User
User
Offline
Joined: Apr 2002
Posts: 34
I have forwarded the info on to my hosting company, hopefully this will get things set up for me!
Thanks!


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)