Warning: rand(): Invalid range-Benötige Hilfe

Distl

Grünschnabel
Hallo,

ich bin mit meinen Seiten auf einen neuen Server umgezogen und wollte mein Script wieder installieren und bekomme folgende Fehlermeldung:

Warning: rand(): Invalid range: 0..-1 in /home/www/html/routines.php on line 123

auf dem eien Script und auf dem anderen

Warning: open_basedir restriction in effect. File is in wrong directory in /home/www/html/loadup.php on line 10

Fatal error: Failed opening required 'config.php' (include_path='.:/usr/share/php') in /home/www/html/loadup.php on line 10

Habe ich bei der Installation irgendwetwas übersehen oder falsch gemacht?
Bitte helft mir.

Danke und Gruss
 
Hallo,

hier ist die Zeile 123 von routines.php:

$randpoll = $pollids[rand(0, sizeof($pollids) - 1)];

und hier die Zeile 10 von loadup.php:

require_once("config.php");

Danke
 
Zu 1: Prüfen, ob $pollids überhaupt gefüllt wird (ggf. vorangehenden Code posten). Invalid range: 0..-1 sagt ja schon, dass der "Höchstwert" der Zufallswerte -1 sein soll, da kann ja was nicht stimmen...

Zu 2: PHP-Include-Path prüfen
 
Hallo Woddi,

meine php.ini sieht so aus:

;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;

; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"

; The root of the PHP pages, used only if nonempty.
doc_root =

; The directory under which PHP opens the script using /~usernamem used only
; if nonempty.
user_dir =

; Directory in which the loadable extensions (modules) reside.
extension_dir = ./

; Whether or not to enable the dl() function. The dl() function does NOT work

; properly in multithreaded servers, such as IIS or Zeus, and is automatically
; disabled on them.
enable_dl = On
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Es gibt aber auf dem Server keinen Ordner .:/php/includes.
Was muss ich da eintragen?
Der Pfad zum PHP Ordner sieht so aus, bzw. PHP liegt da:

usr/share/php

Danke
 
Zurück