X   Сообщение сайта
(Сообщение закроется через 3 секунды)



 

Здравствуйте, гость (

| Вход | Регистрация )

5 страниц V  < 1 2 3 4 5 >
Открыть тему
Тема закрыта
> Ошибка Warning: is_file(): open_basedir restriction in effect. Как исправить?
Belos
Belos
сообщение 23.1.2017, 17:48; Ответить: Belos
Сообщение #22


rozhok, поменяйте НСы
далее C:\Windows\System32\drivers\etc
С - куда установлена система, может отличаться
файл hosts открываем блокнотом и пишем
IP-хостинга домен(выше ошибся)
и ваш сайт будет доступен для вас
а далее проверяем смену НСок, можно тут - https://www.host-tracker.com/ru


Поблагодарили: (1)
Вернуться в начало страницы
 
Ответить с цитированием данного сообщения
rozhok
rozhok
Topic Starter сообщение 23.1.2017, 17:56; Ответить: rozhok
Сообщение #23


Belos, спасибо. пробрался к сайту. А для всех он действительно может быть недоступен до 48 часов?
Вернуться в начало страницы
 
Ответить с цитированием данного сообщения
Belos
Belos
сообщение 23.1.2017, 17:57; Ответить: Belos
Сообщение #24


rozhok, до 72, зависит от провайдеров, как у них кэшируются днс
Вернуться в начало страницы
 
Ответить с цитированием данного сообщения
rozhok
rozhok
Topic Starter сообщение 23.1.2017, 17:59; Ответить: rozhok
Сообщение #25


Belos, интересная штука. Смотрю сейчас, все прекрасно, никаких ошибок. Действительно помогла лишь смена версии php или же ошибки появятся снова, когда сайт будет доступен полностью?
Вернуться в начало страницы
 
Ответить с цитированием данного сообщения
Belos
Belos
сообщение 23.1.2017, 18:01; Ответить: Belos
Сообщение #26


rozhok, может действительно хостер обновлялся, переносил или еще что-то...
Вернуться в начало страницы
 
Ответить с цитированием данного сообщения
rozhok
rozhok
Topic Starter сообщение 24.1.2017, 16:41; Ответить: rozhok
Сообщение #27


Belos, буду ждать покуда полностью станет доступен сайт. а там уже по обстоятельствам. Всем большое спасибо за ответы.

-----------------------------------------------------------------

