Website Vidya
DeploymentStep-by-Step Guide

How to Start, Stop, and Restart the Nginx Service in 2025

Nginx is a high-performance web server application known for its speed, scalability, and flexibility. It is widely used across the web hosting and DevOps industries for tasks such as serving static content, acting as a reverse proxy, handli...

RR
Website Vidya TeamLead Systems Educator
Published:
7 min read
How to Start, Stop, and Restart the Nginx Service in 2025
AI Executive SummaryCORE CIS AI

7 min read

Nginx is a high-performance web server application known for its speed, scalability, and flexibility. It is widely used across the web hosting and DevOps industries for tasks such as serving static content, acting as a reverse proxy, handli...

Key Highlights
  • Fix WordPress asking for FTP Credentials
  • Best Practices to Avoid WordPress Asking for FTP Credentials in the Future
  • Conclusion
Grounded in full engineering runbookCORE CIS Ai Engine

If you're a WordPress user, chances are high that at some point, you’ve come across the frustrating and confusing "Connection Information" screen. This prompt typically appears when you try to install or update a plugin, theme, or the WordPress core itself. It asks you for FTP credentials such as the hostname, username, and password to proceed. While this is intended to be a security measure, for most users—especially those on shared hosting environments—it becomes a major inconvenience.

The root cause of this issue lies in how WordPress interacts with your server's file system. When it doesn't have the necessary permissions or when the server configuration doesn't allow direct file access, WordPress falls back to asking for FTP credentials. This guide is meant to be your ultimate resource for understanding this problem in detail and resolving it effectively.

Whether you're a blogger, developer, freelancer, or a digital marketer managing multiple websites, fixing this issue the right way will save you time, headaches, and potential security vulnerabilities in the long run.

Fix WordPress asking for FTP Credentials

1. What Is the WordPress FTP Credentials Prompt?

When WordPress needs to modify its files—whether by adding a plugin, updating themes, or applying security patches to the core—it prefers direct access to the file system. When that access isn’t available, it resorts to alternative file transport methods like ftpext, which requires authentication via FTP or FTPS.

The message typically reads:

Connection Information
To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed.

Requested fields include:

  • Hostname (e.g., ftp.yoursite.com or localhost)
  • FTP Username
  • FTP Password
  • Connection Type (FTP or FTPS)

2. Why This Prompt Appears: Deep Dive Into Root Causes

There are multiple scenarios that can trigger this prompt. Let's look into them:

  • File Permissions and Ownership: When WordPress files and folders aren’t owned by the same user that runs the web server (often www-data for Apache/Nginx), it lacks write access.
  • PHP Handler Configurations: Using PHP as an Apache module versus PHP-FPM can affect file permission handling.
  • Security Restrictions on the Server: Some managed hosts or shared environments limit file operations for security.
  • Corrupt or Compromised Files: Infections, backdoors, or unauthorized edits can interfere with expected file behavior.
  • Missing Constants in wp-config.php: WordPress needs configuration cues to determine how to access the file system.

3. Risks of Misguided or Incomplete Fixes

A common but risky fix is to simply force WordPress to use the direct method by adding this to your wp-config.php file:

define('FS_METHOD', 'direct');

While this line works on most VPS or well-configured shared hosts, using it alone—without correcting file permissions or cleaning up infections—can lead to deeper issues like:

  • Broken update processes
  • Plugin installations failing midway
  • Permission escalation vulnerabilities
  • Site slowdown due to improper caching or corrupted plugin data

In short: the quick fix is only part of a larger puzzle.

4. Important Pre-Fix Steps: Backup and Version Check

Before you proceed with any changes, make sure to:

  • Backup Everything: Use tools like UpdraftPlus or manually copy your wp-content folder and database.
  • Check WordPress Version: Ensure you’re using a supported version. Outdated versions might have bugs unrelated to permissions.
  • Verify PHP Compatibility: WordPress recommends PHP 7.4 or above. Check with phpinfo() or contact your host.
  • Confirm Access Type: Whether FTP, SFTP, SSH, or direct web access—know your hosting environment.

5. Quick Permanent Fix Using wp-config.php and Permissions

For many users, resolving the FTP credential issue boils down to setting the correct permissions and modifying configuration files.

A. Modify wp-config.php

Edit the configuration file by inserting this just before the line: /* That's all, stop editing! Happy publishing. */

define('FS_METHOD', 'direct');

This forces WordPress to attempt direct file access instead of FTP.

B. Correct Ownership Settings

Login to your server via SSH and execute:

sudo chown -R www-data:www-data /var/www/html/yourwebsite.com/

Change the path as per your actual directory.

C. Apply Safe Permissions

find /var/www/html/yourwebsite.com/ -type d -exec chmod 755 {} \;
find /var/www/html/yourwebsite.com/ -type f -exec chmod 644 {} \;

D. Restart Your Web Server

sudo systemctl restart apache2
# or for NGINX
sudo systemctl restart nginx

Your FTP prompts should now disappear.

6. Full Manual Fix with Clean Reinstallation

If you suspect malware or file corruption—or just want a clean slate—perform a manual cleanup and reinstall.

Step-by-Step Instructions:

  • Delete All Files in public_html Except wp-content Navigate to public_html and carefully delete everything except the wp-content folder. This preserves your media uploads, themes, and plugins.
  • Manually Inspect wp-content for Malware Look for unusual filenames, hidden PHP files in uploads/, or unknown themes/plugins. Remove them.
  • Download Latest WordPress CMS Visit the official site: https://wordpress.org/download
  • Unzip WordPress Locally or on Server Extract the ZIP file into a temporary directory.
  • Remove Fresh wp-content Folder You already have your original one—so delete the new one from the fresh WordPress files.
  • Upload Remaining Files to public_html Copy the unzipped files (excluding wp-content) into your website’s root.
  • Update wp-config.php Ensure it has the correct database credentials:
define('DB_NAME', 'your_db_name');
define('DB_USER', 'your_db_user');
define('DB_PASSWORD', 'your_db_password');
define('DB_HOST', 'localhost');

And re-add the line:

define('FS_METHOD', 'direct');
  1. Set File Ownership Again
sudo chown -R www-data:www-data /var/www/html/example.com/

7. Proper File and Folder Permission Settings

Correct permissions ensure security and stability.

ItemRecommended Permission
Folders755
Files644
wp-config.php600 (optional secure)
.htaccess644

Run:

find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;

If you face permission-denied errors, recheck ownership (www-data or your specific web user).

8. Post-Fix Maintenance and Hardening Tips

Once the issue is fixed, keep it that way:

  • Install Security Plugins: Wordfence, Sucuri, or iThemes Security
  • Automate Backups: Use UpdraftPlus, Jetpack, or BlogVault
  • Disable File Editing in Dashboard:
define('DISALLOW_FILE_EDIT', true);
  • Scan wp-content Weekly: For backdoors or suspicious files
  • Keep Themes/Plugins Updated: Use auto-update if possible
  • Use a Web Application Firewall (WAF)

9. Conclusion and Community Support

Congratulations! You’ve taken a significant step in securing and stabilizing your WordPress website. The FTP credential prompt issue is often an indication of deeper configuration or security concerns. By following the steps outlined in this guide, you've not only resolved a technical glitch but also enhanced your site’s robustness.

Let’s recap what you’ve achieved:

  • Identified and understood the root cause of the FTP prompt
  • Executed a permanent fix through permissions and configuration
  • Cleaned your site manually (if needed)
  • Reinstalled core WordPress files safely
  • Set the correct ownership and file permissions
  • Implemented ongoing best practices

Still facing problems? Drop a message in the comments or contact me directly. I’ll personally assist you with your issue.

PurposeTool/Plugin Suggestions
SecurityWordfence, Sucuri, iThemes
Permissions FixAll In One WP Security
BackupsUpdraftPlus, BlogVault, Jetpack
FTP AccessFileZilla, Cyberduck
Malware ScanningMalCare, Wordfence Scanner

Best Practices to Avoid WordPress Asking for FTP Credentials in the Future

Preventing WordPress from asking for FTP credentials is mostly about maintaining a clean, secure, and well-configured hosting environment. Following these best practices will help you avoid this issue permanently while also improving your website’s security and performance.

1. Avoid Using FTP to Upload Plugins and Themes Manually

Manually uploading plugins or themes via FTP can sometimes cause ownership mismatches, where files are owned by a different system user than the web server. When this happens, WordPress loses the ability to modify those files, which triggers the FTP credentials prompt.

Whenever possible, install plugins and themes directly from the WordPress dashboard. This ensures that files are created and owned by the correct user, allowing WordPress to update and manage them without permission conflicts.


2. Choose Hosting With Proper WordPress Optimization

Not all hosting providers are optimized for WordPress. Low-quality or poorly configured hosting often restricts PHP’s ability to write files, forcing WordPress to fall back to FTP mode.

