Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/252.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Joomla FTP::mkdir错误响应_Php_Joomla - Fatal编程技术网

Php Joomla FTP::mkdir错误响应

Php Joomla FTP::mkdir错误响应,php,joomla,Php,Joomla,我知道关于这个错误有很多解决方案,但没有任何帮助 我在谷歌上搜索,发现很少有解决方案: 还有一些,但是没有任何帮助 我正在使用joomla FTP上传器类,我发现,一切似乎都很好 jimport('joomla.client.ftp'); $host = 'host.myhost.com'; $port = 21; $options = null; $user = 'xx'; $pass = 'xxxxxxxxxx'; $dir = 'tmp_users/' . $this ->

我知道关于这个错误有很多解决方案,但没有任何帮助

我在谷歌上搜索,发现很少有解决方案:

还有一些,但是没有任何帮助

我正在使用joomla FTP上传器类,我发现,一切似乎都很好

jimport('joomla.client.ftp');

$host = 'host.myhost.com';
$port = 21;
$options = null;
$user = 'xx';
$pass = 'xxxxxxxxxx';
$dir = 'tmp_users/' . $this -> user -> id;
//echo $dir;

$ftp_ob = new JFTP();
$ftp = $ftp_ob -> getInstance($host, $port, $options, $user, $pass);

if ($ftp -> isConnected()) {

    if (!is_dir($dir)) {
        $ftp -> mkdir($dir);
        $ftp -> create($dir . '/index.html');
        $ftp -> write($dir . '/index.html', '<!DOCTYPE html><title></title>');
    }
}
另外,chmod主目录到777,当然还有chmod configuration.php等等。主要的问题是,在第一次重新加载页面时,目录创建得很好,一切正常,当我刷新页面时,会发生错误。我试着检查一下

如果是_dir

但没有起作用。至少我检查了joomla/client/ftp.php,找到了那一行,什么也没告诉我

public function mkdir($path)
{
    // If native FTP support is enabled let's use it...
    if (FTP_NATIVE)
    {
        if (ftp_mkdir($this->_conn, $path) === false)
        {
            // HERE IS WHAT MAKES ME NERVOUS BREAKDOWN
            JError::raiseWarning('35', JText::_('JLIB_CLIENT_ERROR_JFTP_MKDIR_BAD_RESPONSE_NATIVE'));
            return false;
        }
        return true;
    }

    // Send change directory command and verify success
    if (!$this->_putCmd('MKD ' . $path, 257))
    {
        JError::raiseWarning('35', JText::sprintf('JLIB_CLIENT_ERROR_JFTP_MKDIR_BAD_RESPONSE', $this->_response, $path));
        return false;
    }
    return true;
}

我使用joomla 2.5

您是否检查了joomla问题跟踪器以了解与此相关的任何问题?我已经假设您运行的是2.5.x系列中的最新版本……是的,我检查过了,我找到的唯一解决方案是使用不同ftp服务器和操作系统的2.5 standart bug。如果已经有该bug的修补程序,您可以参与测试。
public function mkdir($path)
{
    // If native FTP support is enabled let's use it...
    if (FTP_NATIVE)
    {
        if (ftp_mkdir($this->_conn, $path) === false)
        {
            // HERE IS WHAT MAKES ME NERVOUS BREAKDOWN
            JError::raiseWarning('35', JText::_('JLIB_CLIENT_ERROR_JFTP_MKDIR_BAD_RESPONSE_NATIVE'));
            return false;
        }
        return true;
    }

    // Send change directory command and verify success
    if (!$this->_putCmd('MKD ' . $path, 257))
    {
        JError::raiseWarning('35', JText::sprintf('JLIB_CLIENT_ERROR_JFTP_MKDIR_BAD_RESPONSE', $this->_response, $path));
        return false;
    }
    return true;
}