LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-16-2020, 05:07 AM   #1
jonaskellens
Member
 
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 676

Rep: Reputation: 34
[php] ftp_login() gives 500 server error


Hello

I have the following code.
Code:
error_reporting(E_ALL);
ini_set('display_errors', '1');
// FTP-SSL connection
$ftp_conn = ftp_ssl_connect($ftp_server);
print_r($ftp_conn);
// FTP login
$login_result = ftp_login($ftp_conn, $ftp_user_name, $ftp_user_pass);
print_r($login_result);
if (!$login_result) {
    die ("login failed");
} else {
    // FTP upload
}
// Close FTP connection
ftp_close($ftp_conn);
This results in 500 Internal Server error.

When I omit the ftp_login() all finishes correct.
So the problem is at ftp_login() level.
$ftp_conn gives output : Resource id #2

Even though I have error_reporting on, I get no output at all to point me in the correct direction.

Filezilla is no problem :
Code:
12:05:57	Status:	Connecting to xx.xx.xx.xx:21...
12:05:57	Status:	Connection established, waiting for welcome message...
12:05:57	Status:	Initializing TLS...
12:05:57	Status:	Verifying certificate...
12:05:59	Status:	TLS connection established.
12:06:00	Status:	Logged in
12:06:00	Status:	Retrieving directory listing...
12:06:01	Status:	Directory listing of "/" successful
I also tried : use ftp_connect()
Result : same result at ftp_login()

So... I have no idea.

Last edited by jonaskellens; 06-16-2020 at 05:09 AM.
 
Old 06-16-2020, 10:11 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 16,332
Blog Entries: 27

Rep: Reputation: 4882Reputation: 4882Reputation: 4882Reputation: 4882Reputation: 4882Reputation: 4882Reputation: 4882Reputation: 4882Reputation: 4882Reputation: 4882Reputation: 4882
A 500 error indicates that the server is suffering from an internal error of some sort. There's likely nothing you can do about it on your end.

https://www.lifewire.com/500-interna...lained-2622938
 
Old 06-17-2020, 02:40 AM   #3
jonaskellens
Member
 
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 676

Original Poster
Rep: Reputation: 34
Quote:
Originally Posted by frankbell View Post
A 500 error indicates that the server is suffering from an internal error of some sort.
An error on the webserver relating to the FTP system libraries ? Or an error relating to PHP libraries ?
 
Old 06-17-2020, 02:53 AM   #4
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 14,663

Rep: Reputation: 4777Reputation: 4777Reputation: 4777Reputation: 4777Reputation: 4777Reputation: 4777Reputation: 4777Reputation: 4777Reputation: 4777Reputation: 4777Reputation: 4777
you need to log into the server and check the logs. There is no way from the client side to handle it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Apache htdocs owner:group 500:500?? DJRcomputing Linux - Server 2 07-07-2011 08:58 PM
LXer: SpeedFilm Joins Chastain Motorsportsí Indy 500 Program, Credits Tux 500 LXer Syndicated Linux News 0 05-24-2007 03:31 PM
monodoc-http gives a http 500 internal server error ernesto_cgf Linux - Software 0 05-10-2007 03:48 PM
LXer: Tux 500: Linux Sponsors Indianapolis 500 LXer Syndicated Linux News 1 04-18-2007 12:33 PM
Spt 500 Dpt 500 gabsik Linux - Security 2 11-12-2006 03:07 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration