php ftp 관련 소스 오류 힌트 문의의 건...

php ftp 관련 소스 오류 힌트 문의의 건...

QA

php ftp 관련 소스 오류 힌트 문의의 건...

본문

안녕하세요.ㅠㅠ

 

다름이 아니옵고..

ftp로 파일을 쏴주는 소스를 쓰고 있습니다.(지금 잘 쓰고 있습니다.)

근데 특정 OS에서..

 

Fatal error: Uncaught exception 'FtpClient\FtpException' with message 'FTP extension is not loaded!' in /usr/local/apache/htdocs/includes/FtpClient/FtpClient.php:77 Stack trace: #0 /usr/local/apache/htdocs/cron_time101.php(17): FtpClient\FtpClient->__construct() #1 {main} thrown in /usr/local/apache/htdocs/includes/FtpClient/FtpClient.php on line 77


이런 오류를 뿜어내고 있습니다. 인터넷 당연히 검색 하였는데 딱히 답이 없는듯하여 문의글 써봅니다..

 

 

 

저는 반팔 입는 나라에 있습니다ㅠㅠ

이래저래 알아봤는데도 힌트를 주실 분이 계실까 하여 글을 남깁니다.

 

 

이 질문에 댓글 쓰기 :

답변 2

77번째 라인을 봐야알겠는데여 예외 오류이고 해당  

라인을 봐야 파악이 될거같습니다. 


define('FTP_SERVER', '10.100.100.*');
define('FTP_USER', 'pi');
define('FTP_PASSWD', 'a123456789');
$target_path = array(
 '/var/www/html/time'
);
include_once("/usr/local/apache/htdocs/includes/FtpClient/FtpClient.php");
include_once("/usr/local/apache/htdocs/includes/FtpClient/FtpWrapper.php");
include_once("/usr/local/apache/htdocs/includes/FtpClient/FtpException.php");
$ftp_client = new \FtpClient\FtpClient();
$ftp_client->connect(FTP_SERVER);
$ftp_client->login(FTP_USER, FTP_PASSWD);
foreach ($target_path as $path) {
 if (!$ftp_client->isDir($path)) {
  $ftp_client->mkdir($path);
 }
}
foreach (glob('/usr/local/apache/htdocs/10100100101/time/*.txt') as $fname) {
 if (!file_exists($fname)) {
  exit;
 }
 $dirname = dirname($fname);
 $filename = basename($fname);
 $f_ary = explode('.', $filename);
 array_pop($f_ary);
 $filename = $dirname ."/". implode('.', $f_ary).".txt";
 rename($fname, $filename);
 foreach ($target_path as $path) {
  $ftp_client->chdir('/');
  $ftp_client->chdir($path);
  $ftp_client->putFromPath($filename);
 }
 unlink($filename);
} 
 
답변을 작성하시기 전에 로그인 해주세요.
전체 138
QA 내용 검색
filter #ftp ×

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT