如何使用 PHP 在 Web 服务器上查找绝对路径
以下脚本显示 Web 服务器上的绝对路径,这通常无法仅使用 FTP 找到。
get_absolute_path.php
<?php /* path.php */
list($scriptPath) = get_included_files();
echo $scriptPath;
?>
使用 FTP 将此脚本上传到你的网站空间,然后使用浏览器访问它。它将显示类似这样的路径
path_output.txt
/var/www/httpdocs/webmail.techoverflow.net/path.phpCheck out similar posts by category:
PHP
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow