You are not logged in.

#1 2021-09-17 11:49:04

peewster
Member
From: Netherlands
Registered: 2011-07-18
Posts: 47

php_ftp.dll.so missing [Solved]

Hi

After some upgrades I tried to run some php scripts which make use of the php_ftp.dll.so.

It has been working without issues before, now it seems the module is completely gone.

HP Warning:  PHP Startup: Unable to load dynamic library 'php_ftp.dll' (tried: /usr/lib/php/modules/php_ftp.dll (/usr/lib/php/modules/php_ftp.dll: cannot open shared object file: No such file or directory), /usr/lib/php/modules/php_ftp.dll.so (/usr/lib/php/modules/php_ftp.dll.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

php.ini

cat /etc/php/php.ini | grep extension
; Directives are variables used to configure PHP or PHP extensions.
; dynamically loaded extension (either a PHP extension or a Zend extension),
; you may only use these constants *after* the line that loads the extension.
; encodings.  To use this feature, mbstring extension must be enabled.
; leading '/'. You must also specify the file extension being used including
; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
extension_dir = "/usr/lib/php/modules/"
;extension_dir = "ext"
; If you wish to have an extension loaded automatically, use the following
;   extension=modulename
;   extension=mysqli
; When the extension library to load is not located in the default extension
;   extension=/path/to/extension/mysqli.so
; Note : The syntax used in previous PHP versions ('extension=<ext>.so' and
; 'extension='php_<ext>.dll') is supported for legacy reasons and may be
; move to the new ('extension=<ext>) syntax.
;extension=bcmath
;extension=bz2
;extension=calendar
extension=curl
;extension=dba
;extension=enchant
;extension=exif
;extension=ffi
extension=ftp
extension=php_ftp.dll
;extension=gd
;extension=gettext
;extension=gmp
;extension=iconv
;extension=imap
;extension=intl
;extension=ldap
;extension=mysqli
;extension=odbc
;zend_extension=opcache
;extension=pdo_dblib
;extension=pdo_mysql
;extension=pdo_odbc
;extension=pdo_pgsql
;extension=pdo_sqlite
;extension=pgsql
;extension=pspell
;extension=shmop
;extension=snmp
;extension=soap
;extension=sockets
;extension=sodium
;extension=sqlite3
;extension=sysvmsg
;extension=sysvsem
;extension=sysvshm
;extension=tidy
;extension=xmlrpc
;extension=xsl
extension=zip
; Directory pointing to SQLite3 extensions
; http://php.net/sqlite3.extension-dir
;sqlite3.extension_dir =
; Records communication from all extensions using mysqlnd to the specified log
; Sets the directory name where SOAP extension will put cache files.

Searching for the module shows nothing, module is gone.

php -m

php -m
PHP Warning:  PHP Startup: Unable to load dynamic library 'php_ftp.dll' (tried: /usr/lib/php/modules/php_ftp.dll (/usr/lib/php/modules/php_ftp.dll: cannot open shared object file: No such file or directory), /usr/lib/php/modules/php_ftp.dll.so (/usr/lib/php/modules/php_ftp.dll.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
[PHP Modules]
Core
ctype
curl
date
dom
fileinfo
filter
ftp
hash
json
libxml
mbstring
mysqlnd
openssl
pcntl
pcre
PDO
Phar
posix
readline
Reflection
session
SimpleXML
SPL
standard
tokenizer
xml
xmlreader
xmlwriter
zip
zlib

I can't find the module anywhere in the repo's anymore, it has been a long time ago I installed the module. Is it part of a different package now?

Thanks in advance.

Last edited by peewster (2021-09-18 07:26:06)


PoC || GTFO

Offline

#2 2021-09-17 20:54:32

mpan
Member
Registered: 2012-08-01
Posts: 1,188
Website

Re: php_ftp.dll.so missing [Solved]

The module is there and is loaded in your PHP, as indicated by both the supplied configuration file and the output of php -m. It’s called “ftp”, not “php_ftp.dll”.


Sometimes I seem a bit harsh — don’t get offended too easily!

Offline

#3 2021-09-18 07:16:00

peewster
Member
From: Netherlands
Registered: 2011-07-18
Posts: 47

Re: php_ftp.dll.so missing [Solved]

Tested php ftp script from terminal, seems to be working. Must be something with my browser...

EDIT: Just read that Firefox from version 90, does not support FTP anymore.

Last edited by peewster (2021-09-18 07:25:40)


PoC || GTFO

Offline

#4 2021-09-18 17:46:19

mpan
Member
Registered: 2012-08-01
Posts: 1,188
Website

Re: php_ftp.dll.so missing [Solved]

PHP works on the server. It only generates content that is sent to the browser. PHP’s modules and a browser are two different worlds. Whatever the script is doing, it’s done before the browser even starts processing the output.⁽¹⁾ So the browser shouldn’t affect what your code does. The problem must be elsewhere.

Simplifying it a bit, this is the conceptual model of what’s happening:

,--------.             ,--------.
| Client |             | Server |
`--------'             `--------'
    |                       |
   ,-.   GET /script.php    |
   | |-------------------->,-.
   | |                     | | call PHP
   | |                     | |----------.
   | |                     |,-.<--------'
   | |                     || |
   | |       response      || |
   | |<---------------------| |
   | | process             |`-'
   | |-----------.         `-'
   |,-.<---------'          |
   || |                     |
   || |                     |
   .. .                     |
   .. .

____
⁽¹⁾ Technically not true, as the data may be flushed to the client and interpreted before the script finishes, but from abstraction point of view for nearly all scripts that statement holds.


Sometimes I seem a bit harsh — don’t get offended too easily!

Offline

#5 2021-09-21 14:50:23

peewster
Member
From: Netherlands
Registered: 2011-07-18
Posts: 47

Re: php_ftp.dll.so missing [Solved]

Ok I understand what you say, but why do i get full results from the PHP script in my Terminal and only in the browser it doesn't work?


PoC || GTFO

Offline

#6 2021-09-21 16:38:06

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: php_ftp.dll.so missing [Solved]

peewster wrote:

Ok I understand what you say, but why do i get full results from the PHP script in my Terminal and only in the browser it doesn't work?

You answered this yourself in post #3 - Firefox has dropped support for FTP.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#7 2021-09-21 21:03:39

mpan
Member
Registered: 2012-08-01
Posts: 1,188
Website

Re: php_ftp.dll.so missing [Solved]

peewster: it’s impossible to answer without knowing, what software you are talking about and how exactly it breaks.

Slithery: how does Firefox dropping support for FTP affect operation of a server-side PHP module? And how is that then working while executed in a terminal, despite no terminal has support for FTP?

Last edited by mpan (2021-09-21 21:04:10)


Sometimes I seem a bit harsh — don’t get offended too easily!

Offline

#8 2021-09-24 07:27:02

peewster
Member
From: Netherlands
Registered: 2011-07-18
Posts: 47

Re: php_ftp.dll.so missing [Solved]

mpan wrote:

peewster: it’s impossible to answer without knowing, what software you are talking about and how exactly it breaks.

Slithery: how does Firefox dropping support for FTP affect operation of a server-side PHP module? And how is that then working while executed in a terminal, despite no terminal has support for FTP?


This is what happens:

1: php script with ftp connection to public ftp server to download iso files
2: client with firefox opens url to local server and requests the page where the php ftp script will run
3: page is loaded, ftp connection is dropped, no ftp  download links are shown.

Now, when I run the php script manually from my terminal, all ftp download links are shown. I've also checked with chromium, same result, no ftp links are shown, only at the terminal.


PoC || GTFO

Offline

#9 2021-09-24 10:09:27

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,867

Re: php_ftp.dll.so missing [Solved]

Now, when I run the php script manually from my terminal, all ftp download links are shown.

Sounds like the php script uses some fallback option when run outside of a browser, Can you post the script ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Online

#10 2021-09-24 11:20:24

peewster
Member
From: Netherlands
Registered: 2011-07-18
Posts: 47

Re: php_ftp.dll.so missing [Solved]

Sure, here it is, I'm not a PHP guru so it's probably not the best way to do it though...

<?php

$server = "ftp.snt.utwente.nl";

$ftp_con = ftp_connect($server) or die("Not connected.");
$login = ftp_login($ftp_con, "Anonymous", "");

// Set passive mode to ON
ftp_pasv($ftp_con, "true");

// Change to directory
$dir = "pub/os/linux/archlinux/iso/latest/";
if(!ftp_chdir($ftp_con, "$dir")) {
	print "error changing directory";
}
// get file list of current directory
$file_list = ftp_nlist($ftp_con, ".");


print "Download links directly from ftp<br>";
print "Both 32 and 64 bit versions in one iso<br>";

foreach($file_list as $line) {
	$url = "ftp://$server/$dir".$line;
	if($line == "arch") {
		print "<a href=\"javascript:NewWindow('$url','popup','600','600','center','front');\">Arch FTP</a><br>";
		//print "<a href=\"javascript:NewWindow('$url','popup','600','600','center','front');\">archlinux/iso/".$line."</a><br>";
	} else {
		print "<a href='$url'>".$line."</a><br>";

}
}
ftp_close($ftp_con);

?>

PoC || GTFO

Offline

#11 2021-09-25 03:28:22

mpan
Member
Registered: 2012-08-01
Posts: 1,188
Website

Re: php_ftp.dll.so missing [Solved]

If this is literally everything that is being sent, that’s neither declared as HTML (missing the relevant Content-Type) nor it is a valid HTML document. So what a browser does upon receiving that is a lottery.

The script itself is otherwise containing no errors that would prevent it from producing the expected output. It contains security vulnerabilities, but those would not cause anything you have described (quite opposite).

Since I see nothing that fits the description, a quick sanity check:

  • Is PHP actually working on the server at all?

  • What are the response headers and what are the first 20 characters of the output Firefox receives? You can see those in the Network tab of Developers Tools’

  • Does disabling add-ons in Firefox change the situation? Are you using any antivirus software that has a web traffic monitoring function?

Last edited by mpan (2021-09-25 10:11:23)


Sometimes I seem a bit harsh — don’t get offended too easily!

Offline

#12 2021-09-26 16:48:41

peewster
Member
From: Netherlands
Registered: 2011-07-18
Posts: 47

Re: php_ftp.dll.so missing [Solved]

I will check the response headers later.

PHP is working correctly, other scripts work without issues.
No antivirus setup, all done from withing Arch. Pluging make no difference, tested, same behaviour in chromium.


PoC || GTFO

Offline

Board footer

Powered by FluxBB