当网站托管在centos vmware中时,无法获取$ _FILE [“name”] [“tmp_name”]

时间:2014-03-08 03:34:34

标签: php linux joomla permissions centos

我使用centos os构建一个Web服务器,我上传了一个joomla源代码。  网站运行正常!但是当我上传文件时,我可以获得一些文件$_FILE["name"]["tmp_name"],有些文件我无法获得$_FILE["name"]["tmp_name"]  我不知道原因。  EXP:

$attachment = $_FILES['upload'];
echo "<pre>";
print_r($attachment);

输出: 在centos os:

    Array
(
    [name] => Array
        (
            [0] => myfile.zip
            [1] => 
            [2] => 
            [3] => 
            [4] => 
            [5] => 
        )

    [type] => Array
        (
            [0] => //cannot get
            [1] => 
            [2] => 
            [3] => 
            [4] => 
            [5] => 
        )

    [tmp_name] => Array
        (
            [0] => //cannot get
            [1] => 
            [2] => 
            [3] => 
            [4] => 
            [5] => 
        )
}
窗口上的

    Array
(
    [name] => Array
        (
            [0] => myfile.zip
            [1] => 
            [2] => 
            [3] => 
            [4] => 
            [5] => 
        )

    [type] => Array
        (
            [0] => application/octet-stream
            [1] => 
            [2] => 
            [3] => 
            [4] => 
            [5] => 
        )

    [tmp_name] => Array
        (
            [0] => C:\wamp\tmp\phpC2D7.tmp
            [1] => 
            [2] => 
            [3] => 
            [4] => 
            [5] => 
        )
}

感谢收看!

1 个答案:

答案 0 :(得分:0)

检查php.ini以确保您有文件的临时路径。

upload_tmp_dir = [something or commented out to accept a server default]