I've set up the cron job as stated during setup, but when it runs, I get an email with an error message...
/bin/sh: /etc/php.ini: Permission denied
I know nothing about cron jobs, and the error may be cryptic, but does anyone have a clue as to what may be wrong here?
|
Can you post the command that you currently have setup for your cron job?
Chris
Nothing to see here |
This is what was suggested by the dolphin install.
cd /hsphere/local/home/xxxx/xxxx.net/h/periodic; /etc/php.ini -q cron.php
I've x'd out website info just to keep it private.
|
Hmm.. strange that it is calling your php.ini file. Are you on a dedicated web server or shared environment?
Who is your web host if a shared environment?
Chris
Nothing to see here |
BTW, you can review some common issues with cron jobs that I have posted here:
http://www.boonex.com/unity/forums/topic/Cron-Jobs-Migrations-Videos.htm
Chris
Nothing to see here |
It's shared hosting and i'm on ixwebhosting
I notice in the link the examples have **'s in them at the beginning. Are those required to be there? I didn't put them in if they are.
|
Yes those need to be there. The *'s tell the cron job how often to run. In the this case the 5 *s tell the cron to run every minute, everyday, every week, every month, and every year.
Chris
Nothing to see here |
Oh, okay. I understand that part now. My panel has 5 boxes to set the time in, which I did. Seeing the *'s on the command line confused me, but I actually did that part right.
Still doesn't explain the permission denied.
|
This is what was suggested by the dolphin install.
cd /hsphere/local/home/xxxx/xxxx.net/h/periodic; /etc/php.ini -q cron.php
I've x'd out website info just to keep it private.
That line is wrong. Should be.
cd /full_path_to_root_of_dolphin_site/periodic; /usr/local/bin/php -q cron.php
The part i marked in red is the path to your php executable. You have the path to your php ini file.
The path you have to the root of your dolphin site looks weird too. Look like it's in a sub folder called h. Which looks kinda weird. Check that as well.
Paths normally are.
/usr/local/bin/php or /usr/bin/php
But you will need to check with your host for the proper path.
https://www.deanbassett.com |
The /etc/php.ini is probably the correct path since when I use that, I get a permission denied.
When I user your options, I get No such file or directory.
As long as i'm using the correct patch, I guess I may have to check with the host support for help on this one.
The /h/ sub directory is correct. That is where my current set up is sitting.
|
the php.ini is 100% incorrect. the cron job needs to fire from the php binary which as stated is the php executable. the ini is an information file that contains your php's configuration.
i am unaware of your control panel but you mentioned seeing 'five boxes' when attempting to setup your cron job.
cron is a unix, solaris utility that allows tasks to be automatically run in the
background at regular intervals by the cron daemon. These tasks are often termed as cron jobs in unix , solaris. Crontab (CRON TABle) is a file which contains the schedule of cron entries to
be run and at specified times.
* * * *
* command to be executed - - - -
- | | |
| | | | |
| +----- day of week (0 - 6) (Sunday=0) | | |
+------- month (1 - 12) | | +--------- day of month
(1 - 31) | +----------- hour (0 - 23) +------------- min (0 - 59)
By default cron jobs sends a email to the user account executing the cronjob.
If this is not needed put the following command At the end of the cron job line
.
>/dev/null 2>&1
if you want to see the correct path, you can set this in your cron,
and it will fire at midnight, and report to you your /path/to/php which
is where your crons should be firing from.
0 |
0
|
*
|
*
|
*
|
find / -name php5 -print 2>/dev/null
|
When a GIG is not enough --> Terabyte Dolphin Technical Support - Server Management and Support |
reason you are getting a permission denied, is because you are on a shared environment, and as such you cannot access system directories such as the /etc
so your path would need to be corrected, and actually dont know how you got through the installation because the path you specify is not an option on the install script.
Regards,
DosDawg
When a GIG is not enough --> Terabyte Dolphin Technical Support - Server Management and Support |
The /etc/php.ini is probably the correct path since when I use that, I get a permission denied.
When I user your options, I get No such file or directory.
As long as i'm using the correct patch, I guess I may have to check with the host support for help on this one.
The /h/ sub directory is correct. That is where my current set up is sitting.
Then you need to check with your host for the proper path to php becuse /etc/php.ini is not correct.
https://www.deanbassett.com |
The /etc/... is what Dolphin told me to use for setting up the Cron. The install went perfect, no errors and seems to be working fine from what i've tested.
I ran thr you posted to find to correct path now. There was no reason to set it to run at midnight. The results were...
/hsphere/shared/php5
/hsphere/local/config/httpd/php5
/hsphere/local/config/httpd2/php5
Jumping ahead and assuming I change the /etc/php.ini to one of the above lines, that fails as well... all 3...
/bin/sh: /hsphere/shared/php5: is a directory
|
Then dolphin reported it incorrectly which sometimes happens.
As i said, you need the correct path to the php executable. Your host can tell you.
You can try these which are common paths.
/usr/local/bin/php
/usr/bin/php
/bin/php
But it's best to ask the host.
https://www.deanbassett.com |
The /etc/... is what Dolphin told me to use for setting up the Cron. The install went perfect, no errors and seems to be working fine from what i've tested.
I ran thr you posted to find to correct path now. There was no reason to set it to run at midnight. The results were...
/hsphere/shared/php5
/hsphere/local/config/httpd/php5
/hsphere/local/config/httpd2/php5
Jumping ahead and assuming I change the /etc/php.ini to one of the above lines, that fails as well... all 3...
/bin/sh: /hsphere/shared/php5: is a directory
all three of them are directories, because crons dont fire on php files, they fire on the binary, or as deano states the executable.
at any rate, there is no way you didnt have any errors, i can strip the install code from D7RC3, and show you exactly which directories are searched through for the php binary /usr/local/bin/php | /usr/bin/php are the two most common.
deano looks to me that the host may well have symlinks on this server config.
this hsphere setup is much different than an OS configured for plesk | cPanel | DirectAdmin | or Webmin
at any rate, deano is right, send in a support ticket and ask them for the path to your php, and then go to the /inc/header.inc.php file and change that path.
Regards
DosDawg
When a GIG is not enough --> Terabyte Dolphin Technical Support - Server Management and Support |
The /etc/... is what Dolphin told me to use for setting up the Cron. The install went perfect, no errors and seems to be working fine from what i've tested.
I ran thr you posted to find to correct path now. There was no reason to set it to run at midnight. The results were...
/hsphere/shared/php5
/hsphere/local/config/httpd/php5
/hsphere/local/config/httpd2/php5
Jumping ahead and assuming I change the /etc/php.ini to one of the above lines, that fails as well... all 3...
/bin/sh: /hsphere/shared/php5: is a directory
I ran thr you posted to find to correct path now. There was no reason to set it to run at midnight. The results were...
that is correct, i stated that the specific cron setting would fire at midnight, you could fire it off whenever you wanted to.
glad it reported back the path, that is exactly the one i would use.
Regards,
DosDawg
When a GIG is not enough --> Terabyte Dolphin Technical Support - Server Management and Support |
Ticket submitted with the host...
|
Ticket submitted with the host...
kewl, please let us know what they come back with on it.
When a GIG is not enough --> Terabyte Dolphin Technical Support - Server Management and Support |
The host is quick with support. This is the correct path...
/hsphere/shared/php5/bin/php-cgi
That seems to have worked, although I now get an error telling me that I need to have register_globals off.
They are off, so i'm not sure what is happening there. The host runs with register_globals on, and mine are off thru a php.ini file in my cgi-bin directory. I'm gussing that the cron is taking the system settings rather than mine.
Waiting for a ticket update.
|
The host is quick with support. This is the correct path...
/hsphere/shared/php5/bin/php-cgi
That seems to have worked, although I now get an error telling me that I need to have register_globals off.
They are off, so i'm not sure what is happening there. The host runs with register_globals on, and mine are off thru a php.ini file in my cgi-bin directory. I'm gussing that the cron is taking the system settings rather than mine.
Waiting for a ticket update.
Yea, quite often cron runs with a different copy of php that uses different config settings. You will need to bitch at the host on that one too.
And that is like the weirdest path to php i have ever seen.
Another host to go on my list of hosts to avoid. LOL.
https://www.deanbassett.com |
The host is quick with support. This is the correct path...
/hsphere/shared/php5/bin/php-cgi
That seems to have worked, although I now get an error telling me that I need to have register_globals off.
They are off, so i'm not sure what is happening there. The host runs with register_globals on, and mine are off thru a php.ini file in my cgi-bin directory. I'm gussing that the cron is taking the system settings rather than mine.
Waiting for a ticket update.
can you create a php file to run what your php config is, we see its php-cgi but the php file will tell you if your ini is being recognized as well because it will remove local and global settings.
place this line on a txt file:
<? phpinfo() ?>
save the files as xxx.php and call that file up in your browser, and post the data from that.
Regards,
DosDawg
When a GIG is not enough --> Terabyte Dolphin Technical Support - Server Management and Support |
The host is quick with support. This is the correct path...
/hsphere/shared/php5/bin/php-cgi
That seems to have worked, although I now get an error telling me that I need to have register_globals off.
They are off, so i'm not sure what is happening there. The host runs with register_globals on, and mine are off thru a php.ini file in my cgi-bin directory. I'm gussing that the cron is taking the system settings rather than mine.
Waiting for a ticket update.
can you create a php file to run what your php config is, we see its php-cgi but the php file will tell you if your ini is being recognized as well because it will remove local and global settings.
place this line on a txt file:
<? phpinfo() ?>
save the files as xxx.php and call that file up in your browser, and post the data from that.
Regards,
DosDawg
I had already done that and didnt see anything that would help me. Then again, my knowledge is just a couple of notches above nothing. I did just get some working results, and even that info file wouldn't have helped.
|
So this is the working path for me from ixhosting.com support.
cd /hsphere/local/home/denlem/x.net/h/periodic; /hsphere/local/home/denlem/x.net/cgi-bin/php5-custom-ini.cgi -q cron.php
All I get now is an email with this in it...
X-Powered-By: PHP/5.2.6
Content-type: text/html
So I assume that all is running well.
|
So this is the working path for me from ixhosting.com support.
cd /hsphere/local/home/denlem/x.net/h/periodic; /hsphere/local/home/denlem/x.net/cgi-bin/php5-custom-ini.cgi -q cron.php
All I get now is an email with this in it...
X-Powered-By: PHP/5.2.6
Content-type: text/html
So I assume that all is running well.
Maybe not. You should not even be seeing that. The -q switch passed to php is supposed to suppress that output. Now your going to get emails at every cron run.
You may want to ask your host why the -q switch is being ignored.
https://www.deanbassett.com |
I'm checking with them on the -q option. They must be busy now as the are suddenly slow to respond. |
They said nothing about the -q command, but they did tell me to use the same > /dev/null option DosDawg mentioned above.
|
Zarcon, DosDawg, and Deano, thank you for all your help. I have very little experience in this stuff, but I do have some sort of clue as to what is going on. Being able to do a lot of it definately needs some assistance. Thanks for your patience and sincere willingness to help me get this working! I learned a little something more today.
Thanks again!
|
Zarcon, DosDawg, and Deano, thank you for all your help. I have very little experience in this stuff, but I do have some sort of clue as to what is going on. Being able to do a lot of it definately needs some assistance. Thanks for your patience and sincere willingness to help me get this working! I learned a little something more today.
Thanks again!
indeed, you are more than welcome. it takes patience to even be able to attempt to run this application, muchless think you are going to know it all overnight. but there are some who have that convoluted ideology.
\/,
DosDawg
When a GIG is not enough --> Terabyte Dolphin Technical Support - Server Management and Support |
If you are running on a shared server, try this for your cron and see if it works: Its an option that might work, works for me. /usr/bin/wget -O- www.domain.com/perodic/cron.php. Let it send a few emails to you and check the results. This will run your cron processing videos and other information. After setting, wait for an e-mail and see if you still permissions denied. If so, you may have to rename the .htaccess in the periodic folder or delete the first line in the file. A lot of crons will not run on shared with some of the other configurations because of the .htaccess file is dening access to the file. This is just a suggestion and may not be for you, depending on the security of your server.
Should look something like this.
--19:00:01-- http://xxx.xxxxxxx.com/periodic/cron.php
=> `-'
Resolving www.xxxxxxx.com... xxx.xxx.xxx.xxx Connecting to www.xxxxxx.com|xxx.xxx.xxx.xxx|:... connected.xxxx
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://xxxxxxx.com/periodic/cron.php [following]
--19:00:01-- http://xxxxxxxx.com/periodic/cron.php
=> `-'
Resolving xxxxxxxxx.com... xxx.xxx.xxx.xxx Reusing existing connection to www.xxxxxxxxx.com:.xx
HTTP request sent, awaiting response... 200 OK
Length: 0 [text/html]
0K 0.00 B/s
19:00:02 (0.00 B/s) - `-' saved [0/0]
|