• Resolved dwhite15

    (@dwhite15)


    Hi, I also posted this question on Stack Exchange:

    On a fresh WordPress install in Linux distributions, wp-config-sample.php contains Carriage Return control characters that are not present in any other .php file in the distribution.

    For example if you run

    egrep -l $'\r'\$ *.php

    wp-config-sample.php will be the only file returned.

    I am not worried about eliminating the control character, nor am I worried that it interferes with install operations (it doesn’t).

    I’d just like to find out if there’s a reason why wp-config-sample.php is the only file with this anomaly.

    Thanks

    • This topic was modified 4 years, 3 months ago by dwhite15.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Sajjad Hussain

    (@sajjadhussain2509)

    Hello,
    The wp-config-sample file is a sample file you can replace with wp-config.php.
    For more details, you can see the document

    Editing wp-config.php

    Thread Starter dwhite15

    (@dwhite15)

    @sajjadhussain2509 thanks but this does not answer my question.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Hi, I also posted this question on Stack Exchange:

    Please don’t double post too often. You’ll just create duplicates that you’ll need to track.

    I’d just like to find out if there’s a reason why wp-config-sample.php is the only file with this anomaly.

    It’s for formatting on legacy DOS based systems. Some DOS and Windows based editors will not handle the file correctly without those additional ^M carriage return character. A UNIX based system will work with or without them and that’s why they don’t matter.

    https://en.wikipedia.org/wiki/Newline

    This is how a portion of that file should edit.

    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define( 'DB_NAME', 'database_name_here' );
    /** MySQL database username */
    define( 'DB_USER', 'username_here' );
    /** MySQL database password */
    define( 'DB_PASSWORD', 'password_here' );
    /** MySQL hostname */
    define( 'DB_HOST', 'localhost' );

    Which is readable.

    If a new user used the Windows notepad editor then the file would may look like this especially on older versions of Windows.

    
    // ** MySQL settings - You can get this info from your web host ** ///** The name of the database for WordPress */define( 'DB_NAME', 'database_name_here' );/** MySQL database username */define( 'DB_USER', 'username_here' );/** MySQL database password */define( 'DB_PASSWORD', 'password_here' );/** MySQL hostname */define( 'DB_HOST', 'localhost' );
    

    Which is one line of mess. It would still work as a PHP file because the newline is less important than the ; in the file. The additional ^Ms will be ignored and for those other editor applications the user will see something they can both parse and edit.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    @dwhite15 Also I’ve moved this to Everything else WordPress as it’s not really an Installing WordPress topic.

    Thread Starter dwhite15

    (@dwhite15)

    Great, thanks for taking the time Jan.

    Thread Starter dwhite15

    (@dwhite15)

    Marking as resolved.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘control character Carriage Return (^M) found in wp-config-sample.php’ is closed to new replies.