Answer the question
In order to leave comments, you need to log in
How and is it possible to make php work with ftp without VPS?
php -i
ftp
FTP support => enabled
FTPS support => enabled
<?php
class FTPClient
{
private $connectionId;
private $loginOk = false;
private $messageArray = array();
public function __construct()
{}
private function logMessage($message)
{
$this->messageArray[] = $message;
}
public function connect($server, $ftpUser, $ftpPassword, $isPassive = false)
{
// *** Установить основное соединение
$this->connectionId = ftp_connect($server);
// *** Логин с именем пользователя и паролем
$loginResult = ftp_login($this->connectionId, $ftpUser, $ftpPassword);
// *** Устанавливает пассивный режим вкл/выкл (on/off) (по умолчанию стоит off)
ftp_pasv($this->connectionId, $isPassive);
// *** Проверка соединения
if ((!$this->connectionId) || (!$loginResult)) {
$this->logMessage('Ошибка подключения по FTP!');
$this->logMessage('Попытка подключения к ' . $server . ' для пользователя ' . $ftpUser, true);
return false;
} else {
$this->logMessage('Соединение к ' . $server . ', для пользователя ' . $ftpUser);
$this->loginOk = true;
return true;
} //...
}
// *** Определите свой хостинг, имя пользователя и пароль
define('FTP_HOST', '192.168.1.88');
define('FTP_USER', 'Blimpf');
define('FTP_PASS', 'catfish');
// *** Включите класс
include 'ftp_class.php';
// *** Создайте объект FTP
$ftpObj = new FTPClient();
// *** Установите соединение
if ($ftpObj->connect(FTP_HOST, FTP_USER, FTP_PASS)) {
//...
And even though I have ftp enabled, I don't understand how I should define the FTP_HOST, FTP_USER, FTP_PASS constants to make it all work. On the Internet, they write something about VPS, etc. Answer the question
In order to leave comments, you need to log in
Your default date language NLS_DATE_LANGUAGE does not match the one specified in the request, so an error occurs. The language can be explicitly specified in the request, for example:
or change at the session level:
You can view the value of the language parameter with the following request
You can convert to timestamp like this:
SELECT cast (TO_DATE('September 11, 2019, 5:02:44 PM', 'MONTH DD, YYYY, HH:MI:SS AM','NLS_DATE_LANGUAGE=AMERICAN') AS TIMESTAMP) FROM DUAL;
FTP support => enabled
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question