[php] open_basedir restriction *

Pagina: 1
Acties:

  • Righteye
  • Registratie: Juli 2000
  • Laatst online: 18-03 08:27

Righteye

Mijn rechteroog dus.....

Topicstarter
Snap het niet.....heb een website gemaakt (nog onder zware constructie) en thuis op m'n php servertje draait ie prima (standard Apache Triad php/web-servertje) en alles werkt perfect. Upload ik hem naar de homepageruimte bij mijn webhost, dan werken ineens de links naar .php bestanden in sub directory's niet meer. :'(

De volgende foutmelding verschijnt:
Warning: open_basedir restriction in effect. File is in wrong directory. in /usr/local/slash/apache/vhosts/klappe.nu/httpdocs/index.php on line 80

Warning: Failed opening 'main\\main.php' for inclusion (include_path='.:/usr/local/slash/apache/lib/php') in /usr/local/slash/apache/vhosts/klappe.nu/httpdocs/index.php on line 80

Heb gezocht op Google en op GoT zelf, heb wel wat gevonden (schijnt iets met de safemode :? instelling te maken te hebben...maar kan verder geen echt antwoord vinden. Heb al effe naar de webhost gemaild...maar nog geen antwoord en wil het zo graag weten.... :'(

Het moet toch gewoon kunnen lijkt mij, linken naar een bestand in een subdir ? Lijkt me toch onzin als dat niet kan........

Weblog van Righteye's gezinnetje - De grote grappige plaatjes website


  • Grum
  • Registratie: Juni 2001
  • Niet online
\\ in je unix-path ? :D

Verwijderd

Zie http://www.php.net/manual/en/configuration.php:
open_basedir string
Limit the files that can be opened by PHP to the specified directory-tree.

When a script tries to open a file with, for example, fopen or gzopen, the location of the file is checked. When the file is outside the specified directory-tree, PHP will refuse to open it. All symbolic links are resolved, so it's not possible to avoid this restriction with a symlink.

The special value . indicates that the directory in which the script is stored will be used as base-directory.

Under Windows, separate the directories with a semicolon. On all other systems, separate the directories with a colon. As an Apache module, open_basedir paths from parent directories are now automatically inherited.

The restriction specified with open_basedir is actually a prefix, not a directory name. This means that "open_basedir = /dir/incl" also allows access to "/dir/include" and "/dir/incls" if they exist. When you want to restrict access to only the specified directory, end with a slash. For example: "open_basedir = /dir/incl/"

Note: Support for multiple directories was added in 3.0.7.

The default is to allow all files to be opened.
Kortom: je mag alleen PHP files openen in een directory en alle subdirectories daarvan. Kennelijk doe je op regel 80 iets wat niet mag volgens deze beperking.

Je probeert waarschijnlijk een file te includen. De include_path staat naar .:/usr/local/slash/apache/lib/php, wat dus buiten het pad van open_basedit staat, dus je mag niet includen.

include_path heeft overigens de volgende functie:
Specifies a list of directories where the require(), include() and fopen_with_path() functions look for files. The format is like the system's PATH environment variable: a list of directories separated with a colon in UNIX or semicolon in Windows. Example 4-3. UNIX include_path

include_path=.:/home/httpd/php-lib


Example 4-4. Windows include_path

include_path=".;c:\www\phplib"


The default value for this directive is . (only the current directory).
Kortom: je include_path staat zo dat je niets kan includen

Ergo: mail je host, en probeer die het probleem te laten oplossen.

HTH :)
edit:

... maar ik kan het mis hebben, want ik heb alleen theoretische kennis van PHP :o

  • Righteye
  • Registratie: Juli 2000
  • Laatst online: 18-03 08:27

Righteye

Mijn rechteroog dus.....

Topicstarter
Heb het nodige geprobeerd, want hij draaide op een Linux server, heeft niets geholpen, nog steeds dezelfde fout of een parse error in die regel.

Heb mijn webhost gemaild en wacht nog steeds op antwoord.

[ Voor 0% gewijzigd door Righteye op 18-09-2002 20:19 . Reden: ...nog bedankt voor de topic rename :) ]

Weblog van Righteye's gezinnetje - De grote grappige plaatjes website


  • dynast
  • Registratie: December 2002
  • Laatst online: 02-08-2025
Ik heb dit probleem dus ook gehad en het lag ook inderdaad aan het include_path in de php.ini.

PHP TRIAD zet standaard het include_path op c:\apache\php\pear
dit moet dus op include_path = ".;c:\apache\htdocs\" zijn.....


ik haat triad :-/