Choose a hosting provider that:

  • Supports direct filesystem access
  • Runs PHP as the same user as your WordPress files
  • Offers managed WordPress environments
  • Provides correct default permissions automatically

WordPress-optimized hosting minimizes permission issues and significantly reduces the chances of seeing FTP credential requests.


3. Maintain Standard File and Folder Permissions (755/644)

Correct permissions allow WordPress to write files while keeping your site secure.

  • Folders: 755
  • Files: 644
  • wp-config.php: 600 or 640

Avoid changing permissions randomly while troubleshooting. Incorrect or inconsistent permissions often lead to WordPress losing write access, which results in FTP prompts during updates or installations.


4. Never Use 777 Permissions (Major Security Risk)

Setting permissions to 777 gives read, write, and execute access to everyone, including malicious users and scripts. While it may temporarily stop WordPress from asking for FTP credentials, it exposes your site to:

  • Malware injections
  • Unauthorized file modifications
  • Complete site compromise

Using 777 is a dangerous shortcut and should never be used on a live website. Proper ownership and standard permissions are always the correct solution.


5. Always Update WordPress Through the Dashboard

Updating WordPress core, themes, and plugins via the dashboard ensures that WordPress handles file operations using the correct permissions and ownership.

Avoid:

  • Uploading update files manually
  • Overwriting core files via FTP
  • Using unofficial update methods

Dashboard updates reduce permission conflicts and help WordPress maintain consistency across your file system.


6. Avoid Mixing Multiple Deployment Methods

Using a mix of FTP uploads, file manager edits, Git deployments, and migration tools can cause inconsistent file ownership. Stick to one deployment method whenever possible.

If you use Git or staging environments, make sure deployments preserve correct file ownership and permissions.


7. Regularly Audit File Ownership and Permissions

Occasionally check your WordPress directory to ensure:

  • Files are owned by the correct user
  • No folders have unsafe permissions
  • Core files haven’t been modified unintentionally

This proactive approach helps detect problems before WordPress starts asking for FTP credentials again.

Conclusion

When WordPress asks for FTP credentials, it’s not a random error—it’s a clear signal that your website is facing file permission or server configuration issues. While the prompt may seem harmless, ignoring it or using quick fixes like unsafe permissions can lead to bigger security and stability problems.

In most cases, the issue can be permanently resolved by ensuring proper file ownership, maintaining standard permissions (755 for folders and 644 for files), and allowing WordPress to write files directly using the correct filesystem method. Simple steps like updating plugins through the dashboard, avoiding manual FTP uploads, and choosing a WordPress-optimized hosting provider go a long way in preventing this problem from recurring.

Rather than treating FTP prompts as an inconvenience, consider them a reminder to keep your WordPress environment clean, secure, and well-managed. Fixing the root cause not only eliminates the FTP credential request but also improves your site’s security, performance, and long-term reliability.

By following the solutions and best practices outlined in this guide, you can ensure smooth updates, hassle-free plugin installations, and a more stable WordPress website overall.

Bookmark this guide for future use and share it with fellow developers or WordPress users. Your support helps others fix their sites with confidence!

Written by

Website Vidya Team

Technology educator and researcher at Website Vidya.

Discussion

0
Share your thoughts, ask a question, or suggest a tip...
Write →

No comments on this guide yet. Be the first to share your thoughts or ask a question!

Recommended Reading10 Guides

Related Technical Guides

Tested runbooks, server administration walkthroughs, and troubleshooting guides

Deployment•

How to Install PDO Extension in PHP

PHP Data Objects (PDO) is one of the most important extensions in PHP for working with databases in a secure, consistent, and modern way. If you are building dynamic websites, APIs, CMS platforms, or enterprise applications, PDO is not opti...

RR
Rajesh Rai
Read More
Deployment•

25 Best Linux Commands Every Sysadmin Should Know

If you’ve spent any time managing Linux servers, you already know this truth: the command line is not optional. It’s where real troubleshooting happens, where performance issues are understood, and where outages are prevented before users e...

RR
Rajesh Rai
Read More
Deployment•

How to Fix Snapd Consuming High CPU / RAM on Linux

If you’ve ever opened your system monitor and noticed snapd quietly eating up your CPU or RAM, you’re not alone. Many Linux users—especially on Ubuntu and Ubuntu-based distributions—eventually run into this issue and wonder what’s going on ...

RR
Rajesh Rai
Read More