Russian TYPO3 community Форум больше не используется. Присоединяйтесь к каналу #community-ru в Slack for TYPO3 community  

Вернуться   Russian TYPO3 community > Обсуждение общих технических вопросов > Общие вопросы

Ответ
 
Опции темы Опции просмотра
Старый 16.05.2008, 21:36   #11
pomotom
Senior Member
 
Регистрация: 09.12.2007
Сообщений: 281
По умолчанию

установленные модули посмотрите в phpinfo - есть в инсталтуле
pomotom вне форума   Ответить с цитированием
Старый 16.05.2008, 21:43   #12
Игорь Ф.
Продвинутый
 
Регистрация: 16.05.2008
Сообщений: 68
По умолчанию

Цитата:
1) Проверить установлен ли curl
2) Проверить доступен ли на запись каталог typo3temp
1) phpinfo говорит, что curl есть:
...
Configure Command
'./configure' '--with-config-file-path=/usr/local/etc' '--with-mysql=/usr/servers/mysql' '--enable-discard-path' '--enable-track-vars' '--enable-dbase' '--enable-exif' '--with-gd=/usr/local/' '--enable-exif' '--enable-memory-limit' '--enable-mbstring' '--with-zlib' '--with-iconv' '--with-gettext' '--with-mcrypt' '--enable-bcmath' '--enable-gd-native-ttf' '--with-ttf' '--with-freetype-dir=/usr/local' '--with-jpeg-dir=/usr/local' '--enable-xslt' '--with-xslt-sablot=/usr/local' '--with-expat-dir=/usr/local' '--with-curl' '--with-dom'
...
curl
CURL support enabled
CURL Information libcurl/7.15.5 OpenSSL/0.9.7e zlib/1.2.3


Как еще можно проверить его функциональность?

2) права на typo3temp и все папки внутри я сейчас 777 поставил. Но не помогает.

===

