WriteReadPhpConfig ['wp-config.php']

346 篇文章 0 订阅

wp-admin\includes\network.php:340: if ( ! file_exists( ABSPATH . 'wp-config.php' ) && file_exists( dirname( ABSPATH ) . '/wp-config.php' ) ) {

//Write 'wp-config.php' file:
wp-admin\setup-config.php:51:// Check if wp-config.php has been created
wp-admin\setup-config.php:52:if ( file_exists( ABSPATH . 'wp-config.php' ) )
wp-admin\setup-config.php:55:   __( "The file 'wp-config.php' already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href='%s'>installing now</a>." ),
wp-admin\setup-config.php:60:// Check if wp-config.php exists above the root directory but is not part of another install
wp-admin\setup-config.php:61:if ( @file_exists( ABSPATH . '../wp-config.php' ) && ! @file_exists( ABSPATH . '../wp-settings.php' ) ) {
wp-admin\setup-config.php:64:   __( "The file 'wp-config.php' already exists one level above your WordPress installation. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href='%s'>installing now</a>." ),
wp-admin\setup-config.php:73: * Display setup wp-config.php file header.
wp-admin\setup-config.php:154: /* translators: %s: wp-config.php */
wp-admin\setup-config.php:156:  '<code>wp-config.php</code>'
wp-admin\setup-config.php:160:  /* translators: 1: wp-config-sample.php, 2: wp-config.php */
wp-admin\setup-config.php:163:   '<code>wp-config.php</code>'
wp-admin\setup-config.php:169:  __( 'https://codex.wordpress.org/Editing_wp-config.php' )
wp-admin\setup-config.php:341: /* translators: %s: wp-config.php */
wp-admin\setup-config.php:342: printf( __( 'Sorry, but I can&#8217;t write the %s file.' ), '<code>wp-config.php</code>' );
wp-admin\setup-config.php:345: /* translators: %s: wp-config.php */
wp-admin\setup-config.php:346: printf( __( 'You can create the %s manually and paste the following text into it.' ), '<code>wp-config.php</code>' );
wp-admin\setup-config.php:371:   $path_to_wp_config = ABSPATH . 'wp-config.php';
wp-admin\setup-config.php:373:   $path_to_wp_config = dirname( ABSPATH ) . '/wp-config.php';

<?php
 else :
  /*
   * If this file doesn't exist, then we are using the wp-config-sample.php
   * file one level up, which is for the develop repo.
   */
  if ( file_exists( ABSPATH . 'wp-config-sample.php' ) )
   $path_to_wp_config = ABSPATH . 'wp-config.php';
  else
   $path_to_wp_config = dirname( ABSPATH ) . '/wp-config.php';

  $handle = fopen( $path_to_wp_config, 'w' );
  foreach ( $config_file as $line ) {
   fwrite( $handle, $line );
  }
  fclose( $handle );
  chmod( $path_to_wp_config, 0666 );
  setup_config_display_header();
?>

//Read 'wp-config.php' file:
wp-load.php:34:if ( file_exists( ABSPATH . 'wp-config.php') ) {
wp-load.php:37: require_once( ABSPATH . 'wp-config.php' );
wp-load.php:39:} elseif ( @file_exists( dirname( ABSPATH ) . '/wp-config.php' ) && ! @file_exists( dirname( ABSPATH ) . '/wp-settings.php' ) ) {
wp-load.php:42: require_once( dirname( ABSPATH ) . '/wp-config.php' );

/*
 * If wp-config.php exists in the WordPress root, or if it exists in the root and wp-settings.php
 * doesn't, load wp-config.php. The secondary check for wp-settings.php has the added benefit
 * of avoiding cases where the current directory is a nested installation, e.g. / is WordPress(a)
 * and /blog/ is WordPress(b).
 *
 * If neither set of conditions is true, initiate loading the setup process.
 */
if ( file_exists( ABSPATH . 'wp-config.php') ) {

 /** The config file resides in ABSPATH */
 require_once( ABSPATH . 'wp-config.php' );

} elseif ( @file_exists( dirname( ABSPATH ) . '/wp-config.php' ) && ! @file_exists( dirname( ABSPATH ) . '/wp-settings.php' ) ) {

 /** The config file resides one level above ABSPATH but is not part of another install */
 require_once( dirname( ABSPATH ) . '/wp-config.php' );

} else {


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值