Hot answers tagged

34

Set file permissions On Mac OS X (Leopard), the Apache HTTP Server runs under the user account, _www which belongs to the group _www. To allow WordPress to configure wp-config.php during installation, update files during upgrades, and update the .htaccess file for pretty permalinks, give the server write permission on the files. One way to do this is to ...


27

The solution I found that worked on my Mac running the builtin Apache2 was to add this to 'wp-config.php' define('FS_METHOD','direct');


16

If you edit your wp-config.php file you can preload these FTP settings as constants read by WordPress. Keep in mind, on a shared host, you should be mindful of possible security implications. See Editing wp-config.php for more information. Your settings will vary, but these work for me and my hosting setup. I've included some of the unused constants, ...


11

Check your file ownership. When the user that apache runs as can write to the wordpress directories, then the integrated upgrade process all just works without ftp. The FTP credentials are for if the web server doesn't have the right priviledges on your files, then wordpress prompts you for your FTP details, and attempts to use those to FTP back to the same ...


7

WordPress does support making connections using SSH (aka SFTP) via the built in updater system. It got this support in version 2.7, approximately 6 years ago. Reference: https://core.trac.wordpress.org/ticket/7690 If you're not seeing it in the normal "credentials" screen, then this is because your PHP installation lacks the support necessary for it to be ...


6

OPTION 1: If a WordPress WXR file, an XML file exported from WordPress, is too large to import, there are several things you might try to overcome that limit. Increase the amount of memory a PHP script may consume. Note: If using a shared hosting service, you may need to ask your host to increase the limit. Increase the memory limit setting in php.ini ...


6

You can save this information on your wp-config.php file: define('FTP_HOST', 'ftp_host'); define('FTP_USER', 'ftp_username'); define('FTP_PASS', 'ftp_password'); More info (WordPress Codex)


6

Your site has likely been hacked. My site had the Darkleech infection, which injected some malicious code into wp-includes/nav-menu.php, causing .htaccess to reset to 444 on any page load. I'd recommend you install the Sucuri plugin and let it restore any files that have been corrupted. Assuming your site was hacked, use their Post-Hack tab to reset ...


5

Short answer: yes you can upgrade your plugins via FTP. Download the new version of the plugin. Disable the plugin you are about to update. Upload files over the top of the plugin. Re-enable plugin If the plugin is written well stats, settings and options should remain intact. As Rarst has already mentioned the automated upgrader just overwites files. ...


5

It seems that not only does WordPress check if the directories are writable, but it checks if the Apache user OWNS the directories (or at least, if the Apache user owns the temporary file it creates). Observe these lines of code at /wp-admin/includes/file.php: get_filesystem_method(): if ( $temp_handle ) { if ( getmyuid() == ...


5

If you're on a shared server, it's unlikely your host will correct this issue, but you can add the upgrade constants to your wp-config file so it will at least stop asking every time.


4

Sorry for posting the question above, I fixed it right after posting here, by following these steps I found on this site http://artofsimplicity.co.uk/wordpress-ftp-auto-upgrade-on-ubuntu sudo apt-get install vsftpd sudo useradd wordpress sudo passwd wordpress # set password for wordpress when prompted. sudo usermod -g www-data wordpress sudo chmod -R g+w ...


4

Yes, the plugin @Squideyes suggests you, is perfectly fine, and should do the trick. However, I don't like the link-to-plugin only answers, so here the mine. If you upload the file to a subfolder of the WordPress uploads folder (by default wp-content/uploads, but can be easily changed) than convert a file from there to an attachment post is pretty easy via ...


4

Parts of WordPress use (s)FTP to transfer files. Updates, for example, use (s)FTP. Media uploads do not, at least not unless something has changed in 3.7. If you are connecting to an (s)FTP server you have to provide the credentials that that server needs. Your file permissions won't come into play until after that connection is made. There are constants ...


4

Here's a much better solution: Don't edit the theme's functions.php file. Don't put your custom code into that file either. If you have snippets of code for a site, put them into a custom plugin. Put each one into its own plugin, in fact. Separate them by functionality. I even made a handy dandy plugin to make this easier, called Pluginception. The nice ...


4

This is a permissions issue. wp-content/plugins must be writable by the web server user.


4

define('FS_METHOD', 'ftpext'); define('FTP_BASE', '/path/to/wordpress/'); define('FTP_CONTENT_DIR', '/path/to/wordpress/wp-content/'); define('FTP_PLUGIN_DIR ', '/path/to/wordpress/wp-content/plugins/'); define('FTP_PUBKEY', '/home/username/.ssh/id_rsa.pub'); define('FTP_PRIKEY', '/home/username/.ssh/id_rsa'); define('FTP_USER', 'username'); ...


4

I don´t have the reputation for a comment, so an answer must do it. WordPress uses (s?)FTP to install updates and plugins. Your SSH credentials are something different and most possibly not those ones of an FTP account. If you want to use the built-in FTP function of WordPress your hostname is normally "localhost" because you want to install something on ...


4

This is just, how I understood the idea of the WordPress File API. If it is wrong, please downvote :) Okay. If you upload a file, this file has an owner. If you upload your file with FTP, you login and the file will be owned by the FTP user. Since you have the credentials, you can alter these files through FTP. The owner can usually execute, delete, alter ...


3

Depending on your version of OS X, you will need to configure and run FTP and open a port in the firewall. It's best if you google your OS X version - 10.6, 10.7, etc. - specifically and find the docs necessary to set up FTP and Sharing. You also need to realize the security implications of opening up FTP to your local machine; someone port scanning your IP ...


3

You should demand access to ftp or the command line, working without is is crippling and to be blunt, silly.


3

Here are a couple of options: WP htaccess Control - will let you manually edit your .htaccess file All-in-one htaccess Plugin - will let you dynamically create an .htaccess file based on which modules/features you want set up When all else fails, turn to Google ...


3

Posix is a PHP extension rather than part of PHP core. WordPress tries to minimize use of extensions as much as possible in its core. In specific case of Posix one — it has very notable flaw of not being available on Windows platform altogether.


3

Of course there are better ways to do that. You could use some local installation with a copy of your online website with software such as WAMP, XAMP, etc to make your changes. "Cow Boy" coding is never a good solution. If you miss one ; boom! Fatal error! And in your case this is live. You could also use better process such as git workflows to have a ...


3

I had to also change the owner of the root web directory. chown apache:apache . # or chown apache:apache /var/www/html Edit by Otto: Chloe, as you asked for more information than I could reasonably put into a comment, I'm appending this on to your answer. I hope that is okay. If not, feel free to revert it, or let me know and I will do so. The reason ...


3

It doesn't. WP Filesystem API will ask for FTP credentials, but it will do so for each operation. They aren't stored persistently. They can be stored persistently by hardcoding into wp-config.php, but WP won't do that itself, it's a user action. Note that WP only asks for FTP credentials if it cannot modify files without them. If specific setup used to ask ...


3

What if you try http://wordpress.org/extend/plugins/ssh-sftp-updater-support/ ? If that doesn't work you can do a quick code change to get the logs with which the developer of that plugin can use do more diagnostics.


3

Try to use relative URLs to your imported css files. So try to remove first / from each import URL: @import url('styles/forms.css'); @import url('styles/tables.css'); @import url('styles/homepage.css'); @import url('styles/reset.css'); @import url('styles/stimenu.css'); @import url('styles/layout.css'); @import url('styles/demo.css'); Also pay attention ...


2

This is most likely because of file permissions on your server. WordPress needs to be able to write to the wp-content folder. I highly suggest you read this article about changing file permissions for WordPress. You may also need to CHOWN the directory that contains WordPress to the user that your web server uses. More here.


2

The wp-admin/includes/file.php **get_filesystem_method()** uses an erroneous test to determine if it can write a file. At line 853: if ( getmyuid() == @fileowner($temp_file_name) ) The use of getmyuid() is wrong for unix - instead that should be posix_getuid(). The problem is the getmyuid() will return the owner of the script file not the user that is ...



Only top voted, non community-wiki answers of a minimum length are eligible