Need help with cron job. Urgent.

Need help with cron job. Urgent.

Posted by: arpitagarwal82
Posted on: 2007-08-04 04:33:00

I have signed for a dreamhost account first time. Before this I have worked on many hosting (all of them were with cpanel).

I have installed wordpress and want to use smart rss plugin. The cron command which I used in all previous hostings was

/usr/bin/php /home/username/path-to-php-file/filename.php

But it is not working with dreamhost.
What cron command should I use in dreamhost cron tab??

Plz someone help me as I have to deliver the sites to my client.


Re: Need help with cron job. Urgent.

Posted by: rlparker
Posted on: 2007-08-04 04:43:00

Can you provide a url for the plugin you are using (there are a *lot* of rss plugins for WordPress) and the *full* crontab entry?

Those might help us help you.

--rlparker

Re: Need help with cron job. Urgent.

Posted by: arpitagarwal82
Posted on: 2007-08-04 04:47:00

Yes Sir
this is the plugin page
http://www.devplug.net/smartrss-plugin/

The command I was using on previous host was:
/usr/bin/php /home/xlekcom/public_html/dailydomains/wp_smartrss.php



Edited by arpitagarwal82 on 08/04/07 04:48 AM (server time).

Re: Need help with cron job. Urgent.

Posted by: rlparker
Posted on: 2007-08-04 05:05:00

Thanks for that info! I'll go take a look at the plugin, but while I am doing that, it looks like your paths have a couple of problems.

The path from your old host will not necessarily work, as things may be set up differently on DH.

Also, usually WordPress plugins are instalaled in the wp-content or wp-content/plugins directories.

First, the path to PHP is different on DH, and second, I can't tell for sure what your "base" web accessible dir is for your domain. Normally on Dreamhost (for accounts created in the last couple of years) public_html is not used, the DreamHost panel creates a "base dir" for a domain with same name as the domain (or whatever name you choose when you "add a domain"), so make sure you are using the right dir name after you user name.

Assuming you have installed WordPress in the "base" dir of your domain, Try:

/usr/local/bin/php -q /home/your usernameuser/your_domains_base_dir_name/wp-content/wp_smartrss.php

and let me know if that works. I'll go look at the page for the plugin, and check back here in a few minutes to see if my suggested fix works, and to find out what the "base" dir of your domain is and what directory you have installed wordpress in.

--rlparker

Re: Need help with cron job. Urgent.

Posted by: rlparker
Posted on: 2007-08-04 05:42:00

Ok, I have gone and reviewed the page for the plugin, installed it sucessfully on DreamHost, and looked at the code.

I have good news and I have bad news frown. The good news is that I have sorted out the cron settings; the bad news is that this plugin (which was last updated over a year ago) requires PHP URL file-access to be enabled in the server configuration. Without this setting, the plugin will not run, and returns a fatal error.

Having this setting "on" is a significant security risk and, as such, is not enabled by default on DreamHost's default PHP installations. While you *could* compile your own version of PHP for use on your domains and enable this function in order to run this script (search the DH Wiki for further info on compiling your own PHP), doing so would *decrease* the security of your site(s) (and possibly your shared server!), and is *not* supported* by Dreamhost. I'm sorry, but I also will not assist you with enabling that function and introducing that risk to the server. If you attempt it, and succeed, it would be "your baby" and your responsibility.wink

You do have other options:

1) You could modify the code in the plug-in to use cURL, which would allow the pages to be grabbed in a "safe" way. Here is a link that purports to have the necessary modification to make it work on DreamHost using cURL Yeah!

2) You could use any number of other RSS aggregators that are available, some as WordPress plugins and others as general packages that you can easily integrate within a WordPress blog, that do not rely on this function and that *do* work on Dreamhost. One such WordPress plugin is FeedWordPress, which has been successfully installed on DreamHost.

Hopefully, one of these solutions will get you "back in business"!

--rlparker
(edited to provide a cURL solution to the OP)Edited by rlparker on 08/04/07 05:58 AM (server time).

Re: Need help with cron job. Urgent.

Posted by: arpitagarwal82
Posted on: 2007-08-04 05:47:00

Thanks alot for quick reply.
I will try other options.
Cheers.

Re: Need help with cron job. Urgent.

Posted by: rlparker
Posted on: 2007-08-04 06:01:00

No Problem! You might want to recheck my last post, as I edited it to provide a pretty simple "fix" for the smartRSS plugin (code change to "cURLify" it!) "Google is our friend"! wink

--rlparker

Tags: cron jobdreamhostusr binphp filecpanelwordpresssmart