0

I have a very weird problem with a normal php include when I execute my script in a browser. In the shell everything works fine. So I assumed that either it is a permissions issue or a php configuration issue but as it turned out this is not the case. The really weird thing is that the script ran just fine about an hour ago.

<?php
// sub/cron.php
error_reporting(E_ALL);
ini_set('display_errors', 1);

include '../config.php';
include '../facebook.php';
include '../ez_sql_core.php';
include '../ez_sql_mysql.php';
die();

The files to include lie in httpdocs, the cron.php in httpdocs/sub

  • open_basedir in php.ini is definitely set correctly (/srv/www/vhosts/xxxxx/httpdocs:/tmp)
  • I removed all other php code below the die(); I inserted to preclude any other php issues
  • file permissions are all set correctly
  • I tried absolute paths as well
  • I read tons of other threads!

Errors are the following:

Warning: include(): open_basedir restriction in effect. File() is not within the allowed path(s): (/srv/www/vhosts/xxxxx/httpdocs:/tmp) in /srv/www/vhosts/xxxxx/httpdocs/iblink/mobile/cron.php on line 9
Warning: include(): open_basedir restriction in effect. File() is not within the allowed path(s): (/srv/www/vhosts/j04/api.appworkx.de/httpdocs:/tmp) in /srv/www/vhosts/j04/api.appworkx.de/httpdocs/iblink/mobile/cron.php on line 10
Warning: include(): open_basedir restriction in effect. File() is not within the allowed path(s): (/srv/www/vhosts/j04/api.appworkx.de/httpdocs:/tmp) in /srv/www/vhosts/xxxxx/httpdocs/iblink/mobile/cron.php on line 11
Warning: include(): open_basedir restriction in effect. File() is not within the allowed path(s): (/srv/www/vhosts/xxxxx/httpdocs:/tmp) in /srv/www/vhosts/j04/api.appworkx.de/httpdocs/iblink/mobile/cron.php on line 12

Also strange is that File() is empty. Server admin is puzzled to.

Has anyone further ideas what could be the reason?

Many thanks in advance!

Markus Kottländer
  • 8,228
  • 4
  • 37
  • 61
  • PHP has access, but it is the same for Apache? You know that cronjobs are executed by the server and when you open it in browser is executed by Apache... right? – Mihai Iorga Dec 18 '13 at 14:17
  • What's the error you're getting? :S – phil-lavin Dec 18 '13 at 14:18
  • Yes I know that cron and browser are different users. That is why I assumed it could be due to wrong permissions. But as I mentioned that is not the case. And sry I forgot the error messages. edited – Markus Kottländer Dec 18 '13 at 14:21
  • Is colon : or semicolon ; the correct separator for your php.ini file? Also, cron/command-line and server are more than different users -- they are often completely different environments (different starting point, different versions of PHP etc., different environment variables). – Phil Perry Dec 18 '13 at 15:36
  • Still no idea but because time is short and it works where it will be used the boss instructed us to ignore it... :D Thanks anyway! – Markus Kottländer Dec 18 '13 at 16:38

0 Answers0