1

I have a dedicated server at 1and1.com using Parallels Plex Panel which I set up with standard settings. I am trying to get the following file to run once a day:

httpdocs/www/routine.php (where httpdocs is the root of my website)

When I input this path in the Command field in their Scheduled Tasks panel, I get a "Permission denied" error. This is not a protected directory and the file runs perfectly from the web.

I have tried many other variations of the command based on things I have found online and info I have found when running phpinfo(). None of the following have worked (see below).

Has anyone here had similar issues at 1and1? What do I need to input into the command field to make this run? Is there a standard formula based on the phpinfo results? 1and1 is refusing to help.

From PHPINFO():

Note below that I have replaced my domain with "example.com" and my username by "unsername". The "default-domain.com" element is something unique to 1and1.com's hosting.

_SERVER["HTTP_HOST"]
www.example.com

PP_CUSTOM_PHP_INI: 
/var/www/vhosts/example.com/etc/php.ini 

DOCUMENT_ROOT 
/var/www/vhosts/default-domain.com/httpdocs/www 

SCRIPT_FILENAME 
/var/www/vhosts/default-domain.com/httpdocs/www/routine.php 

Previously tried:

/var/www/vhosts/default-domain.com/httpdocs/www/routine.php  

/var/www/vhosts/example.com/etc/ /var/www/vhosts/default-domain.com/httpdocs/www/routine.php 

/var/www/vhosts/example.com/etc/php /var/www/vhosts/default-domain.com/httpdocs/www/routine.php 

/var/www/vhosts/example.com/etc/php.ini /var/www/vhosts/default-domain.com/httpdocs/www/routine.php 

/etc/ /var/www/vhosts/default-domain.com/httpdocs/www/routine.php

/usr/lib/php /var/www/vhosts/default-domain.com/httpdocs/www/routine.php 

/bin/ /var/www/vhosts/default-domain.com/httpdocs/www/routine.php 

/bin/php /var/www/vhosts/default-domain.com/httpdocs/www/routine.php

/bin/php /var/www/vhosts/default-domain.com/httpdocs/www/routine.php

/bin/php /var/www/vhosts/default-domain.com/httpdocs/www/routine.php

/sbin/ /var/www/vhosts/default-domain.com/httpdocs/www/routine.php

/sbin/php /var/www/vhosts/default-domain.com/httpdocs/www/routine.php 

/usr/sbin/ /var/www/vhosts/default-domain.com/httpdocs/www/routine.php 

/usr/sbin/php /var/www/vhosts/default-domain.com/httpdocs/www/routine.php

/usr/bin/ /var/www/vhosts/default-domain.com/httpdocs/www/routine.php 

/usr/bin/php /var/www/vhosts/default-domain.com/httpdocs/www/routine.php

/sbin:/usr/sbin:/bin:/usr/bin /var/www/vhosts/default-domain.com/httpdocs/www/routine.php 

php -q /username/example/httpdocs/www/routine.php

php -q /username/example.com/httpdocs/www/routine.php

php -q /example/httpdocs/www/routine.php

php -q /example.com/httpdocs/www/routine.php

php -q /username/httpdocs/www/routine.php

php -q /httpdocs/www/routine.php

php -q /www/routine.php

php -q /routine.php

php /username/example/httpdocs/www/routine.php

php /username/example.com/httpdocs/www/routine.php

php /username/www.example.com/httpdocs/www/routine.php

php /example/httpdocs/www/routine.php

php /example.com/httpdocs/www/routine.php

php /www.example.com/httpdocs/www/routine.php

php /username/httpdocs/www/routine.php

php /httpdocs/www/routine.php

php /www/routine.php
TRiG
  • 10,148
  • 7
  • 57
  • 107

3 Answers3

2

I'm not sure whether you've resolved your problem, but I, after several days, have been able to get a cron job working on my 1and1 account.

I use a Linux server and I found that the following works:

* * * * * /username/usr/bin/wget http://www.example.net/path/file.php

TRiG
  • 10,148
  • 7
  • 57
  • 107
IRHM
  • 1,326
  • 11
  • 77
  • 130
2

You could try calling the script through wget instead.

scc
  • 10,342
  • 10
  • 51
  • 65
0

It may be because your web user doesn't have ssh access permission.

To change that: - Go to your domain control panel - In "Websites & Domains", select FTP access - Select your user. - In the "Access to the server over SSH" select box, choose something other than "Forbidden" (I took "/bin/bash").

If it doesn't work, try "/usr/bin/php" instead of "php" in your commands.

These two things solved the issue for me.

Marm
  • 863
  • 2
  • 15
  • 30