Я сейчас решил проверить, что с переменными происходит:
Цитата:
$extmd5 = t3lib_div::getURL($mirror.'extensions.md5');
if(is_file(PATH_site.'typo3temp/extensions.xml.gz')) $localmd5 = md5_file(PATH_site.'typo3temp/extensions.xml.gz');
if($extmd5 === false) {
$content .= '<p>Error:
The extension MD5 sum could not be fetched from '.$mirror.'extensions.md5. Possible reasons: network problems, allow_url_fopen is off, curl is not enabled in Install tool.</p>';
$extmd5 выдает как 0.

Цитата:
$mirrorsFile = t3lib_div::getURL($this->MOD_SETTINGS['mirrorListURL']);
if($mirrorsFile===false) {
t3lib_div::unlink_tempfile($mfile);
$content = '<p>The mirror list was not updated, it could not be fetched from '.$this->MOD_SETTINGS['mirrorListURL'].'. Possible reasons: network problems, allow_url_fopen is off, curl is not enabled in Install tool.</p>';
$mirrorsFile тоже 0.

Соответственно ошибка все-таки сидит где-то в getURL, т.к. $this->MOD_SETTINGS['mirrorListURL'].' отображает правильно как http://repositories.typo3.org/mirrors.xml.gz
Игорь Ф. вне форума   Ответить с цитированием
Старый 16.05.2008, 22:03   #13
pomotom
Senior Member
 
Регистрация: 09.12.2007
Сообщений: 281
По умолчанию

а наоборот, отключать curl в инсталтуле пробовали?
pomotom вне форума   Ответить с цитированием
Старый 16.05.2008, 23:04   #14
Игорь Ф.
Продвинутый
 
Регистрация: 16.05.2008
Сообщений: 68
По умолчанию

Цитата:
установленные модули посмотрите в phpinfo - есть в инсталтуле
У меня gzip нигде в phpinfo не упоминается. Может с этим есть какая-то проблема?

Цитата:
а наоборот, отключать curl в инсталтуле пробовали?
Да, у меня изначально стояло: [SYS][curlUse] = 0
Я поставил 1.

Тут все (или не все?) упирается в функцию getURL из class.t3lib_div.php, которая видимо некорректно работает (?). Она как раз на основе CURL работает.
Игорь Ф. вне форума   Ответить с цитированием
Старый 17.05.2008, 16:13   #15
void
Senior Member
 
Аватар для void
 
Регистрация: 14.03.2006
Адрес: Russia, Penza
Сообщений: 1,504
Отправить сообщение для void с помощью ICQ
По умолчанию

Она работает через CURL только если вы прямо задали такую настройку в Install Tool. В других случаях она работает через fsockopen.
__________________
TYPO3 FAQ
void вне форума   Ответить с цитированием
Старый 19.05.2008, 00:02   #16
Игорь Ф.
Продвинутый
 
Регистрация: 16.05.2008
Сообщений: 68
По умолчанию

Цитата:
Сообщение от void Посмотреть сообщение
Она работает через CURL только если вы прямо задали такую настройку в Install Tool. В других случаях она работает через fsockopen.
Ну, вот как выглядит функция, которая мне возвращает 0 вместо какого-то значения:

Цитата:
function getURL($url, $includeHeader = 0, $requestHeaders = false) {
$content = false;

// (Proxy support implemented by Arco <arco@appeltaart.mine.nu>)
if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['curlUse'] == '1' && preg_match('/^https?:\/\//', $url)) {
// External URL without error checking.
$ch = curl_init();
if (!$ch) {
return false;
}

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, $includeHeader ? 1 : 0);
curl_setopt($ch, CURLOPT_NOBODY, $includeHeader == 2 ? 1 : 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
if (is_array($requestHeaders)) {
curl_setopt($ch, CURLOPT_HTTPHEADER, $requestHeaders);
}

// may fail (5.2.0, 5.1.5+ and 4.4.4+) when open_basedir or safe_mode are enabled
@curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['curlProxyServer']) {
curl_setopt($ch, CURLOPT_PROXY, $GLOBALS['TYPO3_CONF_VARS']['SYS']['curlProxyServer']);

// Not sure if this is needed
if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['curlProxyTunnel']) {
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, $GLOBALS['TYPO3_CONF_VARS']['SYS']['curlProxyTunnel']);
}
if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['curlProxyUserPass']) {
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $GLOBALS['TYPO3_CONF_VARS']['SYS']['curlProxyUserPass']);
}
}
$content = curl_exec($ch);
curl_close($ch);

} elseif ($includeHeader) {
$parsedURL = parse_url($url);
if (!t3lib_div::inList('http,https', $parsedURL['scheme'])) {
return false;
}
$port = intval($parsedURL['port']);
if ($parsedURL['scheme'] == 'http') {
$port = ($port>0 ? $port : 80);
$scheme = '';
} else {
$port = ($port>0 ? $port : 443);
$scheme = 'ssl://';
}

$fp = @fsockopen($scheme.$parsedURL['host'], $port, $errno, $errstr, 2.0);
if (!$fp || $errno > 0) {
return false;
}

$msg = 'GET ' . $parsedURL['path'] .
($parsedURL['query'] ? '?' . $parsedURL['query'] : '') .
' HTTP/1.0' . "\r\n" . 'Host: ' .
$parsedURL['host'] . "\r\n";
if (is_array($requestHeaders)) {
$msg .= implode("\r\n", $requestHeaders). "\r\n";
}
$msg .= "\r\n";
fputs($fp, $msg);
while (!feof($fp)) {
$line = @fgets($fp, 2048);
$content.= $line;
if ($includeHeader == 2 && !strlen(trim($line))) {
break; // Stop at the first empty line (= end of header)
}
}
fclose($fp);

} elseif (is_array($requestHeaders)) {
$ctx = stream_context_create(array(
'http' => array(
'header' => implode("\r\n", $requestHeaders)
)
)
);
if (version_compare(phpversion(), '5.0', '>=')) {
$content = @file_get_contents($url, false, $ctx);
}
elseif (false !== ($fd = @fopen($url, 'rb', false, $ctx))) {
$content = '';
while (!feof($fd)) {
$content.= @fread($fd, 4096);
}
fclose($fd);
}
}
else {
$content = @file_get_contents($url);
}

return $content;
}
Так как у меня переменная только одна, то соотвтетственно я на второй и третий elseif вообще не смотрю.

То есть остается только:

Цитата:
function getURL($url, $includeHeader = 0, $requestHeaders = false) {
$content = false;

// (Proxy support implemented by Arco <arco@appeltaart.mine.nu>)
if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['curlUse'] == '1' && preg_match('/^https?:\/\//', $url)) {
// External URL without error checking.
$ch = curl_init();
if (!$ch) {
return false;
}

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, $includeHeader ? 1 : 0);
curl_setopt($ch, CURLOPT_NOBODY, $includeHeader == 2 ? 1 : 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
if (is_array($requestHeaders)) {
curl_setopt($ch, CURLOPT_HTTPHEADER, $requestHeaders);
}

// may fail (5.2.0, 5.1.5+ and 4.4.4+) when open_basedir or safe_mode are enabled
@curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['curlProxyServer']) {
curl_setopt($ch, CURLOPT_PROXY, $GLOBALS['TYPO3_CONF_VARS']['SYS']['curlProxyServer']);

// Not sure if this is needed
if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['curlProxyTunnel']) {
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, $GLOBALS['TYPO3_CONF_VARS']['SYS']['curlProxyTunnel']);
}
if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['curlProxyUserPass']) {
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $GLOBALS['TYPO3_CONF_VARS']['SYS']['curlProxyUserPass']);
}
}
$content = curl_exec($ch);
curl_close($ch);

...
else {
$content = @file_get_contents($url);
}

return $content;
}
Получается, что если CURL включен, то выполняется первая процедура, а если нет, то все сводится к строчке:
$content = @file_get_contents($url);

Я прав? Или я что-то не понимаю?
Игорь Ф. вне форума   Ответить с цитированием
Старый 19.05.2008, 00:19   #17
Игорь Ф.
Продвинутый
 
Регистрация: 16.05.2008
Сообщений: 68
По умолчанию

Отключил CURL.
После строчки $content = @file_get_contents($url);
поставил
$content = 1;

В случае с перезагрузкой зеркал - никаких изменений. Значение выдается 0.

В случае с Import Extension выдал:
Цитата:
The extensions list has been updated and now contains 0 extension entries.
Игорь Ф. вне форума   Ответить с цитированием
Старый 19.05.2008, 01:23   #18
Игорь Ф.
Продвинутый
 
Регистрация: 16.05.2008
Сообщений: 68
По умолчанию

Попробовал впрямую протеститровать file_get_contents.
В файл class.em_index.php вставил выделенные красным строчки:

Цитата:
$mirrorsFile = t3lib_div::getURL($this->MOD_SETTINGS['mirrorListURL']);
$mirrorsFile = file_get_contents($this->MOD_SETTINGS['mirrorListURL']);
if($mirrorsFile===false) {
t3lib_div::unlink_tempfile($mfile);
$content = $mirrorsFile+'<p>The mirror list was not updated, it could not be fetched from '.$this->MOD_SETTINGS['mirrorListURL'].'. Possible reasons: network problems, allow_url_fopen is off, curl is not enabled in Install tool.</p>';
При попытке перезагрузить зеркала выдает следующее:

Сверху страницы:
Цитата:
Warning: file_get_contents(http://repositories.typo3.org/mirrors.xml.gz): failed to open stream: Permission denied in .../www/typo3/mod/tools/em/class.em_index.php on line 1434
На месте ошибки все тоже самое:
Цитата:
0http://repositories.typo3.org/mirrors.xml.gz. Possible reasons: network problems, allow_url_fopen is off, curl is not enabled in Install tool.
Игорь Ф. вне форума   Ответить с цитированием
Старый 24.05.2008, 11:19   #19
Игорь Ф.
Продвинутый
 
Регистрация: 16.05.2008
Сообщений: 68
По умолчанию

Может с правами что-то не то. Пока не понял в чем дело.
Игорь Ф. вне форума   Ответить с цитированием
Старый 02.06.2008, 22:26   #20
Игорь Ф.
Продвинутый
 
Регистрация: 16.05.2008
Сообщений: 68
По умолчанию

Сейчас создал в корневой директории typo3 файлик i.php со следующим содержанием:

Цитата:
<?php
file_get_contents('http://mail.ru');
?>
Получаю следующее:

Warning: file_get_contents(http://mail.ru): failed to open stream: Permission denied in ../site/www/i.php on line 2

По совету одного из форумов сделал еще один файлик i2.php со следующим содержимым:

Цитата:
<?php
@file_get_contents('http://mail.ru') or die('');
echo 'ok';
?>
Выдает -

Значит функция не работает?

Напоминаю, что allow_url_fopen у меня on.

Думаю, может стоит провайдеру написать? Или я туплю?
Игорь Ф. вне форума   Ответить с цитированием
Ответ


Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB code is Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.

Быстрый переход

Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Трабл с загрузкой *.t3x в Extension Manager Raven2000 Общие вопросы 6 08.08.2007 18:15
Что за порнографию сделали с Extension Manager в версии 4.1? Guinness Общие вопросы 4 28.03.2007 04:35
Extension Manager не отображается Хороший Общие вопросы 1 16.08.2006 13:29
Extension Manager: nick Установка 1 08.09.2005 11:38
Problem with Extension Manager. Dmi3 Общие вопросы 2 27.04.2005 14:44


Часовой пояс GMT +4, время: 14:23.


Работает на vBulletin® версия 3.8.1.
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Перевод: zCarot

Хостинг и техническая поддержка: TYPO3 Лаборатория