Всем здрасте. Моя неравная борьба с косяками продолжается((( Ошибки open_basedir restriction in effect вроде ушли при изменении версии php, но потом снова проявились(((

Что делал:
1. Права на папки выставлены правильно
2. Пути прописаны правильно
3. open_basedir хостер нивкакую отключать не желает, т.к. по его словам это в целом проблему не решит, а значит нужно как-то править скрипт, чтобы он запрашивал правильный путь

Ошибки все подобного рода
Развернуть/Свернуть
Warning: is_file(): open_basedir restriction in effect. File(/media/system/css/modal.css) is not within the allowed path(s): (/home/bh57764:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/bh57764/public_html/libraries/joomla/filesystem/file.php on line 630

Warning: is_file(): open_basedir restriction in effect. File(/media/plg_system_loginpopup/css/style.css) is not within the allowed path(s): (/home/bh57764:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/bh57764/public_html/libraries/joomla/filesystem/file.php on line 630

Warning: is_file(): open_basedir restriction in effect. File(/media/k2/assets/css/magnific-popup.css?v2.7.0) is not within the allowed path(s): (/home/bh57764:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/bh57764/public_html/libraries/joomla/filesystem/file.php on line 630


Код файла /filesystem/file.php с выделенной 630 строкой

Развернуть/Свернуть
<?php
/**
* @package Joomla.Platform
* @subpackage FileSystem
*
* @copyright Copyright © 2005 - 2016 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/

defined('JPATH_PLATFORM') or die;

/**
* A File handling class
*
* @since 11.1
*/
class JFile
{
/**
* Gets the extension of a file name
*
* @param string $file The file name
*
* @return string The file extension
*
* @since 11.1
*/
public static function getExt($file)
{
$dot = strrpos($file, '.');

if ($dot === false)
{
return '';
}

return (string) substr($file, $dot + 1);
}

/**
* Strips the last extension off of a file name
*
* @param string $file The file name
*
* @return string The file name without the extension
*
* @since 11.1
*/
public static function stripExt($file)
{
return preg_replace('#\.[^.]*$#', '', $file);
}

/**
* Makes file name safe to use
*
* @param string $file The name of the file [not full path]
*
* @return string The sanitised string
*
* @since 11.1
*/
public static function makeSafe($file)
{
// Remove any trailing dots, as those aren't ever valid file names.
$file = rtrim($file, '.');

$regex = array('#(\.){2,}#', '#[^A-Za-z0-9\.\_\- ]#', '#^\.#');

return trim(preg_replace($regex, '', $file));
}

/**
* Copies a file
*
* @param string $src The path to the source file
* @param string $dest The path to the destination file
* @param string $path An optional base path to prefix to the file names
* @param boolean $use_streams True to use streams
*
* @return boolean True on success
*
* @since 11.1
*/
public static function copy($src, $dest, $path = null, $use_streams = false)
{
$pathObject = new JFilesystemWrapperPath;

// Prepend a base path if it exists
if ($path)
{
$src = $pathObject->clean($path . '/' . $src);
$dest = $pathObject->clean($path . '/' . $dest);
}

// Check src path
if (!is_readable($src))
{
JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_JFILE_FIND_COPY', $src), JLog::WARNING, 'jerror');

return false;
}

if ($use_streams)
{
$stream = JFactory::getStream();

if (!$stream->copy($src, $dest))
{
JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_JFILE_STREAMS', $src, $dest, $stream->getError()), JLog::WARNING, 'jerror');

return false;
}

return true;
}
else
{
$FTPOptions = JClientHelper::getCredentials('ftp');

if ($FTPOptions['enabled'] == 1)
{
// Connect the FTP client
$ftp = JClientFtp::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']);

// If the parent folder doesn't exist we must create it
if (!file_exists(dirname($dest)))
{
$folderObject = new JFilesystemWrapperFolder;
$folderObject->create(dirname($dest));
}

// Translate the destination path for the FTP account
$dest = $pathObject->clean(str_replace(JPATH_ROOT, $FTPOptions['root'], $dest), '/');

if (!$ftp->store($src, $dest))
{
// FTP connector throws an error
return false;
}

$ret = true;
}
else
{
if (!@ copy($src, $dest))
{
JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_COPY_FAILED_ERR01', $src, $dest), JLog::WARNING, 'jerror');

return false;
}

$ret = true;
}

return $ret;
}
}

/**
* Delete a file or array of files
*
* @param mixed $file The file name or an array of file names
*
* @return boolean True on success
*
* @since 11.1
*/
public static function delete($file)
{
$FTPOptions = JClientHelper::getCredentials('ftp');
$pathObject = new JFilesystemWrapperPath;

if (is_array($file))
{
$files = $file;
}
else
{
$files[] = $file;
}

// Do NOT use ftp if it is not enabled
if ($FTPOptions['enabled'] == 1)
{
// Connect the FTP client
$ftp = JClientFtp::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']);
}

foreach ($files as $file)
{
$file = $pathObject->clean($file);

if (!is_file($file))
{
continue;
}

// Try making the file writable first. If it's read-only, it can't be deleted
// on Windows, even if the parent folder is writable
@chmod($file, 0777);

// In case of restricted permissions we zap it one way or the other
// as long as the owner is either the webserver or the ftp
if (@unlink($file))
{
// Do nothing
}
elseif ($FTPOptions['enabled'] == 1)
{
$file = $pathObject->clean(str_replace(JPATH_ROOT, $FTPOptions['root'], $file), '/');

if (!$ftp->delete($file))
{
// FTP connector throws an error

return false;
}
}
else
{
$filename = basename($file);
JLog::add(JText::sprintf('JLIB_FILESYSTEM_DELETE_FAILED', $filename), JLog::WARNING, 'jerror');

return false;
}
}

return true;
}

/**
* Moves a file
*
* @param string $src The path to the source file
* @param string $dest The path to the destination file
* @param string $path An optional base path to prefix to the file names
* @param boolean $use_streams True to use streams
*
* @return boolean True on success
*
* @since 11.1
*/
public static function move($src, $dest, $path = '', $use_streams = false)
{
$pathObject = new JFilesystemWrapperPath;

if ($path)
{
$src = $pathObject->clean($path . '/' . $src);
$dest = $pathObject->clean($path . '/' . $dest);
}

// Check src path
if (!is_readable($src))
{
JLog::add(JText::_('JLIB_FILESYSTEM_CANNOT_FIND_SOURCE_FILE'), JLog::WARNING, 'jerror');

return false;
}

if ($use_streams)
{
$stream = JFactory::getStream();

if (!$stream->move($src, $dest))
{
JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_JFILE_MOVE_STREAMS', $stream->getError()), JLog::WARNING, 'jerror');

return false;
}

return true;
}
else
{
$FTPOptions = JClientHelper::getCredentials('ftp');

if ($FTPOptions['enabled'] == 1)
{
// Connect the FTP client
$ftp = JClientFtp::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']);

// Translate path for the FTP account
$src = $pathObject->clean(str_replace(JPATH_ROOT, $FTPOptions['root'], $src), '/');
$dest = $pathObject->clean(str_replace(JPATH_ROOT, $FTPOptions['root'], $dest), '/');

// Use FTP rename to simulate move
if (!$ftp->rename($src, $dest))
{
JLog::add(JText::_('JLIB_FILESYSTEM_ERROR_RENAME_FILE'), JLog::WARNING, 'jerror');

return false;
}
}
else
{
if (!@ rename($src, $dest))
{
JLog::add(JText::_('JLIB_FILESYSTEM_ERROR_RENAME_FILE'), JLog::WARNING, 'jerror');

return false;
}
}

return true;
}
}

/**
* Read the contents of a file
*
* @param string $filename The full file path
* @param boolean $incpath Use include path
* @param integer $amount Amount of file to read
* @param integer $chunksize Size of chunks to read
* @param integer $offset Offset of the file
*
* @return mixed Returns file contents or boolean False if failed
*
* @since 11.1
* @deprecated 13.3 (Platform) & 4.0 (CMS) - Use the native file_get_contents() instead.
*/
public static function read($filename, $incpath = false, $amount = 0, $chunksize = 8192, $offset = 0)
{
JLog::add(__METHOD__ . ' is deprecated. Use native file_get_contents() syntax.', JLog::WARNING, 'deprecated');

$data = null;

if ($amount && $chunksize > $amount)
{
$chunksize = $amount;
}

if (false === $fh = fopen($filename, 'rb', $incpath))
{
JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_READ_UNABLE_TO_OPEN_FILE', $filename), JLog::WARNING, 'jerror');

return false;
}

clearstatcache();

if ($offset)
{
fseek($fh, $offset);
}

if ($fsize = @ filesize($filename))
{
if ($amount && $fsize > $amount)
{
$data = fread($fh, $amount);
}
else
{
$data = fread($fh, $fsize);
}
}
else
{
$data = '';

/*
* While it's:
* 1: Not the end of the file AND
* 2a: No Max Amount set OR
* 2b: The length of the data is less than the max amount we want
*/
while (!feof($fh) && (!$amount || strlen($data) < $amount))
{
$data .= fread($fh, $chunksize);
}
}

fclose($fh);

return $data;
}

/**
* Write contents to a file
*
* @param string $file The full file path
* @param string $buffer The buffer to write
* @param boolean $use_streams Use streams
*
* @return boolean True on success
*
* @since 11.1
*/
public static function write($file, $buffer, $use_streams = false)
{
@set_time_limit(ini_get('max_execution_time'));

// If the destination directory doesn't exist we need to create it
if (!file_exists(dirname($file)))
{
$folderObject = new JFilesystemWrapperFolder;

if ($folderObject->create(dirname($file)) == false)
{
return false;
}
}

if ($use_streams)
{
$stream = JFactory::getStream();

// Beef up the chunk size to a meg
$stream->set('chunksize', (1024 * 1024));

if (!$stream->writeFile($file, $buffer))
{
JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_WRITE_STREAMS', $file, $stream->getError()), JLog::WARNING, 'jerror');

return false;
}

return true;
}
else
{
$FTPOptions = JClientHelper::getCredentials('ftp');
$pathObject = new JFilesystemWrapperPath;

if ($FTPOptions['enabled'] == 1)
{
// Connect the FTP client
$ftp = JClientFtp::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']);

// Translate path for the FTP account and use FTP write buffer to file
$file = $pathObject->clean(str_replace(JPATH_ROOT, $FTPOptions['root'], $file), '/');
$ret = $ftp->write($file, $buffer);
}
else
{
$file = $pathObject->clean($file);
$ret = is_int(file_put_contents($file, $buffer)) ? true : false;
}

return $ret;
}
}

/**
* Append contents to a file
*
* @param string $file The full file path
* @param string $buffer The buffer to write
* @param boolean $use_streams Use streams
*
* @return boolean True on success
*
* @since 3.6.0
*/
public static function append($file, $buffer, $use_streams = false)
{
@set_time_limit(ini_get('max_execution_time'));

// If the file doesn't exist, just write instead of append
if (!file_exists($file))
{
return self::write($file, $buffer, $use_streams);
}

if ($use_streams)
{
$stream = JFactory::getStream();

// Beef up the chunk size to a meg
$stream->set('chunksize', (1024 * 1024));

if ($stream->open($file, 'ab') && $stream->write($buffer) && $stream->close())
{
return true;
}

JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_WRITE_STREAMS', $file, $stream->getError()), JLog::WARNING, 'jerror');

return false;
}
else
{
// Initialise variables.
$FTPOptions = JClientHelper::getCredentials('ftp');

if ($FTPOptions['enabled'] == 1)
{
// Connect the FTP client
$ftp = JClientFtp::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']);

// Translate path for the FTP account and use FTP write buffer to file
$file = JPath::clean(str_replace(JPATH_ROOT, $FTPOptions['root'], $file), '/');
$ret = $ftp->append($file, $buffer);
}
else
{
$file = JPath::clean($file);
$ret = is_int(file_put_contents($file, $buffer, FILE_APPEND));
}

return $ret;
}
}

/**
* Moves an uploaded file to a destination folder
*
* @param string $src The name of the php (temporary) uploaded file
* @param string $dest The path (including filename) to move the uploaded file to
* @param boolean $use_streams True to use streams
* @param boolean $allow_unsafe Allow the upload of unsafe files
* @param boolean $safeFileOptions Options to JFilterInput::isSafeFile
*
* @return boolean True on success
*
* @since 11.1
*/
public static function upload($src, $dest, $use_streams = false, $allow_unsafe = false, $safeFileOptions = array())
{
if (!$allow_unsafe)
{
$descriptor = array(
'tmp_name' => $src,
'name' => basename($dest),
'type' => '',
'error' => '',
'size' => '',
);

$isSafe = JFilterInput::isSafeFile($descriptor, $safeFileOptions);

if (!$isSafe)
{
JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_WARNFS_ERR03', $dest), JLog::WARNING, 'jerror');

return false;
}
}

// Ensure that the path is valid and clean
$pathObject = new JFilesystemWrapperPath;
$dest = $pathObject->clean($dest);

// Create the destination directory if it does not exist
$baseDir = dirname($dest);

if (!file_exists($baseDir))
{
$folderObject = new JFilesystemWrapperFolder;
$folderObject->create($baseDir);
}

if ($use_streams)
{
$stream = JFactory::getStream();

if (!$stream->upload($src, $dest))
{
JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_UPLOAD', $stream->getError()), JLog::WARNING, 'jerror');

return false;
}

return true;
}
else
{
$FTPOptions = JClientHelper::getCredentials('ftp');
$ret = false;

if ($FTPOptions['enabled'] == 1)
{
// Connect the FTP client
$ftp = JClientFtp::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']);

// Translate path for the FTP account
$dest = $pathObject->clean(str_replace(JPATH_ROOT, $FTPOptions['root'], $dest), '/');

// Copy the file to the destination directory
if (is_uploaded_file($src) && $ftp->store($src, $dest))
{
unlink($src);
$ret = true;
}
else
{
JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_WARNFS_ERR04', $src, $dest), JLog::WARNING, 'jerror');
}
}
else
{
if (is_writeable($baseDir) && move_uploaded_file($src, $dest))
{
// Short circuit to prevent file permission errors
if ($pathObject->setPermissions($dest))
{
$ret = true;
}
else
{
JLog::add(JText::_('JLIB_FILESYSTEM_ERROR_WARNFS_ERR01'), JLog::WARNING, 'jerror');
}
}
else
{
JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_WARNFS_ERR04', $src, $dest), JLog::WARNING, 'jerror');
}
}

return $ret;
}
}

/**
* Wrapper for the standard file_exists function
*
* @param string $file File path
*
* @return boolean True if path is a file
*
* @since 11.1
*/
public static function exists($file)
{
$pathObject = new JFilesystemWrapperPath;

return is_file($pathObject->clean($file));
}

/**
* Returns the name, without any path.
*
* @param string $file File path
*
* @return string filename
*
* @since 11.1
* @deprecated 13.3 (Platform) & 4.0 (CMS) - Use basename() instead.
*/
public static function getName($file)
{
JLog::add(__METHOD__ . ' is deprecated. Use native basename() syntax.', JLog::WARNING, 'deprecated');

// Convert back slashes to forward slashes
$file = str_replace('\\', '/', $file);
$slash = strrpos($file, '/');

if ($slash !== false)
{
return substr($file, $slash + 1);
}
else
{
return $file;
}
}
}


Прошу хоть каких то советов, потому что уже не знаю как побороть этот косяк(((

Сообщение отредактировал rozhok - 24.1.2017, 16:41
Вернуться в начало страницы
 
Ответить с цитированием данного сообщения
Mowshon
Mowshon
сообщение 24.1.2017, 17:26; Ответить: Mowshon
Сообщение #28


Это конечно Вам с проблемой не поможет, но искусственно ее закрыть можно.

В файле filesystem/file.php 630 добавьте символ @ перед функцией is_file
Цитата
return @is_file($pathObject->clean($file));


Повторюсь, это косметическое решение.

Обновите версию Joomla как вариант.


Поблагодарили: (1)
Вернуться в начало страницы
 
Ответить с цитированием данного сообщения
rozhok
rozhok
Topic Starter сообщение 24.1.2017, 17:37; Ответить: rozhok
Сообщение #29


Mowshon, спасибо хотя бы за такой вариант. Конечно хочется не прикрыть, а устранить проблему((
Нет других мыслей по этому поводу?
Версию Joomla самая последняя, поэтому не думаю, что что-то изменится после обновления(
Вернуться в начало страницы
 
Ответить с цитированием данного сообщения
Mowshon
Mowshon
сообщение 24.1.2017, 18:21; Ответить: Mowshon
Сообщение #30


Спросите у Вашего хостера если можно создать файл php.ini в вашей рабочей папке чтобы расширить его и поиграть с настройками PHP.

Если хостинг особо не напрягается решить проблему то я бы посоветовал сменить хостинг или пересть на VPS (благо они сейчас очень дешевые).

Я рекомендую ВПС от Фриендов реф ссылка | без реф
У них лучшая тех поддержка, решают сами все проблемы.
Вернуться в начало страницы
 
Ответить с цитированием данного сообщения
rozhok
rozhok
Topic Starter сообщение 24.1.2017, 18:55; Ответить: rozhok
Сообщение #31


Mowshon, создать php.ini вряд ли получится, раньше уже сталкивался, ничем помочь не смогли.
Переехать на другой хостинг или сервер подумываю, такие вот проблемы очень уж подталкивают(
Вернуться в начало страницы
 
Ответить с цитированием данного сообщения
5 страниц V  < 1 2 3 4 5 >
Открыть тему
Тема закрыта
2 чел. читают эту тему (гостей: 2, скрытых пользователей: 0)
Пользователей: 0


Свернуть

> Похожие темы

  Тема Ответов Автор Просмотров Последний ответ
Открытая тема (нет новых ответов) Арбитражники, как ведете учет расходов и доходов?
13 Boymaster 1951 Сегодня, 15:06
автор: Boymaster
Горячая тема (нет новых ответов) Как вывести деньги в Украине с заблокированного Юмани ?
29 freeax 4824 17.4.2024, 1:19
автор: sergio11
Горячая тема (нет новых ответов) Как вы отдыхаете от работы за компом
148 adw-kupon.ru 19717 8.4.2024, 10:37
автор: Skyworker
Открытая тема (нет новых ответов) Как вы бросили работу и перешли на заработок с сайтов?
18 uahomka 3111 5.4.2024, 5:53
автор: Skyworker
Горячая тема (нет новых ответов) Как бездомные хранят деньги?
81 metvekot 13662 31.3.2024, 12:44
автор: Boymaster


 



RSS Текстовая версия Сейчас: 20.4.2024, 16:14
Дизайн