Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Debugging WordPress

    WordPress (Developer)
    3
    10
    245
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      JLX89 last edited by

      Hello All!
      I'm fairly certain I'm just missing something -- but I'm having issues debugging WordPress. I'm having an issue with Elementor and need to see any WordPress / PHP errors. I've changed the following in wp-config.php and restarted the app to no avail. The debug log doesn't seem to be created or logging in /wp-content/debug.log.

      define( 'WP_DEBUG', true );
      define( 'WP_DEBUG_LOG', true );
      define( 'WP_DEBUG_DISPLAY', false);
      

      Any help with this would be greatly appreciated!

      Thank you!

      murgero 1 Reply Last reply Reply Quote 0
      • murgero
        murgero App Dev @JLX89 last edited by

        @jlx89 Try adding this to the config:

        define( 'WP_DEBUG_LOG','/app/data/output.log' ); This should tell wordpress to output to /app/data/output.log which is outside the web root and also in a writable area of the container. 🙂

        --
        https://urgero.org
        ~ Professional Nerd. Freelance Programmer. ~
        Matrix: @murgero:urgero.org

        1 Reply Last reply Reply Quote 3
        • girish
          girish Staff last edited by

          In addition to what @murgero said, you can also put things in /run/debug.log or /tmp/debug.log as well. Note that the files under /tmp are cleaned up automatically periodically, so this can either be a plus or minus depending on your use case.

          1 Reply Last reply Reply Quote 0
          • J
            JLX89 last edited by

            @murgero Thank you! I gave that a shot, but it still doesn't seem to be working. I am using the "WordPress Developer)" app -- but can migrate this over to a LAMP Stack, if needed.

            @girish Thank you! I'll give the /run/debug.log option a shot. I'd like to be able to view them as needed, rather than having it stored in the /tmp/ directory.

            girish 1 Reply Last reply Reply Quote 0
            • girish
              girish Staff @JLX89 last edited by

              @jlx89 said in Debugging WordPress:

              I am using the "WordPress Developer)" app -- but can migrate this over to a LAMP Stack, if needed.

              The WP Developer app is essentially the same.

              I quickly tried this out. I blindly put the defines you posted at the end of file and it did not work as well :-). It turns out, this was because in wp-config.php, those constants are already defined. In around lines 75-77:

              define( 'WP_DEBUG', false );
              define( 'WP_DEBUG_LOG', false );
              define( 'WP_DEBUG_DISPLAY', false );
              

              I had to remove those duplicate lines, since I guess PHP does not allow re-defining constants.

              After removing them, I added some junk in headers.php like random_function(); and I see that debug.log is created once I visit WP.

              1 Reply Last reply Reply Quote 0
              • J
                JLX89 last edited by

                @girish Yes, I had originally added them at the bottom of wp-config.php and realized they were already defined and changed the values. I added the following and restarted the app, to no avail. I'll give that another shot and see if that works out.

                girish 1 Reply Last reply Reply Quote 0
                • girish
                  girish Staff @JLX89 last edited by

                  @jlx89 I noticed the file is not created, unless there is a real error. Did you put some error in a PHP file ? error_log also works.

                  1 Reply Last reply Reply Quote 0
                  • J
                    JLX89 last edited by

                    @girish Yes, I did that -- error-log doesn't seem to be created nor is anything logged in /wp-content/debug.log.

                    girish 1 Reply Last reply Reply Quote 0
                    • girish
                      girish Staff @JLX89 last edited by

                      @jlx89 I setup a test here - https://my.demo.cloudron.io/#/app/cc6803b8-c862-4a2b-8c12-e25c9a092592 . I put a bad func call here - https://my.demo.cloudron.io/filemanager.html?type=app&id=cc6803b8-c862-4a2b-8c12-e25c9a092592#public/wp-includes/functions.php . Maybe you can check what is different...

                      1 Reply Last reply Reply Quote 0
                      • J
                        JLX89 last edited by

                        @girish So I replicated what you had done in the demo. So that seems to be working now -- after I disabled the plugins we have installed. I'm going to work through and go one-by-one on the plugins and see what is going on. This seems to be a really odd issue.

                        1 Reply Last reply Reply Quote 1
                        • First post
                          Last post
                        Powered by NodeBB