Move_uploaded_file() open_basedir hiba
sziasztok
atneztem mar rengeteg hozzaszolast a temaval kapcsolatosan,
de nem sikerult megertenem a sajat problemamat:
localhoston mukodik, viszont a netre felpakolva a kov hibat kapom:
itt van a form:es a fuggveny:elore is koszi a segitseget
■ atneztem mar rengeteg hozzaszolast a temaval kapcsolatosan,
de nem sikerult megertenem a sajat problemamat:
localhoston mukodik, viszont a netre felpakolva a kov hibat kapom:
"Warning: move_uploaded_file(): open_basedir restriction in effect. File(/upload/test.txt) is not within the allowed path(s)"
itt van a form:
<form method='post' action='index.php?action=upload&tartalom=ures' enctype='multipart/form-data'>
<input type='file' name='userfile' size='30'>
<input type='submit' value=' upload '>
</form>
<?php
function file_upload()
{
$uploaddir = '/upload/';
$uploadfile = basename($_FILES['userfile']['name']);
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploaddir.$uploadfile))
{
echo "sikeresen feltoltes<br>";
}
else
{
echo "sikertelen feltoltes<br>";
}
#print_r($_FILES);
}
A könyvtár nem elérhető
--------
Poetro
<Nincs cím>
Warning: move_uploaded_file(./upload/test.txt): failed to open stream: No such file or directory in /home/enzo/public_html/test/functions.php on line 346
viszont most is hibauzenetet kapok, azt hiszem, hogy ket konyvtar melyseget kell visszamenni
???
a hibauzenet most is az:
Warning: move_uploaded_file(././upload/test.txt): failed to open stream: No such file or directory in /home/enzo/public_html/test/functions.php on line 346
Visszalépés
--------
Poetro
<Nincs cím>
open_basedir
<Nincs cím>
az ertek amit visszakaptma ez:
/home/enzo:/usr/lib/php:/usr/local/lib/php:/tmp
igy probaltam ki:
$uploaddir = '/tmp/';
nem adott hibauzenetet, de a fajl nem jelenik meg a tmp konyvtarban;
a tobbi konyvtarra hibauzenetet ir ki
???
<Nincs cím>
"On the Fedora Core 3 Linux distribution, you may get a "failed to open stream: Permission denied in ..." message. I fact changing the permission of the directory will not work (even if you set to 0777). It is because of the new SELinux kernel that allow apache user to write only in /tmp dir (I think). In order to solve the problem you must to disable the SELinux (at least for apache service) to allow the server to write in other directories. To do that, run the system-config-securitylevel app and disable the SE to apache service. Reboot your system and continue your work. Hope it helps!"
???