WordPress.org

Ready to get started?Download WordPress

Forums

Edited wp-config.php now can't login to dashboard (13 posts)

  1. AGKalb
    Member
    Posted 1 year ago #

    Hello everyone,

    I am extremely new to wordpress, but was tasked with fixing two websites for the company I am interning with this summer and things have taken a turn for the worse with one of them. (joke is on them now)

    The "broken" site in question is BPremium.es, which to start with had no theme and wouldn't display any content. Thus, I tried downloading a theme which gave me the error wp content cannot be found.

    So I went into the FTP and edited my wp-config.php with the following code which I saw on this site to possibly fix this issue and make updates/installs easier and saved the file.

    if(is_admin()) {
    add_filter('filesystem_method', create_function('$a', 'return "direct";' ));
    define( 'FS_CHMOD_DIR', 0751 );
    }

    After this, I went to log back into the dashboard to see if it worked. To my suprise when I tried to login it just went to a blank white page!!

    So I went back into the FTP, removed the code I entered at the end of my wp-config.php, and resaved it so it was like the original. I thought this would fix it, but I am still unable to login to the site to edit anything.

    Do you guys have any ideas what the problem may be? Think I might have tried to get a little too advanced too quick but I was feeling somewhat confident until now.

    P.S.- In both websites' FTPs I also cannot even find the wp-content.php anywhere, there was a string of code at the end of the wp-config.php that referenced the wp-content though. Can these files be one in the same? (sorry if that is a dumb question)

  2. esmi
    Forum Moderator
    Posted 1 year ago #

    Did you make a backup of the wp-config.php file before you edited it?

  3. AGKalb
    Member
    Posted 1 year ago #

    I did not. Probably a big mistake on my part. All I did was add and subsequently delete the few lines of code though, could this still have changed other parts of the file?

  4. esmi
    Forum Moderator
    Posted 1 year ago #

    Try checking your site's error logs for messages. Your hosts should be able to help you in accessing your site's error logs.

  5. Media X
    Member
    Posted 1 year ago #

    Did you ask your host if they have backups of your site (the good ones usualy make backups) so that they could restore it?

  6. AGKalb
    Member
    Posted 1 year ago #

    I don't believe we have a host (I think we host our own website?) Can I find anything helpful in the FTP or is there anyway to access the log?

    I found this file- class-wp-error.php -which I thought might be helpful and think might help record errors, but looked through it and it didn't list anything specific.

  7. esmi
    Forum Moderator
    Posted 1 year ago #

    If this is your own server, talk to your server admin(s).

  8. AGKalb
    Member
    Posted 1 year ago #

    I honestly am not sure who our admin(s) are, could be me at the moment. Would disabling widgets maybe help? Or am I about to just keep digging a deeper hole.

    Why after I resaved the file how it used to be would the error still occur though?

    Thank you everyone for the responses so far, and sorry for my lack of knowing anything hahahah.

  9. esmi
    Forum Moderator
    Posted 1 year ago #

    This has nothing to do with widgets.

  10. AGKalb
    Member
    Posted 1 year ago #

    Yeah I thought that was a shot in the dark. Does anyone see a way to solve this problem? Heck at this point I wouldn't mind even just getting it back to being able to login to the dashboard and not worry about fixing theme/install problems

    Would sharing my wp-config.php file help? This is the only thing I touched so I figure this must be the root of the problem somehow.

  11. AGKalb
    Member
    Posted 1 year ago #

    Could anyone try to help me out again? I really need to just unlock the dashboard before I leave for vacation tomorrow hahahah.

    Would it make sense to download/create a new wp-config.php? By editing my wp-config.php in the first place could it have changed anything and other files like the wp-login or admin.

    Please help im desperate!! I feel like this should be a quick fix but it has been killin me for days.

  12. I'm deleting that other topic you've started, duplicate topics are Not Good™.

    From my now deleted reply:

    If it's only the wp-config.php file that you've changed then try the following:

    - Make a backup copy of your existing wp-config.php file. Actually backing up the whole works may not be a bad idea.

    http://codex.wordpress.org/WordPress_Backups
    http://codex.wordpress.org/Backing_Up_Your_Database
    http://codex.wordpress.org/Restoring_Your_Database_From_Backup

    - Rename that existing wp-config.php file to something like wp-config-not-working.php

    - Copy the wp-config-sample.php to wp-config.php. Make sure you renamed the old file first, you don't want to lose that file.

    - Using just the most plain jane text editor locate and set these values for your installation. Notepad or Notepad++ is good for this. You can get these values from your old copy.

    define( 'DB_NAME', 'database_name_here' );
    define( 'DB_USER', 'username_here' );
    define( 'DB_PASSWORD', 'password_here' );
    define( 'DB_HOST', 'your_db_host_here' );

    - Clear your browser's cache and cookies and try to re-login again.

  13. Ekabo
    Member
    Posted 4 months ago #

    Hi...please, I need advice to solve my problem:

    ...I guess I screwed wp-config file by adding two lines of code at the beginning (i did this because I couldn´t login to wp admin) and added these two lines:

    define('WP_HOME','http://erikabrandner.cl');
    define('WP_SITEURL','http://erikabrandner.cl');.

    I don´t know if I made a mistake but now I have no access to anything...FTP can't´connect and CPanel doesn´t open....
    I have the backup wp config but I can't´upload it if I can´t access the files....please, help.

    Is there any possibility to

Topic Closed

This topic has been closed to new replies.

About this Topic