工作目录的完整路径。例如,可以在apc中设置有效的排除路径。DIR中断符号链接的includes,但realpath()返回false如果我们没有对父目录的权限。
$IP = getenv( 'MW_INSTALL_PATH' );
if ( $IP === false ) {
if( realpath( '.' ) ) {
$IP = realpath( '.' );
} else {
$IP = dirname( __DIR__ );
}
}
if ( $IP === false ) {
if( realpath( '.' ) ) {
$IP = realpath( '.' );
} else {
$dirnamefile = "C:'Program Files (x86)'Apache Software Foundation'Apache2.2'htdocs'w'";
$IP = dirname( $dirnamefile );
}
}
第二个框中的代码是我修改的,上面的代码是默认的wiki代码(mediawiki)
当我尝试执行此操作时,会出现此错误Program Files (x86)'Apache Software Foundation'Apache2.2'htdocs'w'includes'WebStart.php on line 104
有人能帮我吗?
您正在转义字符串的最后一个引号,因此字符串不会终止:
$dirnamefile = "C:'Program Files (x86)'Apache Software Foundation'...'w'";
^^
更改为:
$dirnamefile = "C:'Program Files (x86)'Apache Software Foundation'...'w''";
注意添加的'
。