php - Get the file size of the index file -
lets have cms set in remoter server. possible actual physical size of index.php file though external php script without running cms?
can't utilize file_get_contents() homecoming whole home page me. need physical filesize of index file. possible?
fortunately that's not possible. functions filesize() handle files on local filesystem obvious reasons.
if access physical filesize of remote file processes other operations (like reading plain file) remote file not secure, it?
however, if have physical access remote server, there no problem connect php.
php provides functionionality connect remote servers using ssh. it's pretty easy (but not handy) work it.
further reading:
php docs ssh2 manual a blogpost goes in depth php's ssh functionalities , it's pitfalls a neat composer bundle working sshif, whatever reasons, can't ssh server, have ftp-server installed, php provides interface working file transfer protocol.
further reading:
php: ftp_size - manual php: ftp - manuali'm sure if wanted to, find bunch of possibilities connect remote server. i've chosen ssh , ftp since pretty mutual , shared-hosting packages provide access through them.
please note: connecting remote servers grab filesize of file pretty much overkill. create sure advantages overcome downsides of it.
@thedom provided example of how provide interface work files on remote server without connecting via ssh or ftp.
php filesize
No comments:
Post a Comment