我有一个 header.php 文件。一旦我保存该文件,它就会在几秒钟内从 cPanel 中消失。请注意,我什至根本没有运行 php 文件。
我能够隔离此 header.php 中导致删除的几行代码。
一旦我输入以下 4 行代码并保存文件,该文件就会被删除。这个文件有大约 500 多行代码。
if (substr_count($uri_path, 'index')>0){
$uri_path = str_replace("index", "!", $uri_path);
$url_path='index.php';
}
下面是上述代码之前的一些代码行。
$url_path=$_SERVER['PHP_SELF'];
$position=strrpos($_SERVER['PHP_SELF'],'/');
$uri_path= substr($_SERVER['PHP_SELF'],0,$position).'/';
// *** url_rewrite ***
if ($humo_option["url_rewrite"]=="j"){
$uri_path=$_SERVER['REQUEST_URI'];
我相信 cPanel 正在将其检测为某种安全威胁并将其删除。
检查 cPanel 中的文件权限。我希望这会对您有所帮助。干杯!