Title: AI Engine crashes WordPress without define(&#8216;FS_METHOD&#8217;, &#8216;direct&#8217;);
Last modified: May 4, 2025

---

# AI Engine crashes WordPress without define(‘FS_METHOD’, ‘direct’);

 *  Resolved [Michael](https://wordpress.org/support/users/michael8888/)
 * (@michael8888)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/ai-engine-crashes-wordpress-without-definefs_method-direct/)
 * Without define(‘FS_METHOD’, ‘direct’); set, which is the default, AI Engine causes
   WordPress to crash. Visitors will be prompted to enter FTP credentials.
 * The problem appears to be in classes/logging.php at this line: $creds = request_filesystem_credentials(
   site_url(), ”, false, false, []); If I remove this line, the plugin functions,
   but dev logging stops working.
 * I’m curious why request_filesystem_credentials is needed for a logging feature.
   If the plugin can’t write to uploads, it doesn’t make sense to prompt site visitors
   for credentials.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Jordy Meow](https://wordpress.org/support/users/tigroumeow/)
 * (@tigroumeow)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/ai-engine-crashes-wordpress-without-definefs_method-direct/#post-18449502)
 * Hi [@michael8888](https://wordpress.org/support/users/michael8888/),
 * My goal was just to make sure logging would still work on setups without direct
   filesystem access, like **headless WordPress** installs. I didn’t realize it 
   would end up prompting regular users for FTP credentials when direct access wasn’t
   available…
 * To fix this, I’ve removed the explicit credentials request. Now, the plugin checks
   if the filesystem method is set to “direct” (which allows file writes without
   needing credentials). If it is, logging continues as expected. If not, it quietly
   falls back to PHP’s `error_log`, so there are no more FTP prompts or crashes.
   
   I will release the fix in the 2.8.1 version.
 *  Thread Starter [Michael](https://wordpress.org/support/users/michael8888/)
 * (@michael8888)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/ai-engine-crashes-wordpress-without-definefs_method-direct/#post-18449867)
 * That’s great! Thanks a lot!
 * After I removed the credentials request, I no longer saw any logs in the dev 
   log on the AI Engine frontend.
 * I am unsure why you need the WP Filesystem to write to a log file in uploads.
   Many sites don’t use define(‘FS_METHOD’, ‘direct’) due to security. This way,
   you don’t need to give write permissions to the web server in wp-content, which
   means you must provide credentials when updating plugins. However, most sites
   grant write permissions to the uploads folder because you usually don’t have 
   executables there. Thus, you don’t need to fall back to PHP’s error_log and can
   write to uploads without WP Filesystem being enabled.
 *  Thread Starter [Michael](https://wordpress.org/support/users/michael8888/)
 * (@michael8888)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/ai-engine-crashes-wordpress-without-definefs_method-direct/#post-18465604)
 * I still don’t see version 1.8.1 available for the pro edition. It appears to 
   be accessible only in the standard edition of AI engine.
 *  Plugin Support [Val Meow](https://wordpress.org/support/users/valwa/)
 * (@valwa)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/ai-engine-crashes-wordpress-without-definefs_method-direct/#post-18471013)
 * Hey [@michael8888](https://wordpress.org/support/users/michael8888/)! 👋
 * The forum is reserved for users of the **free version** of the plugin. If you’re
   using the **PRO version of AI Engine**, please log in to your MeowApps account
   and reach out to us directly through the support there.
 * The fix for the FTP-related issues is planned for the next update and will be
   available to all users. Thanks for your patience!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘AI Engine crashes WordPress without define(‘FS_METHOD’, ‘direct’);’ is
closed to new replies.

 * ![](https://ps.w.org/ai-engine/assets/icon-256x256.png?rev=3431928)
 * [AI Engine - The Chatbot, AI Framework & MCP for WordPress](https://wordpress.org/plugins/ai-engine/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ai-engine/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ai-engine/)
 * [Active Topics](https://wordpress.org/support/plugin/ai-engine/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ai-engine/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ai-engine/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [Val Meow](https://wordpress.org/support/users/valwa/)
 * Last activity: [1 year, 1 month ago](https://wordpress.org/support/topic/ai-engine-crashes-wordpress-without-definefs_method-direct/#post-18471013)
 * Status: